forked from RedHatInsights/insights-chrome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pr_check.sh
executable file
·91 lines (73 loc) · 2.45 KB
/
pr_check.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/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
export APP_ROOT=$(pwd)
export INCLUDE_CHROME_CONFIG="true"
export DIST_FOLDER=build
export LANG=C.UTF-8
cat /etc/redhat-release
COMMON_BUILDER=https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master
# ---------------------------
# Build and Publish to Quay
# ---------------------------
set -e
docker run -t \
-v $PWD:/e2e:ro,Z \
-w /e2e \
-e CHROME_ACCOUNT=$CHROME_ACCOUNT \
-e CHROME_PASSWORD=$CHROME_PASSWORD \
--add-host stage.foo.redhat.com:127.0.0.1 \
--add-host prod.foo.redhat.com:127.0.0.1 \
--entrypoint bash \
quay.io/cloudservices/cypress-e2e-image:06b70f3 /e2e/run-e2e.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=$?
## === Bonfire/Clowder/IQE stuff goes here ===
# Ensure that we deploy the right component for testing
export APP_NAME=rbac
export COMPONENT="rbac"
export COMPONENT_NAME="rbac"
# Install bonfire
CICD_URL=https://raw.githubusercontent.com/RedHatInsights/bonfire/master/cicd
curl -s $CICD_URL/bootstrap.sh > .cicd_bootstrap.sh
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 -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"
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"
IQE_MARKER_EXPRESSION="smoke"
# Exclude progressive profile tests
# Exclude APIdocs tests
IQE_FILTER_EXPRESSION="not (test_progressive)"
IQE_ENV="ephemeral"
IQE_SELENIUM="true"
IQE_CJI_TIMEOUT="30m"
DEPLOY_TIMEOUT="900" # 15min
DEPLOY_FRONTENDS="true"
source $CICD_ROOT/cji_smoke_test.sh
# 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
# teardown docker
exit $BUILD_RESULTS