Skip to content

Commit

Permalink
test (e2e) : Use pinned version of crc while executing e2e tests (#4629)
Browse files Browse the repository at this point in the history
Instead of assuming e2e tests would pick up crc binary added by the pipeline,
that may or may not work if some user has added a binary in any of the PATH
dirs, explicitly specify crc installation dir during test run

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia committed Feb 19, 2025
1 parent 20e0dd2 commit b6462c1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 7 additions & 1 deletion images/build-e2e/lib/darwin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
bundleLocation=""
e2eTagExpression=""
crcMemory=""
crcBinaryDir="${HOME}/go/bin"
targetFolder="crc-e2e"
junitFilename="e2e-junit.xml"
while [[ $# -gt 0 ]]; do
Expand Down Expand Up @@ -34,6 +35,11 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
-crcBinaryDir)
crcBinaryDir="$2"
shift
shift
;;
*) # unknown option
shift
;;
Expand All @@ -50,7 +56,7 @@ then
tags="$tags && $e2eTagExpression"
fi
cd $targetFolder/bin
./e2e.test --bundle-location=$bundleLocation --pull-secret-file="${HOME}/$targetFolder/pull-secret" --cleanup-home=false --crc-memory=$crcMemory --godog.tags="$tags" --godog.format=junit > "${HOME}/$targetFolder/results/e2e.results"
./e2e.test --bundle-location=$bundleLocation --pull-secret-file="${HOME}/$targetFolder/pull-secret" --crc-binary=$crcBinaryDir --cleanup-home=false --crc-memory=$crcMemory --godog.tags="$tags" --godog.format=junit > "${HOME}/$targetFolder/results/e2e.results"

# Transform results to junit
cd ..
Expand Down
8 changes: 7 additions & 1 deletion images/build-e2e/lib/linux/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
bundleLocation=""
e2eTagExpression=""
crcMemory=""
crcBinaryDir="${HOME}/go/bin"
targetFolder="crc-e2e"
junitFilename="e2e-junit.xml"
while [[ $# -gt 0 ]]; do
Expand Down Expand Up @@ -34,6 +35,11 @@ while [[ $# -gt 0 ]]; do
shift
shift
;;
-crcBinaryDir)
crcBinaryDir="$2"
shift
shift
;;
*) # unknown option
shift
;;
Expand All @@ -50,7 +56,7 @@ then
tags="$tags && $e2eTagExpression"
fi
cd $targetFolder/bin
./e2e.test --bundle-location=$bundleLocation --pull-secret-file="${HOME}/$targetFolder/pull-secret" --cleanup-home=false --crc-memory=$crcMemory --godog.tags="$tags" --godog.format=junit > "${HOME}/$targetFolder/results/e2e.results"
./e2e.test --bundle-location=$bundleLocation --pull-secret-file="${HOME}/$targetFolder/pull-secret" --crc-binary=$crcBinaryDir --cleanup-home=false --crc-memory=$crcMemory --godog.tags="$tags" --godog.format=junit > "${HOME}/$targetFolder/results/e2e.results"

# Transform results to junit
cd ..
Expand Down
4 changes: 3 additions & 1 deletion images/build-e2e/lib/windows/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ param(
$junitFilename="e2e-junit.xml",
[Parameter(HelpMessage='Customize memory for the cluster to run the tests')]
$crcMemory=""
[Parameter(HelpMessage='Customize crc binary location')]
$crcBinaryDir="$env:HOME\go\bin"
)

# Prepare run e2e
Expand All @@ -28,7 +30,7 @@ if ($e2eTagExpression) {
}
$dir = "$PWD"
cd $targetFolder\bin
e2e.test.exe --bundle-location=$bundleLocation --pull-secret-file=$targetFolderdir\pull-secret --crc-memory=$crcMemory --cleanup-home=false --godog.tags="$tags" --godog.format=junit > $resultsDir\e2e.results
e2e.test.exe --bundle-location=$bundleLocation --pull-secret-file=$targetFolderdir\pull-secret --crc-binary=$crcBinaryDir --crc-memory=$crcMemory --cleanup-home=false --godog.tags="$tags" --godog.format=junit > $resultsDir\e2e.results

# Transform results to junit
cd ..
Expand Down

0 comments on commit b6462c1

Please sign in to comment.