-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI Checks | ||
|
||
on: | ||
workflow_call: | ||
|
||
|
||
jobs: | ||
|
||
unit-tests: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: [ "3.11" ] | ||
|
||
steps: | ||
- name: SCM Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python & Poetry Environment | ||
uses: exasol/python-toolbox/.github/actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Run Tests | ||
run: | | ||
poetry run nox -s unit-tests | ||
integration-tests: | ||
name: Integration Tests | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: [ "3.11" ] | ||
|
||
steps: | ||
- name: SCM Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python & Poetry Environment | ||
uses: exasol/python-toolbox/.github/actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Run Tests | ||
run: | | ||
poetry run nox -s integration-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,18 +10,4 @@ on: | |
jobs: | ||
|
||
verify: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: SCM Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python & Poetry Environment | ||
uses: exasol/python-toolbox/.github/actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Run all checks | ||
run: | | ||
echo "Stub: This needs to call the checks in the future" | ||
uses: ./.github/workflows/checks.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from __future__ import annotations | ||
from pathlib import Path | ||
from typing import Iterable | ||
import nox | ||
from nox import Session | ||
|
||
__all__ = [ | ||
"unit_tests", | ||
"integration_tests", | ||
] | ||
|
||
_ROOT : Path = Path(__file__).parent | ||
|
||
|
||
def _test_command(path: Path) -> Iterable[str]: | ||
base_command = ["poetry", "run"] | ||
pytest_command = ["pytest", "-v", f"{path}"] | ||
return base_command + pytest_command | ||
|
||
|
||
def _unit_tests(session: Session) -> None: | ||
command = _test_command(_ROOT / "test" / "unit") | ||
session.run(*command) | ||
|
||
|
||
def _integration_tests(session: Session) -> None: | ||
command = _test_command(_ROOT / "test" / "integration") | ||
session.run(*command) | ||
|
||
|
||
@nox.session(name="unit-tests", python=False) | ||
def unit_tests(session: Session) -> None: | ||
"""Runs all unit tests""" | ||
_unit_tests(session) | ||
|
||
|
||
@nox.session(name="integration-tests", python=False) | ||
def integration_tests(session: Session) -> None: | ||
"""Runs the all integration tests""" | ||
_integration_tests(session) | ||
|
||
|
||
@nox.session(name="all-tests", python=False) | ||
def all_tests(session: Session) -> None: | ||
"""Runs all tests (Unit and Integration)""" | ||
command = _test_command(_ROOT / "test") | ||
session.run(*command) |