Skip to content

Commit

Permalink
GH workflows: Run backend e2e tests with given gateway docker tag whe…
Browse files Browse the repository at this point in the history
…n provided in PR body
  • Loading branch information
dandelany committed Jan 3, 2025
1 parent bd52e5e commit 9056f1a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- develop
- dev-[0-9]+.[0-9]+.[0-9]+
types:
# defaults + 'edited', to handle changes to flags like ___REQUIRES_GATEWAY_PR___ in the PR body
[ opened, synchronize, reopened, edited ]
push:
branches:
- develop
Expand All @@ -27,6 +30,7 @@ env:
SCHEDULER_PASSWORD: "${{secrets.SCHEDULER_PASSWORD}}"
SEQUENCING_USERNAME: "${{secrets.SEQUENCING_USERNAME}}"
SEQUENCING_PASSWORD: "${{secrets.SEQUENCING_PASSWORD}}"
PR_BODY: "${{github.event.pull_request.body}}"

jobs:
unit-test:
Expand Down Expand Up @@ -62,6 +66,12 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Extract Aerie gateway docker tag from PR body
# look in the PR body for the string ___REQUIRES_GATEWAY_PR___=9999, extract the number if so & save to env var
# if gateway PR is labeled correctly, it will publish a docker tag called 'pr-9999' to use in tests
if: ${{ contains(env.PR_BODY, '___REQUIRES_GATEWAY_PR___=') }}
run: |
echo "GATEWAY_IMAGE_TAG=pr-$(echo $PR_BODY | sed -n 's/.*___REQUIRES_GATEWAY_PR___=\"\([0-9]\+\)\".*/\1/p')" >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
Expand All @@ -81,9 +91,10 @@ jobs:
run: ./gradlew e2e-tests:buildAllSchedulingProcedureJars
- name: Start Services
run: |
docker compose -f ./e2e-tests/docker-compose-test.yml up -d --build
echo "GATEWAY_IMAGE_TAG: $GATEWAY_IMAGE_TAG"
docker compose -f ./e2e-tests/docker-compose-test.yml up -d --build --quiet-pull
docker images
docker ps -a
docker ps -a --no-trunc
- name: Sleep for 30 Seconds
run: sleep 30s
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/docker-compose-many-workers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
AERIE_DB_PORT: 5432
GATEWAY_DB_USER: "${GATEWAY_USERNAME}"
GATEWAY_DB_PASSWORD: "${GATEWAY_PASSWORD}"
image: "ghcr.io/nasa-ammos/aerie-gateway:develop"
image: 'ghcr.io/nasa-ammos/aerie-gateway:${GATEWAY_IMAGE_TAG:-develop}'
ports: ["9000:9000"]
restart: always
volumes:
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
AERIE_DB_PORT: 5432
GATEWAY_DB_USER: "${GATEWAY_USERNAME}"
GATEWAY_DB_PASSWORD: "${GATEWAY_PASSWORD}"
image: 'ghcr.io/nasa-ammos/aerie-gateway:develop'
image: 'ghcr.io/nasa-ammos/aerie-gateway:${GATEWAY_IMAGE_TAG:-develop}'
ports: ['9000:9000']
restart: always
volumes:
Expand Down

0 comments on commit 9056f1a

Please sign in to comment.