Skip to content

Commit fc76810

Browse files
committed
update script
1 parent 4ad6b2e commit fc76810

File tree

1 file changed

+38
-15
lines changed

1 file changed

+38
-15
lines changed

.werft/integration-tests-startup.yaml

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,43 +35,66 @@ pod:
3535
3636
function cleanup ()
3737
{
38-
werft run github -a namespace=staging-gitpod-test-main --remote-job-path .werft/wipe-devstaging.yaml github.com/gitpod-io/gitpod:main
39-
}
38+
werft log phase "cleanup preview environment" "cleanup preview environment"
39+
BUILD_ID=$(werft run github -a namespace=staging-gitpod-test-main -j .werft/wipe-devstaging.yaml github.com/gitpod-io/gitpod:main)
4040
41+
echo "start cleanup preview environment, job name: ${BUILD_ID}" | werft log slice "cleanup"
42+
werft log result -d "cleanup job" url "https://werft.gitpod-dev.com/job/${BUILD_ID}"
43+
}
4144
42-
echo "[prep] preparing config."
45+
echo "preparing config." | werft log slice prepare
4346
gcloud auth activate-service-account --key-file /mnt/secrets/gcp-sa/service-account.json
4447
export GOOGLE_APPLICATION_CREDENTIALS="/home/gitpod/.config/gcloud/legacy_credentials/[email protected]/adc.json"
4548
export DOCKER_HOST=tcp://$NODENAME:2375
46-
echo "[prep] copied config..."
47-
echo "[prep|DONE]"
49+
echo "copied config..." | werft log slice prepare
50+
werft log slice prepare --done
4851
52+
werft log phase "build preview environment" "build preview environment"
4953
# this is because we don't want to increate gitpod-build-main number, we can choose a name
5054
sudo cp .werft/build.yaml .werft/test.yaml
5155
# version is actual namespace that werft is build, --job-file should be same with above
52-
VERSION=$(werft run github -j .werft/test.yaml github.com/gitpod-io/gitpod:main)
53-
echo "[build test environment] start ${VERSION}"
56+
VERSION=$(werft run github -j .werft/test.yaml -s .werft/test.yaml github.com/gitpod-io/gitpod:main)
57+
echo "start build preview environment, job name: ${VERSION}, this will take long time" | werft log slice "build test environment"
58+
werft log result -d "build job" url "https://werft.gitpod-dev.com/job/${VERSION}"
5459
55-
# clean preview environment when the script exits
56-
trap cleanup SIGINT SIGTERM EXIT
5760
5861
until werft job get ${VERSION} -o yaml | yq r - "phase" | grep '4' > /dev/null; do
59-
sleep 1
62+
echo "continue waiting" | werft log slice "build test environment"
63+
sleep 10
6064
done
61-
echo "[build test environment] done"
62-
echo "[build test environment|DONE]"
6365
64-
# we need get integration-test version like: jp-run-integration-test.61
66+
if ! werft job get ${VERSION} -o yaml | yq r - "conditions.success" | grep "true" > /dev/null;
67+
then
68+
echo "build failed" | werft log slice "build test environment"
69+
exit 1
70+
fi
71+
echo "build success" | werft log slice "build test environment"
72+
werft log slice "build test environment" --done
6573
74+
# clean preview environment when the script exits
75+
trap cleanup SIGINT SIGTERM EXIT
76+
77+
werft log phase "integration test" "integration test"
78+
# we need get integration-test version like: jp-run-integration-test.61
6679
# INTEGRATION_VERSION=$(docker run eu.gcr.io/gitpod-core-dev/build/versions:${VERSION} cat versions.yaml | yq r - 'components.integrationTest.version')
6780
6881
# only for test now
6982
INTEGRATION_VERSION=jp-run-integration-test.80
70-
echo "[version] ${INTEGRATION_VERSION}"
83+
echo "using integration-test image: ${INTEGRATION_VERSION}" | werft log slice "test"
84+
7185
7286
TEST_BUILD_ID=$(werft run github -a version=${INTEGRATION_VERSION} -a namespace=staging-gitpod-test-main -j .werft/run-integration-tests-ide.yaml -a testPattern=ide.test github.com/gitpod-io/gitpod:main)
87+
88+
echo "running integration, job name: ${TEST_BUILD_ID}" | werft log slice "test"
89+
werft log result -d "integration test job" url "https://werft.gitpod-dev.com/job/${TEST_BUILD_ID}"
7390
until werft job get ${TEST_BUILD_ID} -o yaml | yq r - "phase" | grep '4' > /dev/null; do
7491
sleep 1
7592
done
7693
77-
werft job get ${TEST_BUILD_ID} -o yaml | yq r - "conditions.success" > /dev/null | grep "true"
94+
95+
if ! werft job get ${TEST_BUILD_ID} -o yaml | yq r - "conditions.success" | grep "true" > /dev/null;
96+
then
97+
echo "ingetration test failed" | werft log slice "test"
98+
exit 1
99+
fi
100+
echo "ingetration test success" | werft log slice "test"

0 commit comments

Comments
 (0)