diff --git a/.werft/integration-tests-startup.yaml b/.werft/integration-tests-startup.yaml index 16d8edc840f407..7e60202c34434c 100644 --- a/.werft/integration-tests-startup.yaml +++ b/.werft/integration-tests-startup.yaml @@ -77,14 +77,14 @@ pod: echo "using integration-test image: ${INTEGRATION_VERSION}" | werft log slice "test" - 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) + 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=vscode.test github.com/gitpod-io/gitpod:main) echo "running integration, job name: ${TEST_BUILD_ID}" | werft log slice "test" werft log result -d "integration test job" url "https://werft.gitpod-dev.com/job/${TEST_BUILD_ID}" if ! werft job logs ${TEST_BUILD_ID} | werft log slice "test"; then - echo "ingetration test failed" | werft log slice "test" + echo "integration test failed" | werft log slice "test" exit 1 fi - echo "ingetration test success" | werft log slice "test" \ No newline at end of file + echo "integration test success" | werft log slice "test" \ No newline at end of file diff --git a/.werft/run-integration-tests-ide.yaml b/.werft/run-integration-tests-ide.yaml index 1c736ab1682608..9039eace0ab560 100644 --- a/.werft/run-integration-tests-ide.yaml +++ b/.werft/run-integration-tests-ide.yaml @@ -72,6 +72,11 @@ pod: secretKeyRef: name: github-roboquat-automatic-changelog key: token + - name: SLACK_NOTIFICATION_PATH + valueFrom: + secretKeyRef: + name: slack-webhook-urls + key: ide_jobs command: - /bin/bash - -c @@ -79,7 +84,7 @@ pod: sleep 1 set -Eeuo pipefail - printf '{{ toJson .Annotations }}' > context.json + printf '{{ toJson . }}' > context.json echo "[prep] receiving config..." export GOOGLE_APPLICATION_CREDENTIALS="/config/gcloud/legacy_credentials/cd-gitpod-deployer@gitpod-core-dev.iam.gserviceaccount.com/adc.json" @@ -104,6 +109,19 @@ pod: RC=${PIPESTATUS[0]} if [ $RC -eq 1 ]; then + context_name=$(jq -r '.Name' context.json) + context_host=$(jq -r '.Repository.host' context.json) + context_owner=$(jq -r '.Repository.owner' context.json) + context_repo=$(jq -r '.Repository.repo' context.json) + repo="${context_host}/${context_owner}/${context_repo}" + title=":X: *IDE integration test failure*\n_Repo:_ ${context_repo}\n_Build:_ ${context_name}"; + werftJobUrl="https://werft.gitpod-dev.com/job/${context_name}" + body="Some IDE integration test failed, please check the werf job logs and fix them" + curl -X POST \ + -H 'Content-type: application/json' \ + -d "{\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"${title}\"},\"accessory\":{\"type\":\"button\",\"text\":{\"type\":\"plain_text\",\"text\":\"Go to Werft\",\"emoji\":true},\"value\":\"click_me_123\",\"url\":\"${werftJobUrl}\",\"action_id\":\"button-action\"}},{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"\`\`\`\\n${body}\\n\`\`\`\"}}]}" \ + "https://hooks.slack.com/${SLACK_NOTIFICATION_PATH}" + echo "[int-tests|FAIL]" else echo "[int-tests|DONE]" diff --git a/test/leeway.Dockerfile b/test/leeway.Dockerfile index c86b45d3ec60c7..d9b2c541ead1a3 100644 --- a/test/leeway.Dockerfile +++ b/test/leeway.Dockerfile @@ -9,7 +9,8 @@ RUN apk upgrade --no-cache \ && apk add --no-cache \ ca-certificates \ coreutils \ - curl + curl \ + jq # convenience scripting tools RUN apk add --no-cache bash moreutils