Skip to content

Commit 32dd03d

Browse files
authored
#273: Added option "use-existing-container" to run-db-test task (#274)
fixes #273 fixes #275 fixes #276
1 parent 3171705 commit 32dd03d

27 files changed

+656
-159
lines changed

.github/workflows/checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717

1818
- name: Setup Python & Poetry Environment
1919
uses: exasol/python-toolbox/.github/actions/[email protected]
20+
with:
21+
poetry-version: 2.1.2
2022

2123
- name: Check Version(s)
2224
run: |
@@ -43,6 +45,7 @@ jobs:
4345
uses: exasol/python-toolbox/.github/actions/[email protected]
4446
with:
4547
python-version: ${{ matrix.python-version }}
48+
poetry-version: 2.1.2
4649

4750
- name: Run lint
4851
run: poetry run nox -s lint:code
@@ -70,6 +73,7 @@ jobs:
7073
uses: exasol/python-toolbox/.github/actions/[email protected]
7174
with:
7275
python-version: ${{ matrix.python-version }}
76+
poetry-version: 2.1.2
7377

7478
- name: Run type-check
7579
run: poetry run nox -s lint:typing
@@ -90,6 +94,7 @@ jobs:
9094
uses: exasol/python-toolbox/.github/actions/[email protected]
9195
with:
9296
python-version: ${{ matrix.python-version }}
97+
poetry-version: 2.1.2
9398

9499
- name: Run security linter
95100
run: poetry run nox -s lint:security

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: exasol/python-toolbox/.github/actions/[email protected]
2424
with:
2525
python-version: '${{ matrix.python_version }}'
26-
poetry-version: '1.8.2'
26+
poetry-version: '2.1.2'
2727

2828
- name: Test exaslct
2929
run: poetry run exaslct --help
@@ -59,7 +59,7 @@ jobs:
5959
uses: exasol/python-toolbox/.github/actions/[email protected]
6060
with:
6161
python-version: '${{ matrix.python_version }}'
62-
poetry-version: '1.8.2'
62+
poetry-version: '2.1.2'
6363

6464
- name: Allow unprivileged user namespaces
6565
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0

.github/workflows/matrix-python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818

1919
- name: Setup Python & Poetry Environment
2020
uses: exasol/python-toolbox/.github/actions/[email protected]
21+
with:
22+
poetry-version: 2.1.2
2123

2224
- name: Generate matrix
2325
run: poetry run nox -s matrix:python

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: exasol/python-toolbox/.github/actions/[email protected]
2020
with:
2121
python-version: '3.10'
22-
poetry-version: '1.8.2'
22+
poetry-version: '2.1.2'
2323

2424
- name: Build Artifacts
2525
run: poetry build

doc/changes/unreleased.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
# Unreleased
2+
3+
## Features
4+
- #273: Added option "use-existing-container" to run-db-test task
5+
6+
## Refactorings
7+
- #275: Updated to poetry 2.1.2
8+
- #276: Fix type hints in task generator functions

doc/dependencies.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
| Package | Version |
77
|---------|---------|
8-
| poetry | 1.8.2 |
8+
| poetry | 2.1.2 |
99
| Python | 3.10 |
1010

1111
## Runtime Dependencies

doc/user_guide/user_guide.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,22 @@ exaslct run-db-test --flavor-path=flavors/<flavor-name>
139139

140140
**Note: you need docker in privileged mode to execute the tests**
141141

142+
### Testing an existing container file
143+
144+
You can test an existing container file (*.tar.gz) with the following command:
145+
146+
```bash
147+
exaslct run-db-test --flavor-path=flavors/<flavor-name> --use-existing-container <path-to-file>
148+
```
149+
150+
With this additional option, `exaslct` won't build and export the container again, which might be a faster approach if you have access to the container file, but for some reason the internal cache and/or the docker image has been deleted.
151+
152+
153+
**Note**:
154+
1. `exaslct` won't check if the given container file is compatible with the given flavor path. If this is not the case, the tests probably will fail.
155+
2. As `exaslct` cannot check if the file was changed during different executions of `run-db-test` with options `--reuse-uploaded-container` or `--reuse-test-environment`, `exaslct` will always skip the upload if those options are set and the file already exists in BucketFS.
156+
157+
142158
## Cleaning up after you are finished
143159

144160
The creation of scripting language container creates or downloads several docker images

exasol/slc/api/run_db_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def run_db_test(
7575
reuse_uploaded_container: bool = False,
7676
reuse_test_container: bool = False,
7777
reuse_test_environment: bool = False,
78+
use_existing_container: Optional[str] = None,
7879
test_container_folder: str = "./test_container",
7980
force_rebuild: bool = False,
8081
force_rebuild_from: Tuple[str, ...] = tuple(),
@@ -165,6 +166,7 @@ def root_task_generator() -> DependencyLoggerBaseTask:
165166
reuse_database_setup=reuse_database_setup,
166167
reuse_test_container=reuse_test_container,
167168
reuse_database=reuse_database,
169+
use_existing_container=use_existing_container,
168170
db_os_access=DbOsAccess[db_os_access],
169171
no_test_container_cleanup_after_success=reuse_test_container,
170172
no_test_container_cleanup_after_failure=reuse_test_container,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from dataclasses import dataclass
2+
3+
4+
@dataclass
5+
class ContainerFileUnderTestInfo:
6+
target_name: str
7+
container_file: str
8+
is_new: bool

exasol/slc/internal/tasks/test/run_db_generic_language_tests.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ def run_task(self) -> Generator[BaseTask, None, None]:
4848

4949
def run_test(
5050
self, language: str, test_folder: str
51-
) -> Generator[BaseTask, Any, RunDBTestDirectoryResult]:
52-
#
53-
# Correct return type is Generator[RunDBTestsInDirectory, Any, RunDBTestDirectoryResult]
54-
# TODO: Fix after https://github.com/exasol/integration-test-docker-environment/issues/445
55-
#
56-
51+
) -> Generator[RunDBTestsInDirectory, Any, RunDBTestDirectoryResult]:
5752
task = self.create_child_task_with_common_params(
5853
RunDBTestsInDirectory,
5954
language=language,

0 commit comments

Comments
 (0)