From 06d3dc4686e8dff4e98b1355872c971f3a24804c Mon Sep 17 00:00:00 2001 From: Brandon Tweed Date: Tue, 12 Sep 2023 15:10:27 -0500 Subject: [PATCH 1/3] Run tests against most recent commit --- pr_check.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pr_check.sh b/pr_check.sh index 47d68b0e9..b817cc54b 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -1,5 +1,7 @@ #!/bin/bash +env + export COMPONENT="insights-chrome-frontend" export IMAGE="quay.io/cloudservices/$COMPONENT" export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace @@ -13,7 +15,7 @@ COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-fronten # Build and Publish to Quay # --------------------------- -set -ex +set -x docker run -t \ -v $PWD:/e2e:ro,Z \ @@ -25,8 +27,6 @@ docker run -t \ --entrypoint bash \ quay.io/cloudservices/cypress-e2e-image:06b70f3 /e2e/run-e2e.sh -echo "After docker run" - # source is preferred to | bash -s in this case to avoid a subshell source <(curl -sSL $COMMON_BUILDER/src/frontend-build.sh) BUILD_RESULTS=$? @@ -47,22 +47,26 @@ source .cicd_bootstrap.sh echo "Taking a short nap" sleep 60 +SHORT_SHA=$(git rev-parse --short HEAD) +IMAGE_TAG="pr-${ghprbPullId}-${SHORT_SHA}" +echo "Expecting image tag ${IMAGE_TAG}" set -x # Deploy to an ephemeral namespace for testing -export IMAGE="quay.io/cloudservices/rbac" +# We deploy rbac and override the image tag for insights-frontend-chrome +export IMAGE="quay.io/cloudservices/insights-chrome-frontend" export GIT_COMMIT=master -export IMAGE_TAG=latest export DEPLOY_FRONTENDS=true source $CICD_ROOT/deploy_ephemeral_env.sh + # Run some tests with ClowdJobInvocation export IQE_IMAGE_TAG="platform-ui" IQE_PLUGINS="platform_ui" IQE_MARKER_EXPRESSION="smoke" # Exclude progressive profile tests # Exclude APIdocs tests -IQE_FILTER_EXPRESSION="not (test_progressive or test_apidocs)" +IQE_FILTER_EXPRESSION="not (test_progressive)" IQE_ENV="ephemeral" IQE_SELENIUM="true" IQE_CJI_TIMEOUT="30m" From fee756c52fc827d90c209391ef9b55c150602db4 Mon Sep 17 00:00:00 2001 From: Brandon Tweed Date: Thu, 18 Jan 2024 09:57:02 -0600 Subject: [PATCH 2/3] Turn off debug, turn on error trapping --- pr_check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pr_check.sh b/pr_check.sh index b817cc54b..2218ed622 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -15,7 +15,7 @@ COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-fronten # Build and Publish to Quay # --------------------------- -set -x +set -e docker run -t \ -v $PWD:/e2e:ro,Z \ @@ -51,7 +51,7 @@ SHORT_SHA=$(git rev-parse --short HEAD) IMAGE_TAG="pr-${ghprbPullId}-${SHORT_SHA}" echo "Expecting image tag ${IMAGE_TAG}" -set -x +set -e # Deploy to an ephemeral namespace for testing # We deploy rbac and override the image tag for insights-frontend-chrome export IMAGE="quay.io/cloudservices/insights-chrome-frontend" From 61d766dbb29933474ffd47d4cf6b374de278c0d4 Mon Sep 17 00:00:00 2001 From: Brandon Tweed Date: Thu, 18 Jan 2024 15:28:32 -0600 Subject: [PATCH 3/3] Add a small wait before running tests against ephemeral --- pr_check.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pr_check.sh b/pr_check.sh index 2218ed622..b6378593b 100755 --- a/pr_check.sh +++ b/pr_check.sh @@ -59,7 +59,10 @@ export GIT_COMMIT=master export DEPLOY_FRONTENDS=true source $CICD_ROOT/deploy_ephemeral_env.sh +echo "Taking a short nap to let the deployment stabilize" +sleep 60 +echo "Running tests with CJI" # Run some tests with ClowdJobInvocation export IQE_IMAGE_TAG="platform-ui" IQE_PLUGINS="platform_ui"