Skip to content

Commit

Permalink
#170 Moved to pytest-exasol-backend (#171)
Browse files Browse the repository at this point in the history
* #170 Moved to pytest-exasol-backend

* #170 Dropped Python 3.8

* #170 Dropped tests for Python 3.9

* #170 Updated the tests

* starting the CI

* #170 Updated the CI

* #170 Updated the CI

* #170 Moved test utils

* #170 Moved test utils

* #170 Moved test utils

* #170 handle saas tests

* #170 trying out the legacy tests

* #170 fixed legacy tests conftest.py

* #170 maybe fixed the ci-cd

* #170 maybe fixed the legacy tests

* #170 Enabled saas tests

* #170 Enabled tests with python 3.9
  • Loading branch information
ahsimb authored Nov 25, 2024
1 parent 6b82f14 commit 7b16d26
Show file tree
Hide file tree
Showing 50 changed files with 1,409 additions and 951 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Build Documentation
run: |
poetry run python -m nox -s build-docs
poetry run python -m nox -s docs:build
lint-job:
name: Linting and Type checks (Python-${{ matrix.python-version }})
Expand All @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: SCM Checkout
Expand All @@ -43,10 +43,10 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run Tests
run: poetry run nox -s lint
run: poetry run nox -s lint:code

- name: Run type-check
run: poetry run nox -s type-check
run: poetry run nox -s lint:typing

- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down
23 changes: 6 additions & 17 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]

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

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/python-environment@0.14.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
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: Run Legacy Tests
run: poetry run pytest --backend=onprem test_legacy

cd-job:
name: Continuous Delivery
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
Expand All @@ -29,16 +29,8 @@ jobs:
python-version: ${{ matrix.python-version }}
poetry-version: 1.2.2

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

- 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 nox -s coverage
- name: Run Unit Tests
run: poetry run nox -s test:unit

- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -71,22 +63,26 @@ jobs:
name: Run Slow or Expensive Tests (e.g. SaaS) if Requested
runs-on: ubuntu-latest
needs: [ slow-test-detection ]
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4

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

- name: Run SaaS Tests
- name: Run Integration Tests
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
run: poetry run pytest --backend=all test/integration

gate-2:
name: Gate 2 - Allow Merge
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
path: ./artifacts

- name: Copy Artifacts into Root Folder
if: ${{ hashFiles('./artifacts') != '' }}
working-directory: ./artifacts
run: |
cp .coverage/.coverage ../
Expand All @@ -44,6 +45,7 @@ jobs:
path: metrics.json

- name: Generate GitHub Summary
if: ${{ hashFiles('./artifacts') != '' }}
run: |
echo -e "# Summary\n" >> $GITHUB_STEP_SUMMARY
poetry run nox -s report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
Expand Down
4 changes: 4 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@

## Internal
- Relock dependencies
- Dropped the support for Python 3.8

## Refactoring
- #170: Moved the tests from using pytest-exasol-saas to pytest-exasol-backend.
6 changes: 3 additions & 3 deletions doc/developer_guide/developer_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Tests
Pytest Plugins
--------------

BFSPY declares a dependency to pytest plugin ``pytest-exasol-saas`` which is
maintained in GitHub repository `pytest-plugins/pytest_saas
<https://github.com/exasol/pytest-plugins/tree/main/pytest-saas/>`_. This
BFSPY declares a dependency to pytest plugin ``pytest-exasol-backend`` which is
maintained in GitHub repository `pytest-plugins/pytest_backend
<https://github.com/exasol/pytest-plugins/tree/main/pytest-backend/>`_. This
plugin makes additional fixtures available that are used in the saas
integration tests of BFSPY, see files in folder `test_saas/integration
<https://github.com/exasol/bucketfs-python/tree/main/test_saas/integration/>`_.
Expand Down
40 changes: 0 additions & 40 deletions noxconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,10 @@

from dataclasses import dataclass
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import (
Any,
Iterable,
MutableMapping,
)

from exasol.toolbox.nox.plugin import hookimpl
from nox import Session


class IntegrationTestsPlugin:
@hookimpl
def pre_integration_tests_hook(self, session, config, context):
with TemporaryDirectory() as tmp_dir:
tmp_dir = Path(tmp_dir)
checkout_name = "ITDE"
with session.chdir(tmp_dir):
session.run(
"git",
"clone",
"https://github.com/exasol/integration-test-docker-environment.git",
checkout_name,
)
with session.chdir(tmp_dir / checkout_name):
session.run(
"./start-test-env",
"spawn-test-environment",
"--environment-name",
"test",
"--database-port-forward",
"8888",
"--bucketfs-port-forward",
"6666",
"--db-mem-size",
"4GB",
)

@hookimpl
def post_integration_tests_hook(self, session, config, context):
session.run("docker", "kill", "db_container_test", external=True)


@dataclass(frozen=True)
class Config:
Expand All @@ -56,7 +18,5 @@ class Config:
"venv",
)

plugins = [IntegrationTestsPlugin]


PROJECT_CONFIG = Config()
Loading

0 comments on commit 7b16d26

Please sign in to comment.