Skip to content

Commit

Permalink
#141: Used plugin pytest_exasol_saas (#143)
Browse files Browse the repository at this point in the history
* #141: Used plugin pytest_exasol_saas
* Updated submission checklist in pull_request_template.md
* Updated separation of SaaS tests
Following the strategy as demonstrated in GitHub repository saas-api-python.
  • Loading branch information
ckunki authored Jun 10, 2024
1 parent 5ae2e0d commit aafc278
Show file tree
Hide file tree
Showing 15 changed files with 139 additions and 179 deletions.
8 changes: 6 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
### Submission Checklist

* [ ] Bumped version number
* [ ] Updated the changelog in file `doc/changes/unreleasd.md`

If required
* [ ] Updated Documentation
* [ ] Updated API Documentation
* [ ] Updated the changelog

If doing a release
* [ ] Bumped version number using `poetry run nox -s prepare-release`
2 changes: 1 addition & 1 deletion .github/workflows/check-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: SCM Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

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

Expand All @@ -27,7 +27,7 @@ jobs:

steps:
- name: SCM Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
Expand All @@ -47,7 +47,7 @@ jobs:

steps:
- name: SCM Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
Expand All @@ -74,7 +74,7 @@ jobs:

steps:
- name: SCM Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
Expand All @@ -96,7 +96,7 @@ jobs:

steps:
- name: SCM Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
64 changes: 45 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: Checks
uses: ./.github/workflows/checks.yml

tests-job:
fast-tests:
name: Tests (Python-${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
Expand All @@ -28,43 +28,69 @@ jobs:
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
- uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/actions-poetry@v3.0.0
with:
poetry-version: 1.2.2

- name: Install Project
run: poetry install

- name: Checkout ITDE
run: git clone https://github.com/exasol/integration-test-docker-environment.git
working-directory: ..

- name: Start EXASOL Test-Environment
- name: Start EXASOL Test-Docker-Environment (ITDE)
run: ./start-test-env spawn-test-environment --environment-name test --database-port-forward 8888 --bucketfs-port-forward 6666 --db-mem-size 4GB
working-directory: ../integration-test-docker-environment

- name: Run Tests
run: poetry run pytest tests

- name: Fail, if SaaS tests are not activated
if: "!contains(github.event.head_commit.message, '[run-saas-tests]') && (matrix.python-version == '3.10')"
run: |
echo "Failed because the SaaS tests are not activated"
exit 1
metrics:
needs: [ fast-tests ]
uses: ./.github/workflows/report.yml

gate-1:
name: Gate 1 - Regular CI
needs: [ fast-tests ]
runs-on: ubuntu-latest
steps:
- name: Branch Protection
run: true

slow-test-detection:
runs-on: ubuntu-latest
steps:
- name: Detect Slow Tests
run: true
environment:
slow-tests

run-slow-tests:
runs-on: ubuntu-latest
needs: [ slow-test-detection ]

steps:
- uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
with:
python-version: "3.10"
poetry-version: "1.2.2"

- name: Run SaaS Tests
if: "contains(github.event.head_commit.message, '[run-saas-tests]') && (matrix.python-version == '3.10')"
env:
SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }}
SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }}
SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }}
run: poetry run pytest test_saas


metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml
gate-2:
name: Gate 2 - Allow Merge
runs-on: ubuntu-latest
needs: [ run-slow-tests ]
steps:
- name: Branch Protection
run: true
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: SCM Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.12.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

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

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ doc/api
.build_output
.html-documentation
itde/

# Emacs
TAGS
8 changes: 8 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Unreleased

## Summary

The current release adds a dependency to plugin `pytest_exasol_saas` and replaces individual test fixtures by those provided by the plugin.

## Refactorings

* #141: Used plugin `pytest_exasol_saas`
20 changes: 18 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ exasol-saas-api=">=0.3.0"
httpx=">=0.27.0"
attrs=">=23.2.0"


[tool.poetry.dev-dependencies]
pyexasol = "^0.25.2"
dill = "^0.3.4"
Expand All @@ -47,6 +46,7 @@ toml = ">=0.10.2"
sphinx-copybutton = "^0.5.0"
exasol-toolbox = ">=0.12.0"
pytest-localserver = "^0.8.1"
pytest-exasol-saas = ">=0.2.1"

[tool.coverage.run]
source = [
Expand Down
97 changes: 0 additions & 97 deletions test_saas/integration/conftest.py

This file was deleted.

Loading

0 comments on commit aafc278

Please sign in to comment.