From b697ffe7bfdf7692626229ce4d77ddd2671f72d6 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 17 Jul 2020 14:23:32 +0300 Subject: [PATCH 1/3] test(integration): Add on-premise integration tests Depends on getsentry/onpremise#602 --- cloudbuild.yaml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index d74f306f0be..372c8252c7a 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -53,9 +53,29 @@ steps: ".", ] - - name: "us.gcr.io/$PROJECT_ID/relay:$COMMIT_SHA" - args: ['--help'] - id: "smoke test" + # On-premise Integration tests + - name: 'gcr.io/$PROJECT_ID/docker-compose' + entrypoint: 'bash' + env: + - 'RELAY_IMAGE=us.gcr.io/$PROJECT_ID/relay:$COMMIT_SHA' + - 'SENTRY_TEST_HOST=http://nginx' + - 'CI=1' + args: + - '-e' + - '-c' + - | + mkdir onpremise && cd onpremise + # TODO(byk): We may also build this part as a builder image everytime + # there's a push to onpremise and use that image for + curl -L "https://github.com/getsentry/onpremise/archive/byk/feat/custom-images.tar.gz" | tar xzf - --strip-components=1 + # The following trick is from https://stackoverflow.com/a/52400857/90297 with great gratuity + echo '{"version": "3.4", "networks":{"default":{"external":{"name":"cloudbuild"}}}}' > docker-compose.override.yml + ./install.sh + docker-compose run --rm web createuser --superuser --email test@example.com --password test123TEST + docker-compose up -d + timeout 20 bash -c 'until $(curl -Isf -o /dev/null http://nginx); do printf "."; sleep 0.5; done' || docker-compose logs web + ./test.sh || docker-compose logs nginx web relay + timeout: 300s - name: 'gcr.io/cloud-builders/docker' secretEnv: ['DOCKER_PASSWORD'] From dbfed174581b0ad2461cac01268947e833d6fd92 Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 17 Jul 2020 14:46:00 +0300 Subject: [PATCH 2/3] increase timeout for onprem tests --- cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 372c8252c7a..10afc396faf 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -75,7 +75,7 @@ steps: docker-compose up -d timeout 20 bash -c 'until $(curl -Isf -o /dev/null http://nginx); do printf "."; sleep 0.5; done' || docker-compose logs web ./test.sh || docker-compose logs nginx web relay - timeout: 300s + timeout: 450s - name: 'gcr.io/cloud-builders/docker' secretEnv: ['DOCKER_PASSWORD'] From afe00859e3daaeec18b44d8dadf7b00ef043579e Mon Sep 17 00:00:00 2001 From: Burak Yigit Kaya Date: Fri, 17 Jul 2020 15:03:19 +0300 Subject: [PATCH 3/3] Switch to master branch of onpremise --- cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 10afc396faf..b29014a3533 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -67,7 +67,7 @@ steps: mkdir onpremise && cd onpremise # TODO(byk): We may also build this part as a builder image everytime # there's a push to onpremise and use that image for - curl -L "https://github.com/getsentry/onpremise/archive/byk/feat/custom-images.tar.gz" | tar xzf - --strip-components=1 + curl -L "https://github.com/getsentry/onpremise/archive/master.tar.gz" | tar xzf - --strip-components=1 # The following trick is from https://stackoverflow.com/a/52400857/90297 with great gratuity echo '{"version": "3.4", "networks":{"default":{"external":{"name":"cloudbuild"}}}}' > docker-compose.override.yml ./install.sh