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

#170 Moved to pytest-exasol-backend #171

Merged
merged 17 commits into from
Nov 25, 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
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/[email protected]
with:
python-version: ${{ matrix.python-version }}
- uses: abatilo/[email protected]
with:
poetry-version: 1.2.2

- name: Install Project
run: poetry install

- name: Checkout ITDE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not need the ITDE anymore? or is it handeled by the pytest-exasol backend?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see configuration in the pytest-exasol backend, but no place the ITDE is actually installed. can you point me to it? i am probably not looking in the right place.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not start the ITDE manually when using the pytest plugins. the pytest-exasol-backend does it for us.

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/[email protected]
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
Loading