Skip to content

Commit

Permalink
ci: Remove GCB tests and make GHA default for self-hosted e2e tests (#…
Browse files Browse the repository at this point in the history
…3557)

This is the final step of [standardizing self-hosted e2e tests](getsentry/self-hosted#1756). We remove tests from Google Cloud Build and replace it with the latest Github Action.
  • Loading branch information
emmatyping authored Dec 28, 2022
1 parent e9cab59 commit 66197e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ jobs:
- name: Checkout Snuba
uses: actions/checkout@v3
- name: Run Sentry self-hosted e2e CI
uses: getsentry/action-self-hosted-e2e-tests@697a3ca95a72f93e3a1ebdb8f967be38d1f029f6
uses: getsentry/action-self-hosted-e2e-tests@4ff2dbfdd5c986a4670efaa16d82e460598359eb
with:
project_name: snuba
docker_repo: getsentry/snuba
Expand Down
71 changes: 1 addition & 70 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,67 +39,7 @@ steps:
- "local"
- "-v"
- "--remove-orphans"
- name: "gcr.io/$PROJECT_ID/docker-compose"
id: get-self-hosted-repo
waitFor:
# We need to wait until unit-tests finish as `pytest` tries
# to run tests under self-hosted repo too
- unit-tests
entrypoint: "bash"
args:
- "-e"
- "-c"
- |
mkdir self-hosted && cd self-hosted
curl -L "https://github.com/getsentry/self-hosted/archive/master.tar.gz" | tar xzf - --strip-components=1
echo '{"version": "3.4", "networks":{"default":{"external":{"name":"cloudbuild"}}}}' > docker-compose.override.yml
- name: "gcr.io/$PROJECT_ID/docker-compose"
id: e2e-test
env:
- 'REPORT_SELF_HOSTED_ISSUES=0'
waitFor:
- runtime-image
- unit-tests-cleanup
- get-self-hosted-repo
entrypoint: "bash"
dir: self-hosted
args:
- "-e"
- "-c"
- |
./install.sh
set +e
./test.sh
test_return=$?
set -e
if [[ $test_return -ne 0 ]]; then
echo "Test failed.";
docker-compose ps;
docker-compose logs;
exit $test_return;
fi
timeout: 900s
- name: "gcr.io/cloud-builders/docker"
id: docker-push
waitFor:
- e2e-test
secretEnv: ["DOCKER_PASSWORD"]
entrypoint: "bash"
args:
- "-e"
- "-c"
- |
# Only push to Docker Hub from master
[ "$BRANCH_NAME" != "master" ] && exit 0
# Need to pull the image first due to Kaniko
docker pull $$SNUBA_IMAGE
echo "$$DOCKER_PASSWORD" | docker login --username=sentrybuilder --password-stdin
docker tag $$SNUBA_IMAGE $$DOCKER_REPO:$SHORT_SHA
docker push $$DOCKER_REPO:$SHORT_SHA
docker tag $$SNUBA_IMAGE $$DOCKER_REPO:$COMMIT_SHA
docker push $$DOCKER_REPO:$COMMIT_SHA
docker tag $$SNUBA_IMAGE $$DOCKER_REPO:nightly
docker push $$DOCKER_REPO:nightly

# This is needed for Freight to find matching builds
images: ['us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA']
timeout: 2640s
Expand All @@ -111,12 +51,3 @@ options:
- "SNUBA_IMAGE=us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"
- "DOCKER_REPO=getsentry/snuba"
- "SENTRY_TEST_HOST=http://nginx"
secrets:
- kmsKeyName: projects/sentryio/locations/global/keyRings/service-credentials/cryptoKeys/cloudbuild
secretEnv:
# This is a personal access token for the sentrybuilder account, encrypted using the
# short guide at http://bit.ly/2Pg6uw9
DOCKER_PASSWORD: |
CiQAE8gN7y3OMxn+a1kofmK4Bi8jQZtdRFj2lYYwaZHVeIIBUzMSTQA9tvn8XCv2vqj6u8CHoeSP
TVW9pLvSCorKoeNtOp0eb+6V1yNJW/+JC07DNO1KLbTbodbuza6jKJHU5xeAJ4kGQI78UY5Vu1Gp
QcMK

0 comments on commit 66197e5

Please sign in to comment.