Skip to content

Commit

Permalink
chore(build): run QE tests during PR workflow
Browse files Browse the repository at this point in the history
Run QE tests on ephemeral environment as part of PR workflow.
  • Loading branch information
mirekdlugosz authored and cdcabrera committed Feb 21, 2023
1 parent 4e97ff0 commit ff7466a
Showing 1 changed file with 43 additions and 10 deletions.
53 changes: 43 additions & 10 deletions deploy/pr_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,55 @@ COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-fronten
# --------------------------------------------
# Options that must be configured by app owner
# --------------------------------------------
IQE_PLUGINS="curiosity"
IQE_MARKER_EXPRESSION="smoke"
IQE_FILTER_EXPRESSION=""
export IQE_PLUGINS="curiosity"
export IQE_IMAGE_TAG="curiosity"
export IQE_MARKER_EXPRESSION="ephemeral"
export IQE_FILTER_EXPRESSION=""
export IQE_ENV="ephemeral"
export IQE_SELENIUM="true"
export IQE_CJI_TIMEOUT="30m"

# --------------------------------------------
# Run unit tests, build container and push it to quay
# --------------------------------------------
set -exv
# 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
# --------------------------------------------
# Run QE tests on ephemeral environment
# --------------------------------------------

# Install bonfire repo/initialize
CICD_URL=https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd
curl -s $CICD_URL/bootstrap.sh > .cicd_bootstrap.sh && source .cicd_bootstrap.sh

export APP_NAME="rhsm"
export REF_ENV="insights-production"
export DEPLOY_FRONTENDS="true"
export COMPONENT_NAME="curiosity-frontend"
export EXTRA_DEPLOY_ARGS=""
export DEPLOY_TIMEOUT="1800"
# Keep that in sync with rhsm-subscriptions pr_check.sh
export OPTIONAL_DEPS_METHOD=none
export COMPONENTS_W_RESOURCES="rhsm swatch-api swatch-producer-aws swatch-producer-red-hat-marketplace swatch-metrics swatch-subscription-sync swatch-system-conduit swatch-tally"

# no idea why we need this while backend doesn't, but without this EE fails to deploy
for EXTRA_COMPONENT_NAME in $COMPONENTS_W_RESOURCES; do
export EXTRA_DEPLOY_ARGS="${EXTRA_DEPLOY_ARGS} --no-remove-resources ${EXTRA_COMPONENT_NAME}"
done


# Deploy to an ephemeral namespace for testing
source $CICD_ROOT/deploy_ephemeral_env.sh

# Run smoke tests with ClowdJobInvocation
export COMPONENT_NAME="rhsm"
source $CICD_ROOT/cji_smoke_test.sh

# Add link to Ibutsu in GitHub check results
source $CICD_ROOT/post_test_results.sh

# teardown_docker
exit $BUILD_RESULTS

0 comments on commit ff7466a

Please sign in to comment.