Skip to content

Commit

Permalink
chore: fix the integration-docker target in Makefile and improve the …
Browse files Browse the repository at this point in the history
…README on the tagging feature of run.py

Signed-off-by: Trong Nhan Mai <trong.nhan.mai@oracle.com>
  • Loading branch information
tromai committed Jul 11, 2024
1 parent 1c65b9a commit 838ef86
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ integration-test-docker:
run \
--macaron scripts/release_scripts/run_macaron.sh \
--include-tag docker-only \
./tests/integration/cases/...

python ./tests/integration/run.py \
run \
--macaron scripts/release_scripts/run_macaron.sh \
--include-tag shared-docker-python \
./tests/integration/cases/...

Expand Down
27 changes: 23 additions & 4 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ steps:
We typically have the test cases for the container image being a subset of the test cases for the Macaron Python package. We can mark the test cases shared for both purposes with the `shared-docker-python` tag. When we do integration testing for the container image, we can add the argument `--include-tag shared-docker-python` to filter only test cases tagged with `shared-docker-python`.
Some other use cases of this tagging feature in our current setup:
- We can have test cases that **only** run for the container image. In the integration tests for the Macaron Python package, test cases marked with `docker-only` are not run. Note that `docker-only` shouldn't be used with `shared-docker-python`.
- Test cases marked with `skip` are not run.
```bash
# Test the container image with test cases having the `docker` tag.
$ python ./tests/integration/run.py run --include-tag docker ./all/cases/...
Expand All @@ -170,6 +166,29 @@ $ python ./tests/integration/run.py run --exclude-tag npm ./all/cases/...
You can simply think of each `--include-tag`/`--exclude-tag` argument as adding an additional constraint that a selected test case must satisfy".
Some other use cases of this tagging feature in our current setup:
- We can have test cases that **only** run for the container image. In the integration tests for the Macaron Python package, test cases marked with `docker-only` are not run. Note that `docker-only` shouldn't be used with `shared-docker-python`. Therefore our current test suite for the docker container must be run as separated commands:
```bash
# Run all test cases with `docker-only` tag.
$ python ./tests/integration/run.py \
run \
--macaron scripts/release_scripts/run_macaron.sh \
--include-tag docker-only \
./tests/integration/cases/...
# Run all test cases with `shared-docker-python` tag.
$ python ./tests/integration/run.py \
run \
--macaron scripts/release_scripts/run_macaron.sh \
--include-tag shared-docker-python \
./tests/integration/cases/...
```
- Test cases marked with `skip` are not run.
- Test cases marked with `npm-registry` are not run if the environment variable `NO_NPM` is set to `TRUE`. This only applies when you run the integration tests with:
```bash
$ make integration-test
```
### Debug utility script
In case you want to debug the utility script itself, there is the verbose mode for all commands which can be enabled with the `-v/--verbose` flag.
Expand Down

0 comments on commit 838ef86

Please sign in to comment.