diff --git a/images/build-integration/README.md b/images/build-integration/README.md index 28ffe723ee..cce43c6728 100644 --- a/images/build-integration/README.md +++ b/images/build-integration/README.md @@ -26,6 +26,7 @@ And the execution is customized by the params addded, available params: * targetFolder Name of the folder on the target host under $HOME where all the content will be copied * junitFilename Name for the junit file with the tests results * suiteTimeout Set the timeout for running the suite. Default 90m +* labelFilter Filter tests to be executed based on label expression ### Windows amd64 diff --git a/images/build-integration/lib/darwin/run.sh b/images/build-integration/lib/darwin/run.sh index 6751b1ec34..c60ffa12ce 100755 --- a/images/build-integration/lib/darwin/run.sh +++ b/images/build-integration/lib/darwin/run.sh @@ -5,6 +5,7 @@ bundleLocation="" targetFolder="crc-integration" junitFilename="integration-junit.xml" suiteTimeout="90m" +labelFilter="" while [[ $# -gt 0 ]]; do key="$1" case $key in @@ -28,6 +29,10 @@ while [[ $# -gt 0 ]]; do shift shift ;; + -labelFilter) + labelFilter="$2" + shift + shift *) # unknown option shift ;; @@ -45,7 +50,12 @@ then export BUNDLE_PATH="$bundleLocation" fi cd $targetFolder/bin -./integration.test --ginkgo.timeout $suiteTimeout > integration.results +if [ ! -z "$labelFilter" ] +then + ./integration.test --ginkgo.timeout $suiteTimeout --ginkgo.label-filter $labelFilter > integration.results +else + ./integration.test --ginkgo.timeout $suiteTimeout > integration.results +fi # Copy results cd .. diff --git a/images/build-integration/lib/linux/run.sh b/images/build-integration/lib/linux/run.sh index 6751b1ec34..bb4f5c179f 100755 --- a/images/build-integration/lib/linux/run.sh +++ b/images/build-integration/lib/linux/run.sh @@ -5,6 +5,7 @@ bundleLocation="" targetFolder="crc-integration" junitFilename="integration-junit.xml" suiteTimeout="90m" +labelFilter="" while [[ $# -gt 0 ]]; do key="$1" case $key in @@ -28,6 +29,11 @@ while [[ $# -gt 0 ]]; do shift shift ;; + -labelFilter) + labelFilter="$2" + shift + shift + ;; *) # unknown option shift ;; @@ -45,7 +51,12 @@ then export BUNDLE_PATH="$bundleLocation" fi cd $targetFolder/bin -./integration.test --ginkgo.timeout $suiteTimeout > integration.results +if [ ! -z "$labelFilter" ] +then + ./integration.test --ginkgo.timeout $suiteTimeout --ginkgo.label-filter $labelFilter > integration.results +else + ./integration.test --ginkgo.timeout $suiteTimeout > integration.results +fi # Copy results cd .. diff --git a/images/build-integration/lib/windows/run.ps1 b/images/build-integration/lib/windows/run.ps1 index fc18c742f3..2bdcd7a7ed 100755 --- a/images/build-integration/lib/windows/run.ps1 +++ b/images/build-integration/lib/windows/run.ps1 @@ -6,7 +6,9 @@ param( [Parameter(HelpMessage='Name for the junit file with the tests results')] $junitFilename="integration-junit.xml", [Parameter(HelpMessage='Test suite fails if it does not complete within the specified timeout. Default 90m')] - $suiteTimeout="90m" + $suiteTimeout="90m", + [Parameter(HelpMessage='Filter tests to be executed based on label expression')] + $labelFilter="" ) # Prepare run e2e @@ -24,7 +26,12 @@ if ($bundleLocation) { } # We need to copy the pull-secret to the target folder $env:PULL_SECRET_PATH="$env:HOME\$targetFolder\pull-secret" -integration.test.exe --ginkgo.timeout $suiteTimeout > integration.results +if ($labelFilter) { + integration.test.exe --ginkgo.timeout $suiteTimeout --ginkgo.label-filter $labelFilter > integration.results +} else { + integration.test.exe --ginkgo.timeout $suiteTimeout > integration.results +} + # Copy results cd ..