From 82fa58d0f1997a403caf00fdc9c96715ab824753 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 10:16:12 +0000 Subject: [PATCH 01/51] First attempt at cloud build file --- cloudbuild.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cloudbuild.yml diff --git a/cloudbuild.yml b/cloudbuild.yml new file mode 100644 index 00000000..09cb9ea2 --- /dev/null +++ b/cloudbuild.yml @@ -0,0 +1,12 @@ +steps: + - name: maven:3-jdk-17 + entrypoint: mvn + args: [ '--version' ] + - name: maven:3-jdk-17 + entrypoint: mvn + args: [ 'fmt:check','pmd:check' ] +# - name: maven:3-jdk-17 +# entrypoint: mvn +# args: [ 'verify','jacoco:report' ] +# - name: bash +# args: ["./check_codecov.sh"] \ No newline at end of file From 93e11e51aac4ef478f55c8b996709a970b9f6f5b Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 11:24:23 +0000 Subject: [PATCH 02/51] Update first step --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 09cb9ea2..57611cb2 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -1,5 +1,5 @@ steps: - - name: maven:3-jdk-17 + - name: openjdk:17-jdk-slim entrypoint: mvn args: [ '--version' ] - name: maven:3-jdk-17 From ab0ac545b76f96c3ebbe73b5316ee1a7ba6246fa Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 11:26:53 +0000 Subject: [PATCH 03/51] change step to maven --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 57611cb2..13e4214b 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -1,5 +1,5 @@ steps: - - name: openjdk:17-jdk-slim + - name: maven entrypoint: mvn args: [ '--version' ] - name: maven:3-jdk-17 From 4133de40ab6852968f40269554a793f586d46ce5 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 11:28:17 +0000 Subject: [PATCH 04/51] Update step to include maven verify --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 13e4214b..8d6fe341 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -2,7 +2,7 @@ steps: - name: maven entrypoint: mvn args: [ '--version' ] - - name: maven:3-jdk-17 + - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] # - name: maven:3-jdk-17 From a81c1eecdd4e95d052fb33964095fa4bcd96c8c0 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 11:28:39 +0000 Subject: [PATCH 05/51] Change name on third step --- cloudbuild.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 8d6fe341..4db0eee3 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -5,8 +5,8 @@ steps: - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] -# - name: maven:3-jdk-17 -# entrypoint: mvn -# args: [ 'verify','jacoco:report' ] + - name: maven + entrypoint: mvn + args: [ 'verify','jacoco:report' ] # - name: bash # args: ["./check_codecov.sh"] \ No newline at end of file From 575e0ac06b333b7e0282b369cdea91b23767d777 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 11:57:45 +0000 Subject: [PATCH 06/51] test --- cloudbuild.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cloudbuild.yml b/cloudbuild.yml index 4db0eee3..c543d6e5 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -2,6 +2,9 @@ steps: - name: maven entrypoint: mvn args: [ '--version' ] + - name: docker + args: ['compose', '--help'] + waitFor: ['-'] - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] From 3ac2e69ee7855297d6d11cdf3a57ecbb8951493b Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 11:58:31 +0000 Subject: [PATCH 07/51] Testing docker --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index c543d6e5..c69bfb38 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -3,7 +3,7 @@ steps: entrypoint: mvn args: [ '--version' ] - name: docker - args: ['compose', '--help'] + args: ['docker compose', '--help'] waitFor: ['-'] - name: maven entrypoint: mvn From b95532ed7fe5d706d9bb8c8e3888754eabfd3be6 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 12:04:32 +0000 Subject: [PATCH 08/51] Attempting to use my own docker for now --- cloudbuild.yml | 3 --- pom.xml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index c69bfb38..4db0eee3 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -2,9 +2,6 @@ steps: - name: maven entrypoint: mvn args: [ '--version' ] - - name: docker - args: ['docker compose', '--help'] - waitFor: ['-'] - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] diff --git a/pom.xml b/pom.xml index fbb52df7..894de9e0 100644 --- a/pom.xml +++ b/pom.xml @@ -246,7 +246,7 @@ package - europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/${project.artifactId} + europe-west2-docker.pkg.dev/ssdc-rm-ryangrundy-317208/docker/${project.artifactId} ${project.build.finalName}.jar From 2c91ccada49428fa3d1a6c269f7875818c43b0bc Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 12:25:10 +0000 Subject: [PATCH 09/51] Attempting docker compose --- cloudbuild.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloudbuild.yml b/cloudbuild.yml index 4db0eee3..5bfdd621 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -5,6 +5,10 @@ steps: - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] + - id: docker-compose + name: 'docker/compose:1.19.0' + args: ['-f', '/workspace/src/test/resources/docker-compose.yml', 'up', '-d'] + waitFor: ['-'] - name: maven entrypoint: mvn args: [ 'verify','jacoco:report' ] From f44fbd58f85e0cd4d91ddddffe1cba62d7dc7374 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 12:26:53 +0000 Subject: [PATCH 10/51] Create network --- cloudbuild.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloudbuild.yml b/cloudbuild.yml index 5bfdd621..1c6f1cbb 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -5,6 +5,10 @@ steps: - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] + - id: docker-network + name: 'docker' + args: [ 'network', 'create' ,'ssdcrmdockerdev_default' + waitFor: [ '-' ] - id: docker-compose name: 'docker/compose:1.19.0' args: ['-f', '/workspace/src/test/resources/docker-compose.yml', 'up', '-d'] From 34bc6e87f5af6e6c50fa96dca66ea3cf8bf7bcd2 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 12:27:15 +0000 Subject: [PATCH 11/51] close args --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 1c6f1cbb..85a613c8 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -7,7 +7,7 @@ steps: args: [ 'fmt:check','pmd:check' ] - id: docker-network name: 'docker' - args: [ 'network', 'create' ,'ssdcrmdockerdev_default' + args: [ 'network', 'create' ,'ssdcrmdockerdev_default'] waitFor: [ '-' ] - id: docker-compose name: 'docker/compose:1.19.0' From 0ce1b37845d34f04951c543268a75329979ecfb2 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 13:50:33 +0000 Subject: [PATCH 12/51] Attempting to get tests running --- cloudbuild.yml | 6 ++++-- pom.xml | 2 +- src/test/resources/application-test.yml | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 85a613c8..a5ce182d 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -5,6 +5,7 @@ steps: - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] + id: mvn format - id: docker-network name: 'docker' args: [ 'network', 'create' ,'ssdcrmdockerdev_default'] @@ -12,9 +13,10 @@ steps: - id: docker-compose name: 'docker/compose:1.19.0' args: ['-f', '/workspace/src/test/resources/docker-compose.yml', 'up', '-d'] - waitFor: ['-'] + waitFor: ['docker-network'] - name: maven entrypoint: mvn - args: [ 'verify','jacoco:report' ] + args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true' ] + waitFor: ['docker-compose', 'mvn-format'] # - name: bash # args: ["./check_codecov.sh"] \ No newline at end of file diff --git a/pom.xml b/pom.xml index 894de9e0..fbb52df7 100644 --- a/pom.xml +++ b/pom.xml @@ -246,7 +246,7 @@ package - europe-west2-docker.pkg.dev/ssdc-rm-ryangrundy-317208/docker/${project.artifactId} + europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/${project.artifactId} ${project.build.finalName}.jar diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 6b3174b8..ccf9e834 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -1,16 +1,17 @@ spring: datasource: - url: jdbc:postgresql://localhost:16432/postgres + url: jdbc:postgresql://postgres-case-it:16432/postgres cloud: gcp: pubsub: - emulator-host: localhost:18538 + emulator-host: pubsub-emulator-case-it:18538 project-id: our-project uacservice: connection: port: 18164 + host: uac-qid-case-it uacqid-cache-min: 5 uacqid-fetch-count: 10 From 15b338f56e64810aeabf03f65e539499d04e5f16 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 14:14:02 +0000 Subject: [PATCH 13/51] run inside cloudbuild network --- cloudbuild.yml | 2 +- src/test/resources/application-test.yml | 5 ++--- src/test/resources/docker-compose.yml | 14 ++++++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index a5ce182d..bcc5fcb4 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -5,7 +5,7 @@ steps: - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] - id: mvn format + id: mvn-format - id: docker-network name: 'docker' args: [ 'network', 'create' ,'ssdcrmdockerdev_default'] diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index ccf9e834..6b3174b8 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -1,17 +1,16 @@ spring: datasource: - url: jdbc:postgresql://postgres-case-it:16432/postgres + url: jdbc:postgresql://localhost:16432/postgres cloud: gcp: pubsub: - emulator-host: pubsub-emulator-case-it:18538 + emulator-host: localhost:18538 project-id: our-project uacservice: connection: port: 18164 - host: uac-qid-case-it uacqid-cache-min: 5 uacqid-fetch-count: 10 diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 5323866b..285d9522 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -6,6 +6,8 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" + networks: + - cloudbuild uac-qid-case-it: container_name: uac-qid-case-it @@ -22,12 +24,16 @@ services: interval: 30s timeout: 10s retries: 10 + networks: + - cloudbuild pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" + networks: + - cloudbuild setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it @@ -39,14 +45,14 @@ services: depends_on: - pubsub-emulator-case-it entrypoint: sh -c "/setup_pubsub.sh" + networks: + - cloudbuild start_dependencies: image: dadarek/wait-for-dependencies depends_on: uac-qid-case-it: condition: service_healthy + networks: + - cloudbuild -networks: - default: - external: - name: ssdcrmdockerdev_default From e2bbd1327de2efa2c319a228d21df6c227d4318c Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 14:19:20 +0000 Subject: [PATCH 14/51] test network --- src/test/resources/docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 285d9522..cf8ee51e 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -45,14 +45,14 @@ services: depends_on: - pubsub-emulator-case-it entrypoint: sh -c "/setup_pubsub.sh" - networks: - - cloudbuild start_dependencies: image: dadarek/wait-for-dependencies depends_on: uac-qid-case-it: condition: service_healthy - networks: - - cloudbuild +networks: + default: + external: + name: cloudbuild From 85495d6b999a439d8578bae09c145bf55b367464 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 14:23:49 +0000 Subject: [PATCH 15/51] external network --- src/test/resources/docker-compose.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index cf8ee51e..44a8d7e7 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -53,6 +53,5 @@ services: condition: service_healthy networks: - default: - external: - name: cloudbuild + cloudbuild: + external: true From e8064ffa01e1c0051af934ef686633d64033bc44 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 14:41:30 +0000 Subject: [PATCH 16/51] please work --- src/test/resources/docker-compose.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 44a8d7e7..edb8c2be 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -6,8 +6,6 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" - networks: - - cloudbuild uac-qid-case-it: container_name: uac-qid-case-it @@ -24,16 +22,13 @@ services: interval: 30s timeout: 10s retries: 10 - networks: - - cloudbuild pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" - networks: - - cloudbuild + setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it @@ -53,5 +48,6 @@ services: condition: service_healthy networks: - cloudbuild: - external: true + default: + external: + name: cloudbuild From 2c553961bff7b66c5a88687df0cdb7dd1a164bb1 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 15:53:38 +0000 Subject: [PATCH 17/51] add cloudbuild network to container --- src/test/resources/docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index edb8c2be..68c765e0 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -6,6 +6,8 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" + networks: + - cloudbuild uac-qid-case-it: container_name: uac-qid-case-it @@ -22,12 +24,16 @@ services: interval: 30s timeout: 10s retries: 10 + networks: + - cloudbuild pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" + networks: + - cloudbuild setup-pubsub-emulator-case-it: From e640d98be665b97cd0e19b20227c01886462b0f9 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 16:31:49 +0000 Subject: [PATCH 18/51] removed network from container --- src/test/resources/docker-compose.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 68c765e0..33214133 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -6,8 +6,6 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" - networks: - - cloudbuild uac-qid-case-it: container_name: uac-qid-case-it @@ -24,17 +22,12 @@ services: interval: 30s timeout: 10s retries: 10 - networks: - - cloudbuild pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" - networks: - - cloudbuild - setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it @@ -55,5 +48,4 @@ services: networks: default: - external: - name: cloudbuild + name: cloudbuild From 6cb6af8688ec3413798196f89b4c73df8c371855 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 22 Mar 2022 16:42:00 +0000 Subject: [PATCH 19/51] more networking stuff --- src/test/resources/docker-compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 33214133..fe31dfa0 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -6,6 +6,7 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" + network_mode: cloudbuild uac-qid-case-it: container_name: uac-qid-case-it @@ -22,12 +23,14 @@ services: interval: 30s timeout: 10s retries: 10 + network_mode: cloudbuild pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" + network_mode: cloudbuild setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it From 775995fa4d409e4c7fb2722253f420d4e44b3d5c Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 23 Mar 2022 10:12:57 +0000 Subject: [PATCH 20/51] another try --- src/test/resources/docker-compose.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index fe31dfa0..01472717 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2.1' +version: '3' services: postgres-case-it: container_name: postgres-case-it @@ -6,7 +6,7 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" - network_mode: cloudbuild + networks: [cloudbuild] uac-qid-case-it: container_name: uac-qid-case-it @@ -23,14 +23,14 @@ services: interval: 30s timeout: 10s retries: 10 - network_mode: cloudbuild + networks: [cloudbuild] pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" - network_mode: cloudbuild + networks: [cloudbuild] setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it @@ -51,4 +51,5 @@ services: networks: default: - name: cloudbuild + external: + name: cloudbuild \ No newline at end of file From 8d7b7b2ce484e615775a6710b6a0d496c7f5c9ad Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 23 Mar 2022 10:18:45 +0000 Subject: [PATCH 21/51] update docker compose version --- src/test/resources/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 01472717..80f8f855 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: '3.7' services: postgres-case-it: container_name: postgres-case-it From 70ad05269f1cabf91a20d80643b0e26a0a2a4624 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 23 Mar 2022 10:29:19 +0000 Subject: [PATCH 22/51] external network --- src/test/resources/docker-compose.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 80f8f855..06d9c6ce 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -50,6 +50,5 @@ services: condition: service_healthy networks: - default: - external: - name: cloudbuild \ No newline at end of file + cloudbuild: + external: true \ No newline at end of file From 002bbf5ef2fb12f9f16ab356516e6b9d0c0723aa Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 23 Mar 2022 10:41:22 +0000 Subject: [PATCH 23/51] attempt at networking --- src/test/resources/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 06d9c6ce..49390514 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -5,14 +5,14 @@ services: image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/ssdc-rm-dev-common-postgres:latest command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - - "16432:5432" + - "127.0.0.1:16432:5432" networks: [cloudbuild] uac-qid-case-it: container_name: uac-qid-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/ssdc-rm-uac-qid-service:latest ports: - - "18164:8164" + - "127.0.0.1:18164:8164" external_links: - postgres-case-it environment: @@ -29,7 +29,7 @@ services: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - - "18538:8538" + - "127.0.0.118538:8538" networks: [cloudbuild] setup-pubsub-emulator-case-it: From e07c12e0505365b4b383337f37fe25fce45551fc Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 23 Mar 2022 11:05:43 +0000 Subject: [PATCH 24/51] remove localhost mention --- src/test/resources/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 49390514..06d9c6ce 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -5,14 +5,14 @@ services: image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/ssdc-rm-dev-common-postgres:latest command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - - "127.0.0.1:16432:5432" + - "16432:5432" networks: [cloudbuild] uac-qid-case-it: container_name: uac-qid-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/ssdc-rm-uac-qid-service:latest ports: - - "127.0.0.1:18164:8164" + - "18164:8164" external_links: - postgres-case-it environment: @@ -29,7 +29,7 @@ services: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - - "127.0.0.118538:8538" + - "18538:8538" networks: [cloudbuild] setup-pubsub-emulator-case-it: From 458a347d2fb031fad7f2f6dc98706c49ab73054e Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 23 Mar 2022 14:05:38 +0000 Subject: [PATCH 25/51] changing host --- src/test/resources/application-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 6b3174b8..2c3dcc90 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -1,16 +1,17 @@ spring: datasource: - url: jdbc:postgresql://localhost:16432/postgres + url: jdbc:postgresql://host.docker.internal:16432/postgres cloud: gcp: pubsub: - emulator-host: localhost:18538 + emulator-host: host.docker.internal:18538 project-id: our-project uacservice: connection: port: 18164 + host: host.docker.internal uacqid-cache-min: 5 uacqid-fetch-count: 10 From b8ffbd59bfc8695ad881523f5b75bee406007543 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 23 Mar 2022 14:20:12 +0000 Subject: [PATCH 26/51] revert host change --- src/test/resources/application-test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 2c3dcc90..6b3174b8 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -1,17 +1,16 @@ spring: datasource: - url: jdbc:postgresql://host.docker.internal:16432/postgres + url: jdbc:postgresql://localhost:16432/postgres cloud: gcp: pubsub: - emulator-host: host.docker.internal:18538 + emulator-host: localhost:18538 project-id: our-project uacservice: connection: port: 18164 - host: host.docker.internal uacqid-cache-min: 5 uacqid-fetch-count: 10 From 82c25e7fdbcdb5c87f221071e7bd2f14b9a1c363 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 24 Mar 2022 10:13:19 +0000 Subject: [PATCH 27/51] revert to old network --- src/test/resources/docker-compose.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index 06d9c6ce..ed965d83 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -6,7 +6,6 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" - networks: [cloudbuild] uac-qid-case-it: container_name: uac-qid-case-it @@ -23,14 +22,12 @@ services: interval: 30s timeout: 10s retries: 10 - networks: [cloudbuild] pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" - networks: [cloudbuild] setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it @@ -50,5 +47,6 @@ services: condition: service_healthy networks: - cloudbuild: - external: true \ No newline at end of file + default: + external: + name: ssdcrmdockerdev_default From 750b9080079674be17a0cd3842451d6b5bd1e7f5 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 24 Mar 2022 10:48:44 +0000 Subject: [PATCH 28/51] cloud build network --- src/test/resources/docker-compose.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index ed965d83..c9127de3 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -6,6 +6,7 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" + network_mode: cloudbuild uac-qid-case-it: container_name: uac-qid-case-it @@ -22,12 +23,14 @@ services: interval: 30s timeout: 10s retries: 10 + network_mode: cloudbuild pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" + network_mode: cloudbuild setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it @@ -49,4 +52,4 @@ services: networks: default: external: - name: ssdcrmdockerdev_default + name: cloudbuild \ No newline at end of file From b184b98e228beb4c307502c92b9304472979d673 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 24 Mar 2022 11:07:37 +0000 Subject: [PATCH 29/51] try changing port in application test --- src/test/resources/application-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 6b3174b8..7b49120e 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -1,17 +1,17 @@ spring: datasource: - url: jdbc:postgresql://localhost:16432/postgres + url: jdbc:postgresql://postgres-case-it:6432/postgres cloud: gcp: pubsub: - emulator-host: localhost:18538 + emulator-host: pubsub-emulator-case-it:8538 project-id: our-project uacservice: connection: - port: 18164 - + port: 8164 + host: uac-qid-case-it uacqid-cache-min: 5 uacqid-fetch-count: 10 uacqid-get-timeout: 1 #seconds From c0352360827f5666706930519e6bf0d6a93f5042 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 24 Mar 2022 11:08:35 +0000 Subject: [PATCH 30/51] change postgres port --- src/test/resources/application-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 7b49120e..590a0b3d 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -1,6 +1,6 @@ spring: datasource: - url: jdbc:postgresql://postgres-case-it:6432/postgres + url: jdbc:postgresql://postgres-case-it:5432/postgres cloud: gcp: From 6c901b40cd54d7177e373ea32cefb7ac1eb96d4b Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 24 Mar 2022 13:02:55 +0000 Subject: [PATCH 31/51] add another test profile --- cloudbuild.yml | 19 ++----- .../healthcheck/HealthCheckIT.java | 2 +- .../messaging/DeactivateUacReceiverIT.java | 2 +- .../messaging/EmailFulfilmentReceiverIT.java | 2 +- .../messaging/EqLaunchReceiverIT.java | 2 +- .../messaging/InvalidCaseReceiverIT.java | 2 +- .../messaging/NewCaseReceiverIT.java | 2 +- .../messaging/PrintFulfilmentReceiverIT.java | 2 +- .../messaging/ReceiptReceiverIT.java | 2 +- .../messaging/RefusalReceiverIT.java | 2 +- .../messaging/SmsFulfilmentReceiverIT.java | 2 +- .../messaging/TelephoneCaptureReceiverIT.java | 2 +- .../UacAuthenticationReceiverIT.java | 2 +- .../messaging/UpdateSampleReceiverIT.java | 2 +- .../UpdateSampleSensitiveReceiverIT.java | 2 +- ...uleSurveyExportFileTemplateRepository.java | 2 +- .../repository/EmailTemplateRepository.java | 2 +- ...entSurveyExportFileTemplateRepository.java | 2 +- .../repository/SmsTemplateRepository.java | 2 +- .../model/repository/SurveyRepository.java | 2 +- .../caseprocessor/schedule/ActionRuleIT.java | 2 +- .../caseprocessor/schedule/FulfilmentIT.java | 2 +- .../testutils/DeleteDataHelper.java | 2 +- .../caseprocessor/testutils/EventPoller.java | 2 +- .../testutils/JunkDataHelper.java | 2 +- .../caseprocessor/testutils/PubsubHelper.java | 2 +- .../caseprocessor/testutils/TestConfig.java | 2 +- src/test/resources/application-test-ci.yml | 22 ++++++++ src/test/resources/application-test.yml | 8 +-- src/test/resources/docker-compose-ci.yml | 55 +++++++++++++++++++ src/test/resources/docker-compose.yml | 7 +-- 31 files changed, 113 insertions(+), 50 deletions(-) create mode 100644 src/test/resources/application-test-ci.yml create mode 100644 src/test/resources/docker-compose-ci.yml diff --git a/cloudbuild.yml b/cloudbuild.yml index bcc5fcb4..3095313b 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -1,22 +1,11 @@ steps: - - name: maven - entrypoint: mvn - args: [ '--version' ] - name: maven entrypoint: mvn args: [ 'fmt:check','pmd:check' ] id: mvn-format - - id: docker-network - name: 'docker' - args: [ 'network', 'create' ,'ssdcrmdockerdev_default'] - waitFor: [ '-' ] - id: docker-compose - name: 'docker/compose:1.19.0' - args: ['-f', '/workspace/src/test/resources/docker-compose.yml', 'up', '-d'] - waitFor: ['docker-network'] - - name: maven + name: 'docker/compose:1.29.0' + args: ['-f', '/workspace/src/test/resources/docker-compose-ci.yml', 'up', '-d'] + - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true' ] - waitFor: ['docker-compose', 'mvn-format'] -# - name: bash -# args: ["./check_codecov.sh"] \ No newline at end of file + args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci' ] \ No newline at end of file diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/healthcheck/HealthCheckIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/healthcheck/HealthCheckIT.java index 126a656f..52c6b168 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/healthcheck/HealthCheckIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/healthcheck/HealthCheckIT.java @@ -15,7 +15,7 @@ import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit.jupiter.SpringExtension; -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class HealthCheckIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/DeactivateUacReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/DeactivateUacReceiverIT.java index 08e97e84..cfcb27b8 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/DeactivateUacReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/DeactivateUacReceiverIT.java @@ -30,7 +30,7 @@ import uk.gov.ons.ssdc.common.model.entity.UacQidLink; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class DeactivateUacReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EmailFulfilmentReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EmailFulfilmentReceiverIT.java index 6dd39e8f..212f1c23 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EmailFulfilmentReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EmailFulfilmentReceiverIT.java @@ -33,7 +33,7 @@ import uk.gov.ons.ssdc.common.model.entity.UacQidLink; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) class EmailFulfilmentReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EqLaunchReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EqLaunchReceiverIT.java index 54346bbf..47a4a44f 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EqLaunchReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/EqLaunchReceiverIT.java @@ -31,7 +31,7 @@ import uk.gov.ons.ssdc.common.model.entity.UacQidLink; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class EqLaunchReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/InvalidCaseReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/InvalidCaseReceiverIT.java index 2bab33eb..01556510 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/InvalidCaseReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/InvalidCaseReceiverIT.java @@ -28,7 +28,7 @@ import uk.gov.ons.ssdc.common.model.entity.EventType; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class InvalidCaseReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/NewCaseReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/NewCaseReceiverIT.java index c3090bf1..144c980f 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/NewCaseReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/NewCaseReceiverIT.java @@ -36,7 +36,7 @@ import uk.gov.ons.ssdc.common.model.entity.EventType; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class NewCaseReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/PrintFulfilmentReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/PrintFulfilmentReceiverIT.java index 3a4e4196..a220a20d 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/PrintFulfilmentReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/PrintFulfilmentReceiverIT.java @@ -33,7 +33,7 @@ import uk.gov.ons.ssdc.common.model.entity.FulfilmentToProcess; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) class PrintFulfilmentReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/ReceiptReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/ReceiptReceiverIT.java index 5085ed73..e954b692 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/ReceiptReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/ReceiptReceiverIT.java @@ -32,7 +32,7 @@ import uk.gov.ons.ssdc.common.model.entity.UacQidLink; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class ReceiptReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/RefusalReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/RefusalReceiverIT.java index 66999c64..4a29eea6 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/RefusalReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/RefusalReceiverIT.java @@ -29,7 +29,7 @@ import uk.gov.ons.ssdc.common.model.entity.EventType; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class RefusalReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/SmsFulfilmentReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/SmsFulfilmentReceiverIT.java index 67adea55..2bb39542 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/SmsFulfilmentReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/SmsFulfilmentReceiverIT.java @@ -33,7 +33,7 @@ import uk.gov.ons.ssdc.common.model.entity.UacQidLink; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) class SmsFulfilmentReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/TelephoneCaptureReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/TelephoneCaptureReceiverIT.java index da1dc532..b58ecf2c 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/TelephoneCaptureReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/TelephoneCaptureReceiverIT.java @@ -33,7 +33,7 @@ import uk.gov.ons.ssdc.common.model.entity.UacQidLink; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) class TelephoneCaptureReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UacAuthenticationReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UacAuthenticationReceiverIT.java index 80152ae5..e0e78c63 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UacAuthenticationReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UacAuthenticationReceiverIT.java @@ -26,7 +26,7 @@ import uk.gov.ons.ssdc.common.model.entity.UacQidLink; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class UacAuthenticationReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleReceiverIT.java index 24837efd..15c71d18 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleReceiverIT.java @@ -39,7 +39,7 @@ import uk.gov.ons.ssdc.common.validation.Rule; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class UpdateSampleReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleSensitiveReceiverIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleSensitiveReceiverIT.java index ac50d8db..226f7485 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleSensitiveReceiverIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/messaging/UpdateSampleSensitiveReceiverIT.java @@ -42,7 +42,7 @@ import uk.gov.ons.ssdc.common.validation.Rule; @ContextConfiguration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @SpringBootTest @ExtendWith(SpringExtension.class) public class UpdateSampleSensitiveReceiverIT { diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/ActionRuleSurveyExportFileTemplateRepository.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/ActionRuleSurveyExportFileTemplateRepository.java index d3043b05..b1830d96 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/ActionRuleSurveyExportFileTemplateRepository.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/ActionRuleSurveyExportFileTemplateRepository.java @@ -7,6 +7,6 @@ import uk.gov.ons.ssdc.common.model.entity.ActionRuleSurveyExportFileTemplate; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public interface ActionRuleSurveyExportFileTemplateRepository extends JpaRepository {} diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/EmailTemplateRepository.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/EmailTemplateRepository.java index 425f16bd..6bb25e0e 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/EmailTemplateRepository.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/EmailTemplateRepository.java @@ -6,5 +6,5 @@ import uk.gov.ons.ssdc.common.model.entity.EmailTemplate; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public interface EmailTemplateRepository extends JpaRepository {} diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/FulfilmentSurveyExportFileTemplateRepository.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/FulfilmentSurveyExportFileTemplateRepository.java index eca2b3b9..4aa620df 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/FulfilmentSurveyExportFileTemplateRepository.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/FulfilmentSurveyExportFileTemplateRepository.java @@ -7,6 +7,6 @@ import uk.gov.ons.ssdc.common.model.entity.FulfilmentSurveyExportFileTemplate; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public interface FulfilmentSurveyExportFileTemplateRepository extends JpaRepository {} diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SmsTemplateRepository.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SmsTemplateRepository.java index e1fbc637..3fcd7733 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SmsTemplateRepository.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SmsTemplateRepository.java @@ -6,5 +6,5 @@ import uk.gov.ons.ssdc.common.model.entity.SmsTemplate; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public interface SmsTemplateRepository extends JpaRepository {} diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SurveyRepository.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SurveyRepository.java index 8414361e..8b28e3ba 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SurveyRepository.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/model/repository/SurveyRepository.java @@ -7,5 +7,5 @@ import uk.gov.ons.ssdc.common.model.entity.Survey; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public interface SurveyRepository extends JpaRepository {} diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/ActionRuleIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/ActionRuleIT.java index b5399bc4..ad10489a 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/ActionRuleIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/ActionRuleIT.java @@ -47,7 +47,7 @@ @ContextConfiguration @SpringBootTest -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @ExtendWith(SpringExtension.class) class ActionRuleIT { private static final String PACK_CODE = "test-pack-code"; diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/FulfilmentIT.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/FulfilmentIT.java index 3f1b3c6c..280d94f9 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/FulfilmentIT.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/schedule/FulfilmentIT.java @@ -37,7 +37,7 @@ @ContextConfiguration @SpringBootTest -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @ExtendWith(SpringExtension.class) class FulfilmentIT { private static final String FULFILMENT_TOPIC = "event_print-fulfilment"; diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/DeleteDataHelper.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/DeleteDataHelper.java index d6b992ef..2d6a6616 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/DeleteDataHelper.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/DeleteDataHelper.java @@ -21,7 +21,7 @@ import uk.gov.ons.ssdc.caseprocessor.model.repository.UacQidLinkRepository; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public class DeleteDataHelper { @Autowired private CaseRepository caseRepository; @Autowired private CollectionExerciseRepository collectionExerciseRepository; diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/EventPoller.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/EventPoller.java index 4e3ccde5..c3d93215 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/EventPoller.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/EventPoller.java @@ -9,7 +9,7 @@ import uk.gov.ons.ssdc.common.model.entity.Event; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public class EventPoller { private final EventRepository eventRepository; diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/JunkDataHelper.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/JunkDataHelper.java index 5256caf4..5da1c8b2 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/JunkDataHelper.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/JunkDataHelper.java @@ -25,7 +25,7 @@ import uk.gov.ons.ssdc.common.validation.Rule; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public class JunkDataHelper { private static final Random RANDOM = new Random(); diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/PubsubHelper.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/PubsubHelper.java index 55a59611..bbf4ef0c 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/PubsubHelper.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/PubsubHelper.java @@ -30,7 +30,7 @@ import uk.gov.ons.ssdc.caseprocessor.utils.ObjectMapperFactory; @Component -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") @EnableRetry public class PubsubHelper { @Qualifier("pubSubTemplateForIntegrationTests") diff --git a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/TestConfig.java b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/TestConfig.java index abaebb3b..4f6cef0f 100644 --- a/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/TestConfig.java +++ b/src/test/java/uk/gov/ons/ssdc/caseprocessor/testutils/TestConfig.java @@ -10,7 +10,7 @@ import uk.gov.ons.ssdc.caseprocessor.utils.ObjectMapperFactory; @Configuration -@ActiveProfiles("test") +@ActiveProfiles("${spring.profiles.active}") public class TestConfig { @Bean("pubSubTemplateForIntegrationTests") public PubSubTemplate pubSubTemplate( diff --git a/src/test/resources/application-test-ci.yml b/src/test/resources/application-test-ci.yml new file mode 100644 index 00000000..590a0b3d --- /dev/null +++ b/src/test/resources/application-test-ci.yml @@ -0,0 +1,22 @@ +spring: + datasource: + url: jdbc:postgresql://postgres-case-it:5432/postgres + + cloud: + gcp: + pubsub: + emulator-host: pubsub-emulator-case-it:8538 + project-id: our-project + +uacservice: + connection: + port: 8164 + host: uac-qid-case-it + uacqid-cache-min: 5 + uacqid-fetch-count: 10 + uacqid-get-timeout: 1 #seconds + +caserefgeneratorkey: rPr3qsjlU42hsDX5npfuCzlyF4UYfDTO + +queueconfig: + shared-pubsub-project: shared-project \ No newline at end of file diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 590a0b3d..6b3174b8 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -1,17 +1,17 @@ spring: datasource: - url: jdbc:postgresql://postgres-case-it:5432/postgres + url: jdbc:postgresql://localhost:16432/postgres cloud: gcp: pubsub: - emulator-host: pubsub-emulator-case-it:8538 + emulator-host: localhost:18538 project-id: our-project uacservice: connection: - port: 8164 - host: uac-qid-case-it + port: 18164 + uacqid-cache-min: 5 uacqid-fetch-count: 10 uacqid-get-timeout: 1 #seconds diff --git a/src/test/resources/docker-compose-ci.yml b/src/test/resources/docker-compose-ci.yml new file mode 100644 index 00000000..c9127de3 --- /dev/null +++ b/src/test/resources/docker-compose-ci.yml @@ -0,0 +1,55 @@ +version: '3.7' +services: + postgres-case-it: + container_name: postgres-case-it + image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/ssdc-rm-dev-common-postgres:latest + command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] + ports: + - "16432:5432" + network_mode: cloudbuild + + uac-qid-case-it: + container_name: uac-qid-case-it + image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/ssdc-rm-uac-qid-service:latest + ports: + - "18164:8164" + external_links: + - postgres-case-it + environment: + - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres-case-it:5432/postgres?sslmode=disable + - SPRING_PROFILES_ACTIVE=dev + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8164/actuator/health"] + interval: 30s + timeout: 10s + retries: 10 + network_mode: cloudbuild + + pubsub-emulator-case-it: + container_name: pubsub-emulator-case-it + image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest + ports: + - "18538:8538" + network_mode: cloudbuild + + setup-pubsub-emulator-case-it: + container_name: setup-pubsub-emulator-case-it + image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest + environment: + - PUBSUB_SETUP_HOST=pubsub-emulator-case-it:8538 + volumes: + - ./setup_pubsub.sh:/setup_pubsub.sh + depends_on: + - pubsub-emulator-case-it + entrypoint: sh -c "/setup_pubsub.sh" + + start_dependencies: + image: dadarek/wait-for-dependencies + depends_on: + uac-qid-case-it: + condition: service_healthy + +networks: + default: + external: + name: cloudbuild \ No newline at end of file diff --git a/src/test/resources/docker-compose.yml b/src/test/resources/docker-compose.yml index c9127de3..5323866b 100644 --- a/src/test/resources/docker-compose.yml +++ b/src/test/resources/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.7' +version: '2.1' services: postgres-case-it: container_name: postgres-case-it @@ -6,7 +6,6 @@ services: command: ["-c", "shared_buffers=256MB", "-c", "max_connections=500"] ports: - "16432:5432" - network_mode: cloudbuild uac-qid-case-it: container_name: uac-qid-case-it @@ -23,14 +22,12 @@ services: interval: 30s timeout: 10s retries: 10 - network_mode: cloudbuild pubsub-emulator-case-it: container_name: pubsub-emulator-case-it image: europe-west2-docker.pkg.dev/ssdc-rm-ci/docker/gcloud-pubsub-emulator:latest ports: - "18538:8538" - network_mode: cloudbuild setup-pubsub-emulator-case-it: container_name: setup-pubsub-emulator-case-it @@ -52,4 +49,4 @@ services: networks: default: external: - name: cloudbuild \ No newline at end of file + name: ssdcrmdockerdev_default From a9cbb6406345fd74380796b17be8ae0036de8297 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 11:25:03 +0100 Subject: [PATCH 32/51] Added codecov checks --- cloudbuild.yml | 6 +++++- codecov_checks.sh | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 codecov_checks.sh diff --git a/cloudbuild.yml b/cloudbuild.yml index 3095313b..f87eef35 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -8,4 +8,8 @@ steps: args: ['-f', '/workspace/src/test/resources/docker-compose-ci.yml', 'up', '-d'] - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci' ] \ No newline at end of file + args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci' ] + - name: gcr.io/cloud-builders/curl + entrypoint: bash + args: + - './codecov_checks.sh' \ No newline at end of file diff --git a/codecov_checks.sh b/codecov_checks.sh new file mode 100755 index 00000000..1833fb9c --- /dev/null +++ b/codecov_checks.sh @@ -0,0 +1,11 @@ +gpg --no-default-keyring --keyring trustedkeys.gpg --import codecov_public_key.asc +curl -Os https://uploader.codecov.io/latest/linux/codecov +curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM +curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + + # NOTE: the "|| exit 1"'s are required to stop travis continuing to run subsequent steps even if the integrity checks failed +gpgv codecov.SHA256SUM.sig codecov.SHA256SUM || exit 1 +shasum -a 256 -c codecov.SHA256SUM || exit 1 + +chmod +x codecov +./codecov \ No newline at end of file From a674629d3be08107665dfc68e4ea4dfdb23b5ec8 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 11:30:57 +0100 Subject: [PATCH 33/51] Trigger cloud build From b740b49d7e6b82642ed6643eb241d42c790ef1ae Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 11:32:35 +0100 Subject: [PATCH 34/51] Trigger cloud build again From 617d6d4ce3e02327cd2bd904bf3298248f5a3ddd Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 11:46:09 +0100 Subject: [PATCH 35/51] Install gpg in codecov script --- .travis.yml | 2 +- codecov_checks.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 780ddd76..75b07bb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_install: install: echo "SKIPPING DEFAULT INSTALL" # Travis has a default maven install. Don't build twice! -script: travis_wait mvn verify jacoco:report +script: travis_wait mvn verify jacoco:report Dspring.profiles.active=test after_success: - gpg --no-default-keyring --keyring trustedkeys.gpg --import codecov_public_key.asc diff --git a/codecov_checks.sh b/codecov_checks.sh index 1833fb9c..2b894a42 100755 --- a/codecov_checks.sh +++ b/codecov_checks.sh @@ -1,3 +1,6 @@ +apt-get update +apt-get install -y gnupg +apt-get install -y git gpg --no-default-keyring --keyring trustedkeys.gpg --import codecov_public_key.asc curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM From fccde85abd1ca827eb9526e5f1fb4b4c01171343 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 12:03:21 +0100 Subject: [PATCH 36/51] attempt to get codecov working in cloud build --- .travis.yml | 2 +- codecov_checks.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 75b07bb1..a1bef2c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ before_install: install: echo "SKIPPING DEFAULT INSTALL" # Travis has a default maven install. Don't build twice! -script: travis_wait mvn verify jacoco:report Dspring.profiles.active=test +script: travis_wait mvn verify jacoco:report -Dspring.profiles.active=test after_success: - gpg --no-default-keyring --keyring trustedkeys.gpg --import codecov_public_key.asc diff --git a/codecov_checks.sh b/codecov_checks.sh index 2b894a42..2c7251a1 100755 --- a/codecov_checks.sh +++ b/codecov_checks.sh @@ -1,6 +1,7 @@ apt-get update apt-get install -y gnupg apt-get install -y git +cd ssdc-rm-caseprocessor gpg --no-default-keyring --keyring trustedkeys.gpg --import codecov_public_key.asc curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM From 5de9dc2adf56f304011cf6cba93cd9dc1227b43d Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 12:30:57 +0100 Subject: [PATCH 37/51] pass in branch to codecov --- cloudbuild.yml | 1 + codecov_checks.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index f87eef35..5758ba57 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -12,4 +12,5 @@ steps: - name: gcr.io/cloud-builders/curl entrypoint: bash args: + - 'ls' - './codecov_checks.sh' \ No newline at end of file diff --git a/codecov_checks.sh b/codecov_checks.sh index 2c7251a1..4980f479 100755 --- a/codecov_checks.sh +++ b/codecov_checks.sh @@ -1,7 +1,7 @@ +ls apt-get update apt-get install -y gnupg apt-get install -y git -cd ssdc-rm-caseprocessor gpg --no-default-keyring --keyring trustedkeys.gpg --import codecov_public_key.asc curl -Os https://uploader.codecov.io/latest/linux/codecov curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM @@ -12,4 +12,4 @@ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM || exit 1 shasum -a 256 -c codecov.SHA256SUM || exit 1 chmod +x codecov -./codecov \ No newline at end of file +./codecov -B $BRANCH_NAME \ No newline at end of file From 4e1c99171e87a713742ae6f15ffdb0277eb5d827 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 12:42:39 +0100 Subject: [PATCH 38/51] Fix step --- cloudbuild.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 5758ba57..f87eef35 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -12,5 +12,4 @@ steps: - name: gcr.io/cloud-builders/curl entrypoint: bash args: - - 'ls' - './codecov_checks.sh' \ No newline at end of file From b5574cb46a91b791ad7028530de68409c890b25f Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 13:32:52 +0100 Subject: [PATCH 39/51] attempting to get codecov working --- codecov_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov_checks.sh b/codecov_checks.sh index 4980f479..5020bb17 100755 --- a/codecov_checks.sh +++ b/codecov_checks.sh @@ -12,4 +12,4 @@ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM || exit 1 shasum -a 256 -c codecov.SHA256SUM || exit 1 chmod +x codecov -./codecov -B $BRANCH_NAME \ No newline at end of file +./codecov -B $_HEAD_BRANCH -P $_PR_NUMBER \ No newline at end of file From 72251859abb894e50253f4fc026d8a2e361d2903 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 14:16:34 +0100 Subject: [PATCH 40/51] trying again --- codecov_checks.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codecov_checks.sh b/codecov_checks.sh index 5020bb17..41a96292 100755 --- a/codecov_checks.sh +++ b/codecov_checks.sh @@ -1,4 +1,6 @@ ls +echo $_HEAD_BRANCH +echo $_PR_NUMBER apt-get update apt-get install -y gnupg apt-get install -y git @@ -12,4 +14,4 @@ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM || exit 1 shasum -a 256 -c codecov.SHA256SUM || exit 1 chmod +x codecov -./codecov -B $_HEAD_BRANCH -P $_PR_NUMBER \ No newline at end of file +./codecov -C $COMMIT_SHA -r "ONSdigital/ssdc-rm-caseprocessor" \ No newline at end of file From ce8b1e0ce446191337d5eff40d0cc2150c82ac0e Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 14:29:10 +0100 Subject: [PATCH 41/51] Attempting to pass in sha --- codecov_checks.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codecov_checks.sh b/codecov_checks.sh index 41a96292..e44b27b6 100755 --- a/codecov_checks.sh +++ b/codecov_checks.sh @@ -14,4 +14,6 @@ gpgv codecov.SHA256SUM.sig codecov.SHA256SUM || exit 1 shasum -a 256 -c codecov.SHA256SUM || exit 1 chmod +x codecov -./codecov -C $COMMIT_SHA -r "ONSdigital/ssdc-rm-caseprocessor" \ No newline at end of file +COMMIT_SHA_LONG = $COMMIT_SHA +echo $COMMIT_SHA_LONG +./codecov -C $COMMIT_SHA_LONG -r "ONSdigital/ssdc-rm-caseprocessor \ No newline at end of file From e759ad2134ac4b48a8da9095b55aebbe8433f9a9 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 14:34:30 +0100 Subject: [PATCH 42/51] try inline command --- cloudbuild.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index f87eef35..28a63f26 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -12,4 +12,21 @@ steps: - name: gcr.io/cloud-builders/curl entrypoint: bash args: - - './codecov_checks.sh' \ No newline at end of file + - '-eEuo' + - 'pipefail' + - '-c' + - |- + apt-get update + apt-get install -y gnupg + apt-get install -y git + gpg --no-default-keyring --keyring trustedkeys.gpg --import codecov_public_key.asc + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + + # NOTE: the "|| exit 1"'s are required to stop travis continuing to run subsequent steps even if the integrity checks failed + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM || exit 1 + shasum -a 256 -c codecov.SHA256SUM || exit 1 + + chmod +x codecov + ./codecov -C $COMMIT_SHA -r "ONSdigital/ssdc-rm-caseprocessor" \ No newline at end of file From 601e7fb05e28eb9b2b5f7a6c24e140ce6bedbc32 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 14:46:53 +0100 Subject: [PATCH 43/51] for my boy cloud build --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 28a63f26..7e529f69 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -29,4 +29,4 @@ steps: shasum -a 256 -c codecov.SHA256SUM || exit 1 chmod +x codecov - ./codecov -C $COMMIT_SHA -r "ONSdigital/ssdc-rm-caseprocessor" \ No newline at end of file + ./codecov -C $COMMIT_SHA -B $BRANCH_NAME -r "ONSdigital/ssdc-rm-caseprocessor" \ No newline at end of file From 16f109ae40544745a65f36620f80dfd08da9e840 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Wed, 27 Apr 2022 15:07:33 +0100 Subject: [PATCH 44/51] pass in PR number --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 7e529f69..da8cb1f1 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -29,4 +29,4 @@ steps: shasum -a 256 -c codecov.SHA256SUM || exit 1 chmod +x codecov - ./codecov -C $COMMIT_SHA -B $BRANCH_NAME -r "ONSdigital/ssdc-rm-caseprocessor" \ No newline at end of file + ./codecov -C $COMMIT_SHA -B $BRANCH_NAME -r "ONSdigital/ssdc-rm-caseprocessor" -P $_PR_NUMBER \ No newline at end of file From 4b43168cf5b9657864891bd5233b1fe07a7a165d Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 28 Apr 2022 16:00:48 +0100 Subject: [PATCH 45/51] Add token to codecov --- cloudbuild.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index da8cb1f1..edb1b518 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -11,6 +11,7 @@ steps: args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci' ] - name: gcr.io/cloud-builders/curl entrypoint: bash + secretEnv: [ CODECOV_TOKEN_CP ] args: - '-eEuo' - 'pipefail' @@ -29,4 +30,9 @@ steps: shasum -a 256 -c codecov.SHA256SUM || exit 1 chmod +x codecov - ./codecov -C $COMMIT_SHA -B $BRANCH_NAME -r "ONSdigital/ssdc-rm-caseprocessor" -P $_PR_NUMBER \ No newline at end of file + ./codecov -t $$CODECOV_TOKEN_CP -C $COMMIT_SHA -B $BRANCH_NAME -r "ONSdigital/ssdc-rm-caseprocessor" -P $_PR_NUMBER + +availableSecrets: + secretManager: + - versionName: projects/$PROJECT_ID/secrets/codecov-token-case-processor/versions/1 + env: CODECOV_TOKEN_CP \ No newline at end of file From 9da4f48a7d1dca41e43ca3ef29eb6a2ee6ca40f2 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 28 Apr 2022 16:01:57 +0100 Subject: [PATCH 46/51] Trigger cloud build From 4c9dacaf725cbbd8f9d2c0c001829e488ab3f884 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Thu, 28 Apr 2022 16:03:14 +0100 Subject: [PATCH 47/51] Use project number --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index edb1b518..2c0a3e14 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -34,5 +34,5 @@ steps: availableSecrets: secretManager: - - versionName: projects/$PROJECT_ID/secrets/codecov-token-case-processor/versions/1 + - versionName: projects/$PROJECT_NUMBER/secrets/codecov-token-case-processor/versions/1 env: CODECOV_TOKEN_CP \ No newline at end of file From c7dd5cb9dd6e48527ec947f5fb89c47f1df4af5b Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 3 May 2022 09:23:46 +0100 Subject: [PATCH 48/51] Update step image and show no transfer progress --- cloudbuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 2c0a3e14..404b7822 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -1,5 +1,5 @@ steps: - - name: maven + - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn args: [ 'fmt:check','pmd:check' ] id: mvn-format @@ -8,7 +8,7 @@ steps: args: ['-f', '/workspace/src/test/resources/docker-compose-ci.yml', 'up', '-d'] - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci' ] + args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci', '--no-transfer-progress' ] - name: gcr.io/cloud-builders/curl entrypoint: bash secretEnv: [ CODECOV_TOKEN_CP ] From 91c0b70af5d8f5696da2bad2affea78636f243fa Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 3 May 2022 09:26:54 +0100 Subject: [PATCH 49/51] No progress on formatt check --- cloudbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index 404b7822..da2d4ecf 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -1,7 +1,7 @@ steps: - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'fmt:check','pmd:check' ] + args: [ 'fmt:check','pmd:check', '--no-transfer-progress' ] id: mvn-format - id: docker-compose name: 'docker/compose:1.29.0' From 362829c9d07d89e5b4ded046a90bfd1a68b328c7 Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 3 May 2022 09:42:28 +0100 Subject: [PATCH 50/51] Attempting build with batch mode enabled --- cloudbuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index da2d4ecf..a5b126ec 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -1,14 +1,14 @@ steps: - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'fmt:check','pmd:check', '--no-transfer-progress' ] + args: [ 'fmt:check','pmd:check', '-B' ] id: mvn-format - id: docker-compose name: 'docker/compose:1.29.0' args: ['-f', '/workspace/src/test/resources/docker-compose-ci.yml', 'up', '-d'] - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci', '--no-transfer-progress' ] + args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci', '-B' ] - name: gcr.io/cloud-builders/curl entrypoint: bash secretEnv: [ CODECOV_TOKEN_CP ] From e5138f9bcff25f79491625c9731d92be930bc62f Mon Sep 17 00:00:00 2001 From: Ryan Grundy Date: Tue, 3 May 2022 09:52:28 +0100 Subject: [PATCH 51/51] Cloud build run with batch and no transfer progress --- cloudbuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild.yml b/cloudbuild.yml index a5b126ec..4591e065 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -1,14 +1,14 @@ steps: - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'fmt:check','pmd:check', '-B' ] + args: [ 'fmt:check','pmd:check', '--no-transfer-progress', '-B' ] id: mvn-format - id: docker-compose name: 'docker/compose:1.29.0' args: ['-f', '/workspace/src/test/resources/docker-compose-ci.yml', 'up', '-d'] - name: maven:3.8.3-openjdk-17-slim entrypoint: mvn - args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci', '-B' ] + args: [ 'verify','jacoco:report', '-DdockerCompose.skip=true', '-Dspring.profiles.active=test-ci', '--no-transfer-progress', '-B' ] - name: gcr.io/cloud-builders/curl entrypoint: bash secretEnv: [ CODECOV_TOKEN_CP ]