Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): run QE tests during PR workflow #1008

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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