Skip to content

Commit 90193fd

Browse files
authored
Allow retries in flaky k8s e2e tests (#1194)
Signed-off-by: Matthias Büchse <matthias.buechse@alasca.cloud>
1 parent 02a7543 commit 90193fd

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

Tests/kaas/sonobuoy_handler/run_sonobuoy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ def cli():
2121
@click.option("-r", "--result_dir_name", "result_dir_name", type=str, default="sonobuoy_results", help="directory name to store results at",)
2222
@click.option("-c", "--check", "check_name", type=str, default="sonobuoy_executor", help="this MUST be the same name as the id in 'scs-compatible-kaas.yaml'",)
2323
@click.option("--scs-sonobuoy-config", "scs_sonobuoy_config_yaml", required=True, type=click.Path(exists=True), help="Configuration for Sonobuoy (YAML format)")
24-
@click.option('--execution-mode', 'mode', type=click.Choice(('serial', 'parallel')), default='serial')
24+
@click.option('--execution-mode', 'mode', type=click.Choice(('serial', 'parallel', 'dry')), default='serial')
2525
@click.option("-a", "--arg", "args", multiple=True)
2626
def sonobuoy_run(kubeconfig, result_dir_name, check_name, scs_sonobuoy_config_yaml, mode, args):
2727
if mode == 'parallel':
2828
# This is merely a shortcut to simplify commandline in scs-compatible-kaas.yaml
2929
# For more on parallel execution, see https://github.com/vmware-tanzu/sonobuoy/issues/1435
3030
args += ('--e2e-parallel=true', )
31+
elif mode == 'dry':
32+
# mutually exclusive with parallel, it turns out!
33+
args += ('--plugin-env e2e.E2E_DRYRUN=true', )
3134
sonobuoy_handler = SonobuoyHandler(scs_sonobuoy_config_yaml, check_name, kubeconfig, result_dir_name, args)
3235
sys.exit(sonobuoy_handler.run())
3336

Tests/scs-compatible-kaas.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ variables:
99
# working directory for the subject under test
1010
# (note that we consider each kubernetes branch a test subject of its own)
1111
- kubeconfig
12-
- execution_mode: parallel # alternatively: serial
12+
- execution_mode: parallel # alternatively: serial, dry
1313
scripts:
1414
- executable: ./kaas/sonobuoy_handler/run_sonobuoy.py
15-
args: run -k {kubeconfig} --scs-sonobuoy-config kaas/scs-sonobuoy-config-v1.yaml -r {subject_root}/sono-results-e2e -c 'cncf-k8s-conformance' -a '--mode=certified-conformance' --execution-mode {execution_mode}
16-
#~ args: -k {kubeconfig} -r {subject_root}/sono-results -c 'cncf-k8s-conformance' -a '--plugin-env e2e.E2E_DRYRUN=true'
15+
args: >-
16+
run -k {kubeconfig}
17+
--scs-sonobuoy-config kaas/scs-sonobuoy-config-v1.yaml
18+
--execution-mode {execution_mode}
19+
-r {subject_root}/sono-results-e2e
20+
-c 'cncf-k8s-conformance'
21+
-a '--mode=certified-conformance'
22+
-a '--plugin-env e2e.E2E_EXTRA_ARGS=--ginkgo.flake-attempts=2'
1723
testcases:
1824
- id: cncf-k8s-conformance
1925
lifetime: year
@@ -33,7 +39,14 @@ scripts:
3339
Manual check: Must fulfill all requirements of scs-0214-v2.
3440
url: https://docs.scs.community/standards/scs-0214-v2-k8s-node-distribution#decision
3541
- executable: ./kaas/sonobuoy_handler/run_sonobuoy.py
36-
args: run -k {kubeconfig} --scs-sonobuoy-config kaas/scs-sonobuoy-config-v1.yaml -r {subject_root}/sono-results-0219 -c 'kaas-networking-check' -a '--e2e-focus "NetworkPolicy"' --execution-mode {execution_mode}
42+
args: >-
43+
run -k {kubeconfig}
44+
--scs-sonobuoy-config kaas/scs-sonobuoy-config-v1.yaml
45+
--execution-mode {execution_mode}
46+
-r {subject_root}/sono-results-0219
47+
-c 'kaas-networking-check'
48+
-a '--e2e-focus "NetworkPolicy"'
49+
-a '--plugin-env e2e.E2E_EXTRA_ARGS=--ginkgo.flake-attempts=2'
3750
testcases:
3851
- id: kaas-networking-check
3952
lifetime: month

0 commit comments

Comments
 (0)