Skip to content

Commit

Permalink
Add toolbox tasks (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti authored Jan 13, 2025
1 parent 84bdd18 commit d60d986
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 212 deletions.
37 changes: 0 additions & 37 deletions .change-log-entries-template.rst

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Project Checks (Python-${{ matrix.python }})
run: poetry run nox -s check
run: poetry run nox -s project:check

tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -87,8 +87,8 @@ jobs:

- name: Run Test for Python ${{ matrix.python }} using ${{ matrix.connector }}
run: |
poetry run nox -s unit-tests
poetry run nox -s integration-tests -- -- --connector ${{ matrix.connector }} --db-version ${{ matrix.exasol_version }}
poetry run nox -s test:unit
poetry run nox -s test:integration -- -- --connector ${{ matrix.connector }} --db-version ${{ matrix.exasol_version }}
upload_to_pypi:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
python-version: ${{ matrix.python }}

- name: Project Checks (Python-${{ matrix.python }})
run: poetry run nox -s check
run: poetry run nox -s project:check

tests:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -86,8 +86,8 @@ jobs:

- name: Run Test for Python ${{ matrix.python }} using ${{ matrix.connector }}
run: |
poetry run nox -s unit-tests
poetry run nox -s integration-tests -- -- --connector ${{ matrix.connector }} --db-version ${{ matrix.exasol_version }}
poetry run nox -s test:unit
poetry run nox -s test:integration -- -- --connector ${{ matrix.connector }} --db-version ${{ matrix.exasol_version }}
build_package:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.lint*
.test-results.db
.html-documentation
odbcconfig/odbcinst.ini

Expand Down
35 changes: 34 additions & 1 deletion noxconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,39 @@
from pathlib import Path
from typing import Iterable

from exasol.toolbox.nox.plugin import hookimpl


class StartDB:

@hookimpl
def pre_integration_tests_hook(self, session, config, context):
port = context.get("port", 8563)
db_version = context.get("db_version", "7.1.17")
session.run(
"itde",
"spawn-test-environment",
"--create-certificates",
"--environment-name",
"test",
"--database-port-forward",
f"{port}",
"--bucketfs-port-forward",
"2580",
"--docker-db-image-version",
db_version,
"--db-mem-size",
"4GB",
external=True,
)


class StopDB:

@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 @@ -16,7 +49,7 @@ class Config:
"venv",
)

plugins = []
plugins = [StartDB, StopDB]


PROJECT_CONFIG = Config()
Loading

0 comments on commit d60d986

Please sign in to comment.