pr_check: add actual testing in ephemeral

It is now possible to run UI testing in ephemeral environment. This
script builds the frontend container, deploys image-builder with it's
frontend in ephemeral, runs the IQE test suite against that and reports
the result on the PR.
This commit is contained in:
Jakub Rusz 2022-11-11 16:42:15 +01:00 committed by Alexander Todorov
parent f01c5492bf
commit eaf3685391

View file

@ -4,7 +4,7 @@
# Export vars for helper scripts to use
# --------------------------------------------
# name of app-sre "application" folder this component lives in; needs to match for quay
export COMPONENT="image-builder"
export COMPONENT_NAME="image-builder-frontend"
# IMAGE should match the quay repo set by app.yaml in app-interface
export IMAGE="quay.io/cloudservices/image-builder-frontend"
export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace
@ -16,23 +16,32 @@ COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-fronten
# --------------------------------------------
# Options that must be configured by app owner
# --------------------------------------------
IQE_PLUGINS="image-builder-frontend"
# not sure if this is necessary
IQE_MARKER_EXPRESSION="smoke"
IQE_FILTER_EXPRESSION=""
export IQE_PLUGINS="image-builder-frontend"
export IQE_CJI_TIMEOUT="30m"
export IQE_SELENIUM="true"
export IQE_ENV="ephemeral"
set -exv
# source is preferred to | bash -s in this case to avoid a subshell
# bootstrap bonfire and it's config
CICD_URL=https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd
curl -s "$CICD_URL"/bootstrap.sh > .cicd_bootstrap.sh && source .cicd_bootstrap.sh
# # source is preferred to | bash -s in this case to avoid a subshell
source <(curl -sSL $COMMON_BUILDER/src/frontend-build.sh)
BUILD_RESULTS=$?
# Stubbed out for now
mkdir -p $WORKSPACE/artifacts
cat << EOF > $WORKSPACE/artifacts/junit-dummy.xml
<testsuite tests="1">
<testcase classname="dummy" name="dummytest"/>
</testsuite>
EOF
# reserve ephemeral namespace
export DEPLOY_FRONTENDS="true"
export EXTRA_DEPLOY_ARGS="rhsm-api-proxy --set-template-ref rhsm-api-proxy=master"
export APP_NAME="image-builder-crc"
# teardown_docker
exit $BUILD_RESULTS
source "$CICD_ROOT"/deploy_ephemeral_env.sh
# Run smoke tests using a ClowdJobInvocation (preferred)
# The contents of this script can be found at:
# https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd/cji_smoke_test.sh
export COMPONENT_NAME="image-builder"
source "$CICD_ROOT"/cji_smoke_test.sh
# Post a comment with test run IDs to the PR
# The contents of this script can be found at:
# https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd/post_test_results.sh
source "$CICD_ROOT"/post_test_results.sh