Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/add pytest itde plugin #1

Merged
merged 20 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/actions/pytest-plugins-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "pytest-plugin-environment"
description: "This action sets up an environment for testing and building pytest plugins"


inputs:

python-version:
description: 'Python version to use'
required: true
default: 3.9

poetry-version:
description: 'Poetry version to use'
required: true
default: 1.7.1

just-version:
description: 'Just version to use'
required: true
default: 1.16.0

runs:

using: "composite"
steps:

- name: Setup Python (${{ inputs.python-version}})
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Setup Poetry (${{ inputs.poetry-version }})
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ inputs.poetry-version }}

- name: Setup just (${{ inputs.just-version }})
uses: extractions/setup-just@v1
with:
just-version: ${{ inputs.just-version }}

28 changes: 28 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Continues Delivery (Release)

on:
workflow_dispatch:
inputs:
project:
description: 'Project to release'
required: true
default: 'pytest-itde'
type: choice
options:
- "pytest-itde"
version:
description: 'Version number for the release'
required: True
type: int
jobs:
Release:
runs-on: ubuntu-20.04
Nicoretti marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Check
run: |
echo "Stub: validate that all preconditions for the release are meet"

- name:
run: |
just release ${{ inputs.project }} ${{ inputs.version }}
15 changes: 15 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Continues Integration (Master)

on:
workflow_dispatch:
push:
branches:
- main
schedule:
# “At 00:00 on every 7th day-of-month from 1 through 31.” (https://crontab.guru)
- cron: "0 0 1/7 * *"

jobs:

CI:
uses: ./.github/workflows/ci.yml
9 changes: 9 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Continues Integration (PR)

on:
pull_request:

jobs:

CI:
uses: ./.github/workflows/ci.yml
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false

jobs:

Verify:
name: Tests
runs-on: ubuntu-20.04

steps:
- name: SCM Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Development Environment
uses: ./.github/actions/pytest-plugins-environment

- name: Run Tests of all plugins
run: just test

163 changes: 163 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/


.lint.*
55 changes: 55 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.. _pytest-plugins-exasol:

Pytest-Plugins for Exasol
==========================

Welcome to the official repository for Exasol pytest-plugins!
This collection of plugins is designed to enhance and simplify the testing experience for projects related to Exasol.
By providing a centralized location for pytest plugins, we aim to foster collaboration, ensure consistency, and improve the quality of testing practices within the organization.

Introduction
------------

`pytest <https://pytest.org>`_ is a powerful testing framework for `python <https://www.python.org>`_, and with the help of these plugins, developers can extend its functionality to better suit the testing requirements of Exasol-related projects.
Whether you're looking to use database interactions, enhance test reporting, or streamline your testing pipeline, our plugins are here to help.

Plugins
-------

.. list-table::
:header-rows: 1

* - Plugin
- Description
- PYPI
* - pytest-itde
- fixture to enable simple usage with exasols itde proejct
- TBD

Installation
------------

To ensure you're using the latest features and bug fixes, we recommend installing the plugins directly from PyPI using your preferred package manager. This approach simplifies the process of keeping your testing environment up-to-date.

For example, to install the ``pytest-itde`` plugin, you could use the following command:

.. code-block:: bash

pip install pytest-itde

To install a specific version of a plugin, simply specify the version number:

.. code-block:: bash

pip install "pytest-itde==x.y.z"

Replace x.y.z with the desired version number.

Development
-----------

Before you can start developing in this workspace, please ensure you have the following tools installed either globally or at a workspace level.

- `Python <https://www.python.org>`_
- `Just <https://github.com/casey/just>`_

32 changes: 32 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
PROJECTS := "pytest-itde"

# Default target
default:
just --list

# Run tests for one or multiple projects within this respository
test +projects=PROJECTS:
#!/usr/bin/env bash
for p in {{projects}}; do
poetry -C ${p}/ install
poetry -C ${p}/ run nox -f ${p}/noxfile.py -s coverage
done


# Create a release
release project version:
@echo "This currently is a stub, in the future the workflow probably will look somthing like this:"
@echo ""
@echo "poetry -C {{project}} run -f {{project}}/noxfile -s release {{ version }}"
@echo ""
@echo ""
@echo "Workflow:"
@echo "* update version"
@echo "* rename unreleased section to specified version"
@echo "* rename create new empty unreleased section"
@echo "* create git tag"
@echo "* build package/wheel"
@echo "* create & publish github release"
@echo "* create & publish pypi release"
@echo "* create/output slack announcement and print to terminal"

1 change: 1 addition & 0 deletions pytest-itde/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.html-documentation
Loading
Loading