From 7a124fac298fc27be558c2381452e70f719bb6bd Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:17:30 -0400 Subject: [PATCH 01/11] ci 1 --- .github/workflows/integration-test.yaml | 82 +++++++++++++++++++++++++ .github/workflows/test.yaml | 38 ++---------- 2 files changed, 88 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/integration-test.yaml diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml new file mode 100644 index 000000000..6dae9300a --- /dev/null +++ b/.github/workflows/integration-test.yaml @@ -0,0 +1,82 @@ +name: Integration Tests + +on: + # if pushed directly to the master + push: + branches: + - master + - release/* + # on a pull request + pull_request: + branches: + - master + - release/* +jobs: + redis-cache: + name: Cache with Redis + runs-on: ubuntu-latest + # Docker Hub image that `container-job` executes in. + # Use -buster which comes with Git 2.20, because action/checkout needs Git 2.18+ to make correct clone (needed by Gradle version plugin) + container: node:12-buster + services: + redis: + image: redis + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Check + uses: eskatos/gradle-command-action@v1 + with: + arguments: check + env: + DSHACKLE_TEST_ENABLED: redis + REDIS_HOST: redis + REDIS_PORT: 6379 + + + fake-upstream: + name: Test with fake upstream + runs-on: ubuntu-latest + # Use -buster which comes with Git 2.20, because action/checkout needs Git 2.18+ to make correct clone (needed by Gradle version plugin) + container: node:12-buster + services: + fake-upstream: + image: openjdk:11 + volumes: + ${{ github.workspace }}/testing/simple-upstream:/opt/app + options: + workdir: /opt/app + entrypoint: gradlew run + dshackle: + image: openjdk:11 + volumes: + ${{ github.workspace }}:/opt/app + env: + SPRING_APPLICATION_JSON: '{"configPath":"testing/dshackle/dshackle.yaml"}' + options: + workdir: /opt/app + entrypoint: gradlew run + + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: 11 + + - name: Run trial + uses: eskatos/gradle-command-action@v1 + with: + arguments: test + build-root-directory: ${{ github.workspace }}/testing/trial \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 94e7ab189..6361cc0a4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,11 +5,15 @@ on: push: branches: - master + - release/* # on a pull request pull_request: - + branches: + - master + - release/* jobs: unit-test: + name: Unit Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -27,34 +31,4 @@ jobs: - name: Upload Coverage Report uses: codecov/codecov-action@v1 with: - file: ./build/reports/jacoco/test/jacocoTestReport.xml - - integration-test: - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in. - # Use -buster which comes with Git 2.20, because action/checkout needs Git 2.18+ to make correct clone (needed by Gradle version plugin) - container: node:12-buster - services: - redis: - image: redis - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v2 - - - name: Set up JDK - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: Check - uses: eskatos/gradle-command-action@v1 - with: - arguments: check - env: - DSHACKLE_TEST_ENABLED: redis - REDIS_HOST: redis - REDIS_PORT: 6379 \ No newline at end of file + file: ./build/reports/jacoco/test/jacocoTestReport.xml \ No newline at end of file From 42c89b6becc6b461389ffbe75f81c80ce190e14a Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:21:32 -0400 Subject: [PATCH 02/11] ci 2 --- .github/workflows/integration-test.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 6dae9300a..52be8d20b 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -50,22 +50,20 @@ jobs: # Use -buster which comes with Git 2.20, because action/checkout needs Git 2.18+ to make correct clone (needed by Gradle version plugin) container: node:12-buster services: + fake-upstream: image: openjdk:11 volumes: ${{ github.workspace }}/testing/simple-upstream:/opt/app - options: - workdir: /opt/app - entrypoint: gradlew run + options: "--workdir: /opt/app entrypoint: gradlew run" + dshackle: image: openjdk:11 volumes: ${{ github.workspace }}:/opt/app env: SPRING_APPLICATION_JSON: '{"configPath":"testing/dshackle/dshackle.yaml"}' - options: - workdir: /opt/app - entrypoint: gradlew run + options: "--workdir: /opt/app entrypoint: gradlew run" steps: - uses: actions/checkout@v2 From 251b1786d37ee7a158abc4e741249d517f21ceb0 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:22:16 -0400 Subject: [PATCH 03/11] ci 3 --- .github/workflows/integration-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 52be8d20b..2f915cbac 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -77,4 +77,4 @@ jobs: uses: eskatos/gradle-command-action@v1 with: arguments: test - build-root-directory: ${{ github.workspace }}/testing/trial \ No newline at end of file + build-root-directory: ${{ github.workspace }}/testing/trial \ No newline at end of file From 6db993d064ea57e64a2cf725223895c205cf385c Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:24:23 -0400 Subject: [PATCH 04/11] ci 4 --- .github/workflows/integration-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 2f915cbac..e120adfa5 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -54,13 +54,13 @@ jobs: fake-upstream: image: openjdk:11 volumes: - ${{ github.workspace }}/testing/simple-upstream:/opt/app + - ${{ github.workspace }}/testing/simple-upstream:/opt/app options: "--workdir: /opt/app entrypoint: gradlew run" dshackle: image: openjdk:11 volumes: - ${{ github.workspace }}:/opt/app + - ${{ github.workspace }}:/opt/app env: SPRING_APPLICATION_JSON: '{"configPath":"testing/dshackle/dshackle.yaml"}' options: "--workdir: /opt/app entrypoint: gradlew run" From 2399986e362a0922de5327a1878724283bebc98b Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:27:13 -0400 Subject: [PATCH 05/11] ci 5 --- .github/workflows/integration-test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index e120adfa5..908535c9a 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -55,7 +55,9 @@ jobs: image: openjdk:11 volumes: - ${{ github.workspace }}/testing/simple-upstream:/opt/app - options: "--workdir: /opt/app entrypoint: gradlew run" + options: + - "--workdir /opt/app" + - "--entrypoint /opt/app/gradlew run" dshackle: image: openjdk:11 @@ -63,7 +65,7 @@ jobs: - ${{ github.workspace }}:/opt/app env: SPRING_APPLICATION_JSON: '{"configPath":"testing/dshackle/dshackle.yaml"}' - options: "--workdir: /opt/app entrypoint: gradlew run" + options: "--workdir /opt/app --entrypoint /opt/app/gradlew run" steps: - uses: actions/checkout@v2 From a588312f23aa00da499441ffd2a9733430468f94 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:27:55 -0400 Subject: [PATCH 06/11] ci 6 --- .github/workflows/integration-test.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 908535c9a..c0b1398c2 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -55,9 +55,7 @@ jobs: image: openjdk:11 volumes: - ${{ github.workspace }}/testing/simple-upstream:/opt/app - options: - - "--workdir /opt/app" - - "--entrypoint /opt/app/gradlew run" + options: "--workdir /opt/app --entrypoint /opt/app/gradlew run" dshackle: image: openjdk:11 From 07bd7e67282b8f19fb846c3d6feb498b09f400b7 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:30:05 -0400 Subject: [PATCH 07/11] ci 7 --- .github/workflows/integration-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index c0b1398c2..cbd861f78 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -55,7 +55,7 @@ jobs: image: openjdk:11 volumes: - ${{ github.workspace }}/testing/simple-upstream:/opt/app - options: "--workdir /opt/app --entrypoint /opt/app/gradlew run" + options: "--workdir /opt/app --entrypoint '/opt/app/gradlew run'" dshackle: image: openjdk:11 @@ -63,7 +63,7 @@ jobs: - ${{ github.workspace }}:/opt/app env: SPRING_APPLICATION_JSON: '{"configPath":"testing/dshackle/dshackle.yaml"}' - options: "--workdir /opt/app --entrypoint /opt/app/gradlew run" + options: "--workdir /opt/app --entrypoint '/opt/app/gradlew run'" steps: - uses: actions/checkout@v2 From 437bbb769f6aeb613a2b7033aaaeb40ed2984ed4 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:46:36 -0400 Subject: [PATCH 08/11] ci 8 --- .github/workflows/integration-test.yaml | 4 +++- testing/dshackle/start.sh | 8 ++++++++ testing/simple-upstream/start.sh | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 testing/dshackle/start.sh create mode 100644 testing/simple-upstream/start.sh diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index cbd861f78..6bdf258c5 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -55,7 +55,9 @@ jobs: image: openjdk:11 volumes: - ${{ github.workspace }}/testing/simple-upstream:/opt/app - options: "--workdir /opt/app --entrypoint '/opt/app/gradlew run'" + options: >- + --workdir /opt/app + --entrypoint '/opt/app/start.sh' dshackle: image: openjdk:11 diff --git a/testing/dshackle/start.sh b/testing/dshackle/start.sh new file mode 100644 index 000000000..9fcca85c4 --- /dev/null +++ b/testing/dshackle/start.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +set -e + +cd ../.. + +export SPRING_APPLICATION_JSON='{"configPath": "testing/dshackle/dshackle.yaml"}' +./gradlew run \ No newline at end of file diff --git a/testing/simple-upstream/start.sh b/testing/simple-upstream/start.sh new file mode 100644 index 000000000..6e93fcfef --- /dev/null +++ b/testing/simple-upstream/start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +set -e + +./gradlew run \ No newline at end of file From 113fb2dec504a9b0ca60f4993b3b0deaba46077f Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:50:56 -0400 Subject: [PATCH 09/11] ci 9 --- testing/dshackle/start.sh | 2 -- testing/simple-upstream/start.sh | 1 - 2 files changed, 3 deletions(-) mode change 100644 => 100755 testing/dshackle/start.sh mode change 100644 => 100755 testing/simple-upstream/start.sh diff --git a/testing/dshackle/start.sh b/testing/dshackle/start.sh old mode 100644 new mode 100755 index 9fcca85c4..93b1bd3fe --- a/testing/dshackle/start.sh +++ b/testing/dshackle/start.sh @@ -1,8 +1,6 @@ #!/usr/bin/env sh set -e - cd ../.. - export SPRING_APPLICATION_JSON='{"configPath": "testing/dshackle/dshackle.yaml"}' ./gradlew run \ No newline at end of file diff --git a/testing/simple-upstream/start.sh b/testing/simple-upstream/start.sh old mode 100644 new mode 100755 index 6e93fcfef..314003601 --- a/testing/simple-upstream/start.sh +++ b/testing/simple-upstream/start.sh @@ -1,5 +1,4 @@ #!/usr/bin/env sh set -e - ./gradlew run \ No newline at end of file From c0baed2f5cf1272755fef989de1bc56dcca6188d Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Mon, 17 Aug 2020 23:55:44 -0400 Subject: [PATCH 10/11] ci 10 --- .github/workflows/integration-test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 6bdf258c5..10c061eb1 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -57,15 +57,15 @@ jobs: - ${{ github.workspace }}/testing/simple-upstream:/opt/app options: >- --workdir /opt/app - --entrypoint '/opt/app/start.sh' + --entrypoint /opt/app/start.sh dshackle: image: openjdk:11 volumes: - ${{ github.workspace }}:/opt/app - env: - SPRING_APPLICATION_JSON: '{"configPath":"testing/dshackle/dshackle.yaml"}' - options: "--workdir /opt/app --entrypoint '/opt/app/gradlew run'" + options: >- + --workdir /opt/app + --entrypoint /opt/app/testing/dshackle/start.sh steps: - uses: actions/checkout@v2 From e5ab160d21a4208cfc92bb8fb2fad5e396f5cf03 Mon Sep 17 00:00:00 2001 From: Igor Artamonov Date: Tue, 18 Aug 2020 00:02:06 -0400 Subject: [PATCH 11/11] ci 11 --- .github/workflows/integration-test.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 10c061eb1..f365e5728 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -54,18 +54,18 @@ jobs: fake-upstream: image: openjdk:11 volumes: - - ${{ github.workspace }}/testing/simple-upstream:/opt/app + - ${{ github.workspace }}/testing/simple-upstream:/app options: >- - --workdir /opt/app - --entrypoint /opt/app/start.sh + --workdir /app + --entrypoint /app/start.sh dshackle: image: openjdk:11 volumes: - - ${{ github.workspace }}:/opt/app + - ${{ github.workspace }}:/app options: >- - --workdir /opt/app - --entrypoint /opt/app/testing/dshackle/start.sh + --workdir /app + --entrypoint /app/testing/dshackle/start.sh steps: - uses: actions/checkout@v2