From f4cbb6542a90a8aee250036259e1c8079cfd4aad Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 15 Apr 2024 15:32:16 -0300 Subject: [PATCH 1/7] Add support for GS64 3.7.1 --- .github/workflows/docker-build.yml | 9 ++++----- .github/workflows/integration-tests-gs64.yml | 9 +++++++++ .github/workflows/loading-gs64-components.yml | 20 +++++++++++++++++-- .github/workflows/unit-tests-gs64.yml | 14 +++++++++++-- .smalltalkci/.loading.deployment.ston | 3 ++- .smalltalkci/.loading.development.ston | 3 ++- .smalltalkci/.loading.examples.ston | 3 ++- .smalltalkci/.loading.tools.ston | 3 ++- .smalltalkci/.unit-tests.ston | 3 ++- README.md | 1 + api-tests/gs64/docker-compose.yml | 4 ++-- compose-test-gs64.sh | 13 ++++++------ docker/{gs64 => gs64-3.7.0}/Dockerfile | 2 +- docker/gs64-3.7.1/Dockerfile | 2 ++ 14 files changed, 66 insertions(+), 23 deletions(-) rename docker/{gs64 => gs64-3.7.0}/Dockerfile (56%) create mode 100644 docker/gs64-3.7.1/Dockerfile diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b639b64..2335a8f 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -7,7 +7,6 @@ on: tags: - 'v*.*.*' pull_request: - jobs: build_and_publish: runs-on: ubuntu-latest @@ -19,20 +18,20 @@ jobs: fetch-depth: 2 - name: Docker meta id: docker_meta - uses: crazy-max/ghaction-docker-meta@v4 + uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository_owner }}/stargate-consul-example - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to Container Registry if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} - name: Docker build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: ./ file: ./docker/pharo/Dockerfile diff --git a/.github/workflows/integration-tests-gs64.yml b/.github/workflows/integration-tests-gs64.yml index 4e50d27..93130a9 100644 --- a/.github/workflows/integration-tests-gs64.yml +++ b/.github/workflows/integration-tests-gs64.yml @@ -6,6 +6,12 @@ on: jobs: integration-tests: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: + - "3.7.0" + - "3.7.1" name: Integration Tests GS64 steps: - uses: actions/checkout@v4 @@ -14,10 +20,13 @@ jobs: - name: Configure keyfile run: | echo "$GS_KEYFILE" > ./api-tests/gs64/gemstone.key + echo "GS_VERSION=${{ matrix.version }}" > ./api-tests/gs64/.env env: GS_KEYFILE: ${{ secrets.GS_KEYFILE }} - name: Run GS64 tests using Docker run: ./compose-test-gs64.sh + env: + GS_VERSION: ${{ matrix.version }} - name: Remove keyfile if: always() run: rm -f ./api-tests/gs64/gemstone.key diff --git a/.github/workflows/loading-gs64-components.yml b/.github/workflows/loading-gs64-components.yml index 7052b81..e6cbb6a 100644 --- a/.github/workflows/loading-gs64-components.yml +++ b/.github/workflows/loading-gs64-components.yml @@ -4,7 +4,7 @@ on: - pull_request - workflow_dispatch jobs: - component-loading: + component-loading-3_7_0: runs-on: ubuntu-latest strategy: fail-fast: false @@ -12,7 +12,7 @@ jobs: load-spec: - Deployment - Examples - name: GS64 + ${{ matrix.load-spec }} + name: GS64 v3.7.0 + ${{ matrix.load-spec }} steps: - uses: actions/checkout@v4 - name: Load component in image @@ -20,3 +20,19 @@ jobs: with: project_name: 'Stargate-Consul' load_spec: 'Stargate-Consul-${{ matrix.load-spec }}' + component-loading-3_7_1: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + load-spec: + - Deployment + - Examples + name: GS64 v3.7.1 + ${{ matrix.load-spec }} + steps: + - uses: actions/checkout@v4 + - name: Load component in image + uses: ba-st-actions/gs64-ci@v3 + with: + project_name: 'Stargate-Consul' + load_spec: 'Stargate-Consul-${{ matrix.load-spec }}' diff --git a/.github/workflows/unit-tests-gs64.yml b/.github/workflows/unit-tests-gs64.yml index dfae312..5090d39 100644 --- a/.github/workflows/unit-tests-gs64.yml +++ b/.github/workflows/unit-tests-gs64.yml @@ -4,9 +4,9 @@ on: - pull_request - workflow_dispatch jobs: - unit-tests: + unit-tests-3_7_0: runs-on: ubuntu-latest - name: GS64 Unit Tests + name: GS64 v3.7.0 Unit Tests steps: - uses: actions/checkout@v4 - name: Load Image and Run Tests @@ -14,3 +14,13 @@ jobs: with: project_name: 'Stargate-Consul' run_tests: 'true' + unit-tests-3_7_1: + runs-on: ubuntu-latest + name: GS64 v3.7.1 Unit Tests + steps: + - uses: actions/checkout@v4 + - name: Load Image and Run Tests + uses: ba-st-actions/gs64-ci@v3 + with: + project_name: 'Stargate-Consul' + run_tests: 'true' diff --git a/.smalltalkci/.loading.deployment.ston b/.smalltalkci/.loading.deployment.ston index 6bdeaeb..e9e3aa2 100644 --- a/.smalltalkci/.loading.deployment.ston +++ b/.smalltalkci/.loading.deployment.ston @@ -4,7 +4,8 @@ SmalltalkCISpec { #baseline : 'StargateConsul', #directory : '../source', #load : [ 'Deployment' ], - #platforms : [ #pharo ] + #platforms : [ #pharo ], + #failOn : [ #Warning ] } ], #testing : { diff --git a/.smalltalkci/.loading.development.ston b/.smalltalkci/.loading.development.ston index 4c16924..0c42483 100644 --- a/.smalltalkci/.loading.development.ston +++ b/.smalltalkci/.loading.development.ston @@ -4,7 +4,8 @@ SmalltalkCISpec { #baseline : 'StargateConsul', #directory : '../source', #load : [ 'Development' ], - #platforms : [ #pharo ] + #platforms : [ #pharo ], + #failOn : [ #Warning ] } ], #testing : { diff --git a/.smalltalkci/.loading.examples.ston b/.smalltalkci/.loading.examples.ston index 65c54fe..e1d9b9b 100644 --- a/.smalltalkci/.loading.examples.ston +++ b/.smalltalkci/.loading.examples.ston @@ -4,7 +4,8 @@ SmalltalkCISpec { #baseline : 'StargateConsul', #directory : '../source', #load : [ 'Examples' ], - #platforms : [ #pharo ] + #platforms : [ #pharo ], + #failOn : [ #Warning ] } ], #testing : { diff --git a/.smalltalkci/.loading.tools.ston b/.smalltalkci/.loading.tools.ston index c930c20..796b8d9 100644 --- a/.smalltalkci/.loading.tools.ston +++ b/.smalltalkci/.loading.tools.ston @@ -4,7 +4,8 @@ SmalltalkCISpec { #baseline : 'StargateConsul', #directory : '../source', #load : [ 'Tools' ], - #platforms : [ #pharo ] + #platforms : [ #pharo ], + #failOn : [ #Warning ] } ], #testing : { diff --git a/.smalltalkci/.unit-tests.ston b/.smalltalkci/.unit-tests.ston index 961ac9a..e957a99 100644 --- a/.smalltalkci/.unit-tests.ston +++ b/.smalltalkci/.unit-tests.ston @@ -4,7 +4,8 @@ SmalltalkCISpec { #baseline : 'StargateConsul', #directory : '../source', #load : [ 'CI' ], - #platforms : [ #pharo ] + #platforms : [ #pharo ], + #failOn : [ #Warning ] } ], #testing : { diff --git a/README.md b/README.md index 65734d8..9e53764 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ plugin to interact with the [Consul](https://www.consul.io) HTTP API. [![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org) [![GS64 3.7.0](https://img.shields.io/badge/GS64-3.7.0-informational)](https://gemtalksystems.com/products/gs64/) +[![GS64 3.7.1](https://img.shields.io/badge/GS64-3.7.1-informational)](https://gemtalksystems.com/products/gs64/) Quick links diff --git a/api-tests/gs64/docker-compose.yml b/api-tests/gs64/docker-compose.yml index fbd895b..1a83b24 100644 --- a/api-tests/gs64/docker-compose.yml +++ b/api-tests/gs64/docker-compose.yml @@ -3,7 +3,7 @@ services: api: build: context: ../../ - dockerfile: docker/gs64/Dockerfile + dockerfile: docker/gs64-${GS64_VERSION}/Dockerfile cap_add: - CAP_SYS_RESOURCE ports: @@ -23,7 +23,7 @@ services: - stone stone: init: true - image: ghcr.io/ba-st/gs64-rowan:v3.7.0 + image: ghcr.io/ba-st/gs64-rowan:v${GS64_VERSION} cap_add: - CAP_SYS_RESOURCE environment: diff --git a/compose-test-gs64.sh b/compose-test-gs64.sh index 8de43c9..9e8d490 100755 --- a/compose-test-gs64.sh +++ b/compose-test-gs64.sh @@ -2,17 +2,18 @@ set -e +readonly GS64_COMPOSE_FILE="api-tests/gs64/docker-compose.yml" echo "Building API" -docker compose -f api-tests/gs64/docker-compose.yml build api +docker compose -f "$GS64_COMPOSE_FILE" build api echo "Starting Stone" -docker compose -f api-tests/gs64/docker-compose.yml up -d stone +docker compose -f "$GS64_COMPOSE_FILE" up -d stone echo "Starting Consul Agent" -docker compose -f api-tests/gs64/docker-compose.yml up -d consul-agent +docker compose -f "$GS64_COMPOSE_FILE" up -d consul-agent sleep 2 echo "Installing support code" docker exec -i -u gemstone gs64-stone-1 ./load-rowan-project.sh Stargate-Consul Stargate-Consul-Examples echo "Starting API" -docker compose -f api-tests/gs64/docker-compose.yml up -d api +docker compose -f "$GS64_COMPOSE_FILE" up -d api sleep 10 echo "Testing API" curl --fail http://localhost:8080/echo/hello @@ -22,7 +23,7 @@ HEALTH_STATUS=$(curl -s http://localhost:8500/v1/health/checks/echo | jq '.[0].S echo "$HEALTH_STATUS" if [ "$HEALTH_STATUS" != '"passing"' ]; then echo "Error: Echo service is unhealthy" >&2 - docker compose -f api-tests/gs64/docker-compose.yml down + docker compose -f "$GS64_COMPOSE_FILE" down exit 1 fi -docker compose -f api-tests/gs64/docker-compose.yml down +docker compose -f "$GS64_COMPOSE_FILE" down diff --git a/docker/gs64/Dockerfile b/docker/gs64-3.7.0/Dockerfile similarity index 56% rename from docker/gs64/Dockerfile rename to docker/gs64-3.7.0/Dockerfile index a040a6d..f82dc3d 100644 --- a/docker/gs64/Dockerfile +++ b/docker/gs64-3.7.0/Dockerfile @@ -1,2 +1,2 @@ -FROM ghcr.io/ba-st/launchpad-gs64:v5 +FROM ghcr.io/ba-st/launchpad-gs64-3.7.0:v5 CMD [ "launchpad", "start", "stargate-consul-example" ] diff --git a/docker/gs64-3.7.1/Dockerfile b/docker/gs64-3.7.1/Dockerfile new file mode 100644 index 0000000..b8de124 --- /dev/null +++ b/docker/gs64-3.7.1/Dockerfile @@ -0,0 +1,2 @@ +FROM ghcr.io/ba-st/launchpad-gs64-3.7.1:v5 +CMD [ "launchpad", "start", "stargate-consul-example" ] From 69eb178c7a9238663481a825128002ea5b8ea929 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 15 Apr 2024 15:52:03 -0300 Subject: [PATCH 2/7] Fix test --- ...teConsulEchoRESTfulControllerTest.class.st | 13 +++++----- .../StargateConsulExampleTest.class.st | 25 ++++++++++--------- .../Stargate-Consul-Examples-Tests/package.st | 2 +- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/source/Stargate-Consul-Examples-Tests/StargateConsulEchoRESTfulControllerTest.class.st b/source/Stargate-Consul-Examples-Tests/StargateConsulEchoRESTfulControllerTest.class.st index d3fc316..7db34b3 100644 --- a/source/Stargate-Consul-Examples-Tests/StargateConsulEchoRESTfulControllerTest.class.st +++ b/source/Stargate-Consul-Examples-Tests/StargateConsulEchoRESTfulControllerTest.class.st @@ -1,22 +1,23 @@ Class { - #name : #StargateConsulEchoRESTfulControllerTest, - #superclass : #SingleResourceRESTfulControllerTest, - #category : #'Stargate-Consul-Examples-Tests' + #name : 'StargateConsulEchoRESTfulControllerTest', + #superclass : 'SingleResourceRESTfulControllerTest', + #category : 'Stargate-Consul-Examples-Tests', + #package : 'Stargate-Consul-Examples-Tests' } -{ #category : #'private - support' } +{ #category : 'private - support' } StargateConsulEchoRESTfulControllerTest >> baseUrl [ ^ 'http://api.example.com' asUrl ] -{ #category : #running } +{ #category : 'running' } StargateConsulEchoRESTfulControllerTest >> setUpResourceController [ resourceController := StargateConsulEchoRESTfulController new ] -{ #category : #tests } +{ #category : 'tests' } StargateConsulEchoRESTfulControllerTest >> testMessageText [ | response | diff --git a/source/Stargate-Consul-Examples-Tests/StargateConsulExampleTest.class.st b/source/Stargate-Consul-Examples-Tests/StargateConsulExampleTest.class.st index 38ade5b..1759469 100644 --- a/source/Stargate-Consul-Examples-Tests/StargateConsulExampleTest.class.st +++ b/source/Stargate-Consul-Examples-Tests/StargateConsulExampleTest.class.st @@ -2,22 +2,23 @@ A StargateConsulExampleTest is a test class for testing the behavior of StargateConsulExample " Class { - #name : #StargateConsulExampleTest, - #superclass : #TestCase, + #name : 'StargateConsulExampleTest', + #superclass : 'TestCase', #instVars : [ 'application', 'port' ], - #category : #'Stargate-Consul-Examples-Tests' + #category : 'Stargate-Consul-Examples-Tests', + #package : 'Stargate-Consul-Examples-Tests' } -{ #category : #running } +{ #category : 'running' } StargateConsulExampleTest >> runCase [ self shouldnt: [ super runCase ] raise: Exit ] -{ #category : #running } +{ #category : 'running' } StargateConsulExampleTest >> setUp [ super setUp. @@ -25,7 +26,7 @@ StargateConsulExampleTest >> setUp [ StargateConsulExample logsDirectory ensureCreateDirectory ] -{ #category : #running } +{ #category : 'running' } StargateConsulExampleTest >> start: aLaunchpadApplication withAll: arguments [ String streamContents: [ :stream | @@ -44,14 +45,14 @@ StargateConsulExampleTest >> start: aLaunchpadApplication withAll: arguments [ ] ] -{ #category : #running } +{ #category : 'running' } StargateConsulExampleTest >> tearDown [ application ifNotNil: [ application stop ]. super tearDown ] -{ #category : #tests } +{ #category : 'tests' } StargateConsulExampleTest >> testDefaultServiceDiscoveryTimeSlotBetweenRetries [ self start: StargateConsulExample withAll: { @@ -63,17 +64,17 @@ StargateConsulExampleTest >> testDefaultServiceDiscoveryTimeSlotBetweenRetries [ self assert: application serviceDiscoveryTimeSlotBetweenRetries equals: 100 milliSeconds ] -{ #category : #tests } +{ #category : 'tests' } StargateConsulExampleTest >> testPrintHelpOn [ | help | help := String streamContents: [ :stream | StargateConsulExample printHelpOn: stream ]. - self assert: help equals: ( 'NAMEstargate-consul-example [<1s>] - I provide a RESTful API over HTTPSYNOPSYSstargate-consul-example --stargate.public-url=% --stargate.port=% --stargate.operations-secret=% --stargate.consul-agent-location=% [--stargate.scheme=%]PARAMETERS--stargate.public-url=%Public URL where the API is deployed. Used to create hypermedia links.--stargate.port=%Listening port.--stargate.operations-secret=%Secret key for checking JWT signatures.--stargate.consul-agent-location=%Location of the Consul Agent. Leave empty to disable the plugin.--stargate.scheme=%Transport scheme. It''s used to configure Consul HTTP checks. Defaults to http.ENVIRONMENTSTARGATE__PUBLIC_URLPublic URL where the API is deployed. Used to create hypermedia links.STARGATE__PORTListening port.STARGATE__OPERATIONS_SECRETSecret key for checking JWT signatures.STARGATE__CONSUL_AGENT_LOCATIONLocation of the Consul Agent. Leave empty to disable the plugin.STARGATE__SCHEMETransport scheme. It''s used to configure Consul HTTP checks. Defaults to http.' expandMacrosWith: StargateConsulExample version ) + self assert: help equals: ( 'NAMEstargate-consul-example [<1s>] - I provide a RESTful API over HTTPSYNOPSYSstargate-consul-example --stargate.public-url=% --stargate.port=% --stargate.operations-secret=% [--stargate.concurrent-connections-threshold=%] --stargate.consul-agent-location=% [--stargate.scheme=%]PARAMETERS--stargate.public-url=%Public URL where the API is deployed. Used to create hypermedia links.--stargate.port=%Listening port.--stargate.operations-secret=%Secret key for checking JWT signatures.--stargate.concurrent-connections-threshold=%Set the maximum number of concurrent connections that I will accept. When this threshold is reached, a 503 Service Unavailable response will be sent and the connection will be closed. Defaults to 32.--stargate.consul-agent-location=%Location of the Consul Agent. Leave empty to disable the plugin.--stargate.scheme=%Transport scheme. It''s used to configure Consul HTTP checks. Defaults to http.ENVIRONMENTSTARGATE__PUBLIC_URLPublic URL where the API is deployed. Used to create hypermedia links.STARGATE__PORTListening port.STARGATE__OPERATIONS_SECRETSecret key for checking JWT signatures.STARGATE__CONCURRENT_CONNECTIONS_THRESHOLDSet the maximum number of concurrent connections that I will accept. When this threshold is reached, a 503 Service Unavailable response will be sent and the connection will be closed. Defaults to 32.STARGATE__CONSUL_AGENT_LOCATIONLocation of the Consul Agent. Leave empty to disable the plugin.STARGATE__SCHEMETransport scheme. It''s used to configure Consul HTTP checks. Defaults to http.' expandMacrosWith: StargateConsulExample version ) ] -{ #category : #tests } +{ #category : 'tests' } StargateConsulExampleTest >> testProjectName [ self @@ -81,7 +82,7 @@ StargateConsulExampleTest >> testProjectName [ equals: 'Stargate-Consul' ] -{ #category : #tests } +{ #category : 'tests' } StargateConsulExampleTest >> testStart [ | response | diff --git a/source/Stargate-Consul-Examples-Tests/package.st b/source/Stargate-Consul-Examples-Tests/package.st index 95c3518..0eea2d8 100644 --- a/source/Stargate-Consul-Examples-Tests/package.st +++ b/source/Stargate-Consul-Examples-Tests/package.st @@ -1 +1 @@ -Package { #name : #'Stargate-Consul-Examples-Tests' } +Package { #name : 'Stargate-Consul-Examples-Tests' } From 4b3421003774a396d994259573f95823bc44edf5 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 15 Apr 2024 15:57:50 -0300 Subject: [PATCH 3/7] Configure integration tests env --- .github/workflows/integration-tests-gs64.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests-gs64.yml b/.github/workflows/integration-tests-gs64.yml index 93130a9..29cc678 100644 --- a/.github/workflows/integration-tests-gs64.yml +++ b/.github/workflows/integration-tests-gs64.yml @@ -20,9 +20,11 @@ jobs: - name: Configure keyfile run: | echo "$GS_KEYFILE" > ./api-tests/gs64/gemstone.key - echo "GS_VERSION=${{ matrix.version }}" > ./api-tests/gs64/.env env: GS_KEYFILE: ${{ secrets.GS_KEYFILE }} + - name: Configure env + run: | + echo "GS_VERSION=${{ matrix.version }}" > ./api-tests/gs64/.env - name: Run GS64 tests using Docker run: ./compose-test-gs64.sh env: From 514e6f5dafa9ed3abec21e1c0b929c30beafdddb Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 15 Apr 2024 17:02:40 -0300 Subject: [PATCH 4/7] Fix api tests for GS64 --- .github/workflows/integration-tests-gs64.yml | 9 +--- api-tests/{gs64 => gs64-3.7.0}/.gitignore | 0 .../{gs64 => gs64-3.7.0}/docker-compose.yml | 4 +- api-tests/gs64-3.7.0/gem.conf | 1 + api-tests/gs64-3.7.1/.gitignore | 1 + api-tests/gs64-3.7.1/docker-compose.yml | 42 +++++++++++++++++++ api-tests/gs64-3.7.1/gem.conf | 1 + api-tests/gs64/gem.conf | 1 - compose-test-gs64.sh | 9 +++- 9 files changed, 57 insertions(+), 11 deletions(-) rename api-tests/{gs64 => gs64-3.7.0}/.gitignore (100%) rename api-tests/{gs64 => gs64-3.7.0}/docker-compose.yml (91%) create mode 100644 api-tests/gs64-3.7.0/gem.conf create mode 100644 api-tests/gs64-3.7.1/.gitignore create mode 100644 api-tests/gs64-3.7.1/docker-compose.yml create mode 100644 api-tests/gs64-3.7.1/gem.conf delete mode 100644 api-tests/gs64/gem.conf diff --git a/.github/workflows/integration-tests-gs64.yml b/.github/workflows/integration-tests-gs64.yml index 29cc678..5a0ff24 100644 --- a/.github/workflows/integration-tests-gs64.yml +++ b/.github/workflows/integration-tests-gs64.yml @@ -19,16 +19,11 @@ jobs: fetch-depth: 2 - name: Configure keyfile run: | - echo "$GS_KEYFILE" > ./api-tests/gs64/gemstone.key + echo "$GS_KEYFILE" > ./api-tests/gs64-{{ matrix.version }}/gemstone.key env: GS_KEYFILE: ${{ secrets.GS_KEYFILE }} - - name: Configure env - run: | - echo "GS_VERSION=${{ matrix.version }}" > ./api-tests/gs64/.env - name: Run GS64 tests using Docker - run: ./compose-test-gs64.sh - env: - GS_VERSION: ${{ matrix.version }} + run: ./compose-test-gs64.sh {{ matrix.version }} - name: Remove keyfile if: always() run: rm -f ./api-tests/gs64/gemstone.key diff --git a/api-tests/gs64/.gitignore b/api-tests/gs64-3.7.0/.gitignore similarity index 100% rename from api-tests/gs64/.gitignore rename to api-tests/gs64-3.7.0/.gitignore diff --git a/api-tests/gs64/docker-compose.yml b/api-tests/gs64-3.7.0/docker-compose.yml similarity index 91% rename from api-tests/gs64/docker-compose.yml rename to api-tests/gs64-3.7.0/docker-compose.yml index 1a83b24..82d43c8 100644 --- a/api-tests/gs64/docker-compose.yml +++ b/api-tests/gs64-3.7.0/docker-compose.yml @@ -3,7 +3,7 @@ services: api: build: context: ../../ - dockerfile: docker/gs64-${GS64_VERSION}/Dockerfile + dockerfile: docker/gs64-3.7.0/Dockerfile cap_add: - CAP_SYS_RESOURCE ports: @@ -23,7 +23,7 @@ services: - stone stone: init: true - image: ghcr.io/ba-st/gs64-rowan:v${GS64_VERSION} + image: ghcr.io/ba-st/gs64-rowan:v3.7.0 cap_add: - CAP_SYS_RESOURCE environment: diff --git a/api-tests/gs64-3.7.0/gem.conf b/api-tests/gs64-3.7.0/gem.conf new file mode 100644 index 0000000..e4c5efe --- /dev/null +++ b/api-tests/gs64-3.7.0/gem.conf @@ -0,0 +1 @@ +GEM_TEMPOBJ_CACHE_SIZE = 500MB; diff --git a/api-tests/gs64-3.7.1/.gitignore b/api-tests/gs64-3.7.1/.gitignore new file mode 100644 index 0000000..8d57495 --- /dev/null +++ b/api-tests/gs64-3.7.1/.gitignore @@ -0,0 +1 @@ +gemstone.key diff --git a/api-tests/gs64-3.7.1/docker-compose.yml b/api-tests/gs64-3.7.1/docker-compose.yml new file mode 100644 index 0000000..2652d5a --- /dev/null +++ b/api-tests/gs64-3.7.1/docker-compose.yml @@ -0,0 +1,42 @@ +version: '3' +services: + api: + build: + context: ../../ + dockerfile: docker/gs64-3.7.1/Dockerfile + cap_add: + - CAP_SYS_RESOURCE + ports: + - "8080:8080" + environment: + STARGATE__PUBLIC_URL: http://api:8080 + STARGATE__PORT: 8080 + STARGATE__OPERATIONS_SECRET: API-tests + HEALTH_CHECK_TOKEN: eyJhbGciOiJIUzI1NiJ9.eyJwZXJtaXNzaW9ucyI6WyJleGVjdXRlOmhlYWx0aC1jaGVjayJdfQ.gLammIebJuNDYDz70T8ZYK9GV8jXWrt18mPnLPvoCjw + STARGATE__CONSUL_AGENT_LOCATION: http://consul-agent:8500 + GS64_STONE_HOSTNAME: stone + TZ: America/Argentina/Buenos_Aires + volumes: + - ./gem.conf:/opt/gemstone/conf.gem.conf + depends_on: + - consul-agent + - stone + stone: + init: true + image: ghcr.io/ba-st/gs64-rowan:v3.7.1 + cap_add: + - CAP_SYS_RESOURCE + environment: + TZ: America/Argentina/Buenos_Aires + volumes: + - ./gem.conf:/opt/gemstone/conf/gem.conf + - ./gemstone.key:/opt/gemstone/product/sys/gemstone.key:ro + - $PWD:/opt/gemstone/projects/Stargate-Consul + consul-agent: + image: consul:1.8 + ports: + - "8500:8500" + - "8600:8600" + - "8300:8300" + environment: + CONSUL_BIND_INTERFACE: eth0 diff --git a/api-tests/gs64-3.7.1/gem.conf b/api-tests/gs64-3.7.1/gem.conf new file mode 100644 index 0000000..e4c5efe --- /dev/null +++ b/api-tests/gs64-3.7.1/gem.conf @@ -0,0 +1 @@ +GEM_TEMPOBJ_CACHE_SIZE = 500MB; diff --git a/api-tests/gs64/gem.conf b/api-tests/gs64/gem.conf deleted file mode 100644 index 085acde..0000000 --- a/api-tests/gs64/gem.conf +++ /dev/null @@ -1 +0,0 @@ -GEM_TEMPOBJ_CACHE_SIZE = 500000KB; diff --git a/compose-test-gs64.sh b/compose-test-gs64.sh index 9e8d490..da0dbcc 100755 --- a/compose-test-gs64.sh +++ b/compose-test-gs64.sh @@ -2,7 +2,14 @@ set -e -readonly GS64_COMPOSE_FILE="api-tests/gs64/docker-compose.yml" +if [ $# -eq 0 ]; then + print_error "Missing GS64 version argument. Eg. 3.7.0" + exit 1 +fi + +readonly GS64_VERSION="$1" +readonly GS64_COMPOSE_FILE="api-tests/gs64-$GS64_VERSION/docker-compose.yml" + echo "Building API" docker compose -f "$GS64_COMPOSE_FILE" build api echo "Starting Stone" From 739b5158f45398424f693cccb929cfa6a124dcd4 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 15 Apr 2024 17:21:48 -0300 Subject: [PATCH 5/7] Fix integration test action setup --- .github/workflows/integration-tests-gs64.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests-gs64.yml b/.github/workflows/integration-tests-gs64.yml index 5a0ff24..2a117e9 100644 --- a/.github/workflows/integration-tests-gs64.yml +++ b/.github/workflows/integration-tests-gs64.yml @@ -19,11 +19,11 @@ jobs: fetch-depth: 2 - name: Configure keyfile run: | - echo "$GS_KEYFILE" > ./api-tests/gs64-{{ matrix.version }}/gemstone.key + echo "$GS_KEYFILE" > ./api-tests/gs64-${{ matrix.version }}/gemstone.key env: GS_KEYFILE: ${{ secrets.GS_KEYFILE }} - name: Run GS64 tests using Docker - run: ./compose-test-gs64.sh {{ matrix.version }} + run: ./compose-test-gs64.sh ${{ matrix.version }} - name: Remove keyfile if: always() run: rm -f ./api-tests/gs64/gemstone.key From 850ded14625f1510feb8b12d5909cf04b9b0f647 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 15 Apr 2024 17:24:37 -0300 Subject: [PATCH 6/7] Fix compose script --- compose-test-gs64.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compose-test-gs64.sh b/compose-test-gs64.sh index da0dbcc..0f009b3 100755 --- a/compose-test-gs64.sh +++ b/compose-test-gs64.sh @@ -18,7 +18,7 @@ echo "Starting Consul Agent" docker compose -f "$GS64_COMPOSE_FILE" up -d consul-agent sleep 2 echo "Installing support code" -docker exec -i -u gemstone gs64-stone-1 ./load-rowan-project.sh Stargate-Consul Stargate-Consul-Examples +docker exec -i -u gemstone gs64-"$GS64_VERSION"-stone-1 ./load-rowan-project.sh Stargate-Consul Stargate-Consul-Examples echo "Starting API" docker compose -f "$GS64_COMPOSE_FILE" up -d api sleep 10 From 6cf9640981a193c9249244458e1d8581f7995a63 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Mon, 15 Apr 2024 17:29:42 -0300 Subject: [PATCH 7/7] Fix stone container name in script --- compose-test-gs64.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose-test-gs64.sh b/compose-test-gs64.sh index 0f009b3..aacaba8 100755 --- a/compose-test-gs64.sh +++ b/compose-test-gs64.sh @@ -3,7 +3,7 @@ set -e if [ $# -eq 0 ]; then - print_error "Missing GS64 version argument. Eg. 3.7.0" + echo "Error: Missing GS64 version argument. Eg. 3.7.0" exit 1 fi @@ -18,7 +18,7 @@ echo "Starting Consul Agent" docker compose -f "$GS64_COMPOSE_FILE" up -d consul-agent sleep 2 echo "Installing support code" -docker exec -i -u gemstone gs64-"$GS64_VERSION"-stone-1 ./load-rowan-project.sh Stargate-Consul Stargate-Consul-Examples +docker exec -i -u gemstone "gs64-${GS64_VERSION//./}-stone-1" ./load-rowan-project.sh Stargate-Consul Stargate-Consul-Examples echo "Starting API" docker compose -f "$GS64_COMPOSE_FILE" up -d api sleep 10