Skip to content

Commit

Permalink
[qe] added labelFilter parameter to allow filtering integration tests…
Browse files Browse the repository at this point in the history
… to be executed based on labels

Signed-off-by: Adrian Riobo Lorenzo <ariobolo@redhat.com>
  • Loading branch information
adrianriobo authored and praveenkumar committed May 23, 2024
1 parent 17ba019 commit 617cb9f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions images/build-integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 11 additions & 1 deletion images/build-integration/lib/darwin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bundleLocation=""
targetFolder="crc-integration"
junitFilename="integration-junit.xml"
suiteTimeout="90m"
labelFilter=""
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
Expand All @@ -28,6 +29,10 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
-labelFilter)
labelFilter="$2"
shift
shift
*) # unknown option
shift
;;
Expand All @@ -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 ..
Expand Down
13 changes: 12 additions & 1 deletion images/build-integration/lib/linux/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bundleLocation=""
targetFolder="crc-integration"
junitFilename="integration-junit.xml"
suiteTimeout="90m"
labelFilter=""
while [[ $# -gt 0 ]]; do
key="$1"
case $key in
Expand All @@ -28,6 +29,11 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
-labelFilter)
labelFilter="$2"
shift
shift
;;
*) # unknown option
shift
;;
Expand All @@ -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 ..
Expand Down
11 changes: 9 additions & 2 deletions images/build-integration/lib/windows/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ..
Expand Down

0 comments on commit 617cb9f

Please sign in to comment.