Skip to content

Commit 222c56a

Browse files
author
Daniel Gerber
committed
Add option to run tests in parallel (as default)
1 parent 3e6e6bb commit 222c56a

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ Tests/kaas/kaas-sonobuoy-tests/results/
99
*.tar.gz
1010
.direnv
1111
.vscode
12+
Tests/sono-*
13+
report.yaml

Tests/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,15 @@ Install KaaS-specific requirements:
4949
pip install -r kaas/requirements.txt
5050
```
5151

52-
Given a kubeconfig file `path/to/kubeconfig.yaml`, run
52+
Given a kubeconfig file `path/to/kubeconfig.yaml`, run all tests in parallel with:
5353

5454
```shell
55-
./scs-compliance-check.py -v -a kubeconfig=path/to/kubeconfig.yaml -a subject_root=. -s SUBJECT -o report.yaml scs-compatible-kaas.yaml
55+
./scs-compliance-check.py -v -a kubeconfig=path/to/kubeconfig.yaml \
56+
-a subject_root=. \
57+
-a e2e-parallel="--e2e-parallel=true" \
58+
-s SUBJECT \
59+
-o report.yaml \
60+
scs-compatible-kaas.yaml
5661
```
5762

5863
Replace `SUBJECT` with an arbitrary, but meaningful subject name. Also, please note that the check
@@ -64,6 +69,10 @@ Additionally, the directory `sono-results` will be generated. It contains a JUni
6469
`plugins/e2e/results/global/junit_01.xml`. You can render it to HTML with a tool like junit2html.
6570
This might give you hints as to why a test failed.
6671

72+
If you need to run tests without parallelization simply remove `-a e2e-parallel="--e2e-parallel=true"`
73+
or set it to `false`.
74+
Some additional information can be found [here](https://github.com/vmware-tanzu/sonobuoy/issues/1435).
75+
6776
## Usage information (help output)
6877

6978
```text
@@ -183,7 +192,7 @@ We use a **layered approach** to allow for selective installation:
183192
- at the very top we have `test-requirements.in`.
184193

185194
Whenever you change or recompile one of these layers,
186-
*all layers above that layer have to be recompiled as well*.
195+
_all layers above that layer have to be recompiled as well_.
187196

188197
Note: The Python version used for running `pip-compile` should be consistent. The currently
189198
used version is documented in the header of the `requirements.txt`. It should match the

Tests/scs-compatible-kaas.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ variables:
1111
- kubeconfig
1212
scripts:
1313
- executable: ./kaas/sonobuoy_handler/run_sonobuoy.py
14-
args: run -k {kubeconfig} --scs-sonobuoy-config kaas/scs-sonobuoy-config.yaml -r {subject_root}/sono-results-e2e -c 'cncf-k8s-conformance' -a '--mode=certified-conformance'
14+
args: run -k {kubeconfig} --scs-sonobuoy-config kaas/scs-sonobuoy-config.yaml -r {subject_root}/sono-results-e2e -c 'cncf-k8s-conformance' -a '--mode=certified-conformance {e2e-parallel}'
1515
#~ args: -k {kubeconfig} -r {subject_root}/sono-results -c 'cncf-k8s-conformance' -a '--plugin-env e2e.E2E_DRYRUN=true'
1616
testcases:
1717
- id: cncf-k8s-conformance
@@ -31,7 +31,7 @@ scripts:
3131
description: Must fulfill all requirements of scs-0214-v2.
3232
url: https://docs.scs.community/standards/scs-0214-v2-k8s-node-distribution#decision
3333
- executable: ./kaas/sonobuoy_handler/run_sonobuoy.py
34-
args: run -k {kubeconfig} --scs-sonobuoy-config kaas/scs-sonobuoy-config.yaml -r {subject_root}/sono-results-0219 -c 'kaas-networking-check' -a '--e2e-focus "NetworkPolicy"'
34+
args: run -k {kubeconfig} --scs-sonobuoy-config kaas/scs-sonobuoy-config.yaml -r {subject_root}/sono-results-0219 -c 'kaas-networking-check' -a '--e2e-focus "NetworkPolicy" {e2e-parallel}'
3535
testcases:
3636
- id: kaas-networking-check
3737
description: Must fulfill all requirements of scs-0219-v1.

0 commit comments

Comments
 (0)