From d9e501b5af5fe459dca9b06142067b7facb22116 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Thu, 30 May 2024 12:33:18 +0530 Subject: [PATCH] Revert "[qe] unified darwin and linux scripts to execute integration and e2e tests remotely" This reverts commit 0f14537a2d9df5e3c839679f748eddf9461ef418. the ${OS} variable referred to on the scripts is only present when running inside the container, we'll have to figure out a different way to get the OS information when running on the host --- images/build-e2e/lib/darwin/run.sh | 61 ++++++++++++++++++++- images/build-e2e/lib/linux/run.sh | 4 +- images/build-integration/lib/darwin/run.sh | 64 +++++++++++++++++++++- images/build-integration/lib/linux/run.sh | 2 +- 4 files changed, 126 insertions(+), 5 deletions(-) mode change 120000 => 100755 images/build-e2e/lib/darwin/run.sh mode change 120000 => 100755 images/build-integration/lib/darwin/run.sh diff --git a/images/build-e2e/lib/darwin/run.sh b/images/build-e2e/lib/darwin/run.sh deleted file mode 120000 index fb5c87c156..0000000000 --- a/images/build-e2e/lib/darwin/run.sh +++ /dev/null @@ -1 +0,0 @@ -./../linux/run.sh \ No newline at end of file diff --git a/images/build-e2e/lib/darwin/run.sh b/images/build-e2e/lib/darwin/run.sh new file mode 100755 index 0000000000..0b417f56bc --- /dev/null +++ b/images/build-e2e/lib/darwin/run.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# Parameters +bundleLocation="" +e2eTagExpression="" +crcMemory="" +targetFolder="crc-e2e" +junitFilename="e2e-junit.xml" +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -bundleLocation) + bundleLocation="$2" + shift + shift + ;; + -e2eTagExpression) + e2eTagExpression="$2" + shift + shift + ;; + -targetFolder) + targetFolder="$2" + shift + shift + ;; + -junitFilename) + junitFilename="$2" + shift + shift + ;; + -crcMemory) + crcMemory="$2" + shift + shift + ;; + *) # unknown option + shift + ;; + esac +done + +# Prepare resuslts folder +mkdir -p $targetFolder/results + +# Run tests +tags="darwin" +if [ ! -z "$e2eTagExpression" ] +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" + +# Transform results to junit +cd .. +init_line=$(grep -n '' results/e2e.results | awk '{split($0,n,":"); print n[1]}') +tail -n +$init_line results/e2e.results > results/$junitFilename +# Copy logs and diagnose +cp -r bin/out/test-results/* results \ No newline at end of file diff --git a/images/build-e2e/lib/linux/run.sh b/images/build-e2e/lib/linux/run.sh index f0ef98736d..94fe5737da 100755 --- a/images/build-e2e/lib/linux/run.sh +++ b/images/build-e2e/lib/linux/run.sh @@ -34,7 +34,7 @@ while [[ $# -gt 0 ]]; do shift shift ;; - *) + *) # unknown option shift ;; esac @@ -44,7 +44,7 @@ done mkdir -p $targetFolder/results # Run tests -tags="${OS}" +tags="linux" if [ ! -z "$e2eTagExpression" ] then tags="$tags && $e2eTagExpression" diff --git a/images/build-integration/lib/darwin/run.sh b/images/build-integration/lib/darwin/run.sh deleted file mode 120000 index fb5c87c156..0000000000 --- a/images/build-integration/lib/darwin/run.sh +++ /dev/null @@ -1 +0,0 @@ -./../linux/run.sh \ No newline at end of file diff --git a/images/build-integration/lib/darwin/run.sh b/images/build-integration/lib/darwin/run.sh new file mode 100755 index 0000000000..c60ffa12ce --- /dev/null +++ b/images/build-integration/lib/darwin/run.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Parameters +bundleLocation="" +targetFolder="crc-integration" +junitFilename="integration-junit.xml" +suiteTimeout="90m" +labelFilter="" +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -bundleLocation) + bundleLocation="$2" + shift + shift + ;; + -targetFolder) + targetFolder="$2" + shift + shift + ;; + -junitFilename) + junitFilename="$2" + shift + shift + ;; + -suiteTimeout) + suiteTimeout="$2" + shift + shift + ;; + -labelFilter) + labelFilter="$2" + shift + shift + *) # unknown option + shift + ;; + esac +done + +# Prepare resuslts folder +mkdir -p $targetFolder/results + +# Run tests +export PATH="$PATH:${HOME}/$targetFolder/bin" +export PULL_SECRET_PATH="${HOME}/$targetFolder/pull-secret" +if [ ! -z "$bundleLocation" ] +then + export BUNDLE_PATH="$bundleLocation" +fi +cd $targetFolder/bin +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 .. +cp bin/integration.results results/integration.results +cp bin/out/integration.xml results/$junitFilename \ No newline at end of file diff --git a/images/build-integration/lib/linux/run.sh b/images/build-integration/lib/linux/run.sh index b50aad597d..bb4f5c179f 100755 --- a/images/build-integration/lib/linux/run.sh +++ b/images/build-integration/lib/linux/run.sh @@ -34,7 +34,7 @@ while [[ $# -gt 0 ]]; do shift shift ;; - *) + *) # unknown option shift ;; esac