From 91cdd567d4e6b978325bfdff8d3701bf71051e5f Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Tue, 1 Sep 2020 11:49:05 +0200 Subject: [PATCH 1/3] feat: configure retries on tests --- Jenkinsfile | 2 ++ libbeat/tests/system/requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index ded3b730cb4..da40ebb6d2c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,6 +38,7 @@ pipeline { JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin' XPACK_MODULE_PATTERN = '^x-pack\\/[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*' OSS_MODULE_PATTERN = '^[a-z0-9]+beat\\/module\\/([^\\/]+)\\/.*' + PYTEST_ADDOPTS = "${params.PYTEST_ADDOPTS}" } options { timeout(time: 2, unit: 'HOURS') @@ -61,6 +62,7 @@ pipeline { string(name: 'awsRegion', defaultValue: 'eu-central-1', description: 'Default AWS region to use for testing.') booleanParam(name: 'debug', defaultValue: false, description: 'Allow debug logging for Jenkins steps') booleanParam(name: 'dry_run', defaultValue: false, description: 'Skip build steps, it is for testing pipeline flow') + string(name: 'PYTEST_ADDOPTS', defaultValue: '--reruns 3 --reruns-delay 15', description: 'Aditional options to pass to pyTest. Use PYTEST_ADDOPTS="-k pattern" to only run tests matching the specified pattern.') } stages { /** diff --git a/libbeat/tests/system/requirements.txt b/libbeat/tests/system/requirements.txt index 00eff11c5d9..3157a97925b 100644 --- a/libbeat/tests/system/requirements.txt +++ b/libbeat/tests/system/requirements.txt @@ -32,6 +32,7 @@ pyparsing==2.4.7 pyrsistent==0.16.0 pytest==6.0.1 pytest-timeout==1.3.4 +pytest-rerunfailures==9.0 PyYAML==5.3.1 redis==2.10.6 requests==2.20.0 From 865e6427d90d580d8835678b4db6c18c2279b32f Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Tue, 1 Sep 2020 12:36:41 +0200 Subject: [PATCH 2/3] Update Jenkinsfile Co-authored-by: cachedout --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index da40ebb6d2c..454623fb029 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,7 +62,7 @@ pipeline { string(name: 'awsRegion', defaultValue: 'eu-central-1', description: 'Default AWS region to use for testing.') booleanParam(name: 'debug', defaultValue: false, description: 'Allow debug logging for Jenkins steps') booleanParam(name: 'dry_run', defaultValue: false, description: 'Skip build steps, it is for testing pipeline flow') - string(name: 'PYTEST_ADDOPTS', defaultValue: '--reruns 3 --reruns-delay 15', description: 'Aditional options to pass to pyTest. Use PYTEST_ADDOPTS="-k pattern" to only run tests matching the specified pattern.') + string(name: 'PYTEST_ADDOPTS', defaultValue: '--reruns 3 --reruns-delay 15', description: 'Additional options to pass to pytest. Use PYTEST_ADDOPTS="-k pattern" to only run tests matching the specified pattern.') } stages { /** From 13302c8a9fef34f6290f946cdcad4e27924c2934 Mon Sep 17 00:00:00 2001 From: Ivan Fernandez Calvo Date: Mon, 7 Sep 2020 12:02:10 +0200 Subject: [PATCH 3/3] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 454623fb029..1d6d8e8b7db 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,7 +62,7 @@ pipeline { string(name: 'awsRegion', defaultValue: 'eu-central-1', description: 'Default AWS region to use for testing.') booleanParam(name: 'debug', defaultValue: false, description: 'Allow debug logging for Jenkins steps') booleanParam(name: 'dry_run', defaultValue: false, description: 'Skip build steps, it is for testing pipeline flow') - string(name: 'PYTEST_ADDOPTS', defaultValue: '--reruns 3 --reruns-delay 15', description: 'Additional options to pass to pytest. Use PYTEST_ADDOPTS="-k pattern" to only run tests matching the specified pattern.') + string(name: 'PYTEST_ADDOPTS', defaultValue: '', description: 'Additional options to pass to pytest. Use PYTEST_ADDOPTS="-k pattern" to only run tests matching the specified pattern. For retries you can use `--reruns 3 --reruns-delay 15`') } stages { /**