Skip to content

Commit

Permalink
remove router healtcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszkuc committed Oct 31, 2022
1 parent 1e6f0d5 commit f5e29a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 29 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:

steps:
- uses: actions/checkout@v3
# we are using separate download actions as otherwise artifacts are placed in folders
- name: Download products JAR
uses: actions/download-artifact@v3
with:
Expand All @@ -107,38 +108,25 @@ jobs:
- name: Federation Tests
run: |
set -x
echo "status"
docker ps -a
echo "verify router is up"
curl --verbose http://localhost:8088/health
echo "network"
docker network inspect federation-jvm-spring-example_default
echo "sending a query"
echo "sending a test query"
curl --request POST \
--verbose \
--header 'content-type: application/json' \
--url http://localhost:3000/ \
--data '{"query":"query($productId: ID!) {\n product(id: $productId) {\n id\n reviews {\n id\n text\n starRating\n }\n name\n description\n }\n}","variables":{"productId":"5"}}' \
> response.json
echo "GraphQL response"
echo "received GraphQL response"
cat response.json
echo "Verify response"
echo "verifying response"
jq -e '.data.product?.id == "5" and .data.product?.name == "Dragon" and (.data.product?.reviews | length == 2) and (.data.product?.reviews[0]?.text | length > 0)' response.json
- name: Error Logs
if: ${{ failure() }}
run: docker-compose logs
- name: Stop Supergraph
if: ${{ always() }}
run: docker compose down --remove-orphans
- name: Error Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
./products.jar
./reviews.jar
./supergraph.graphql
retention-days: 1
15 changes: 4 additions & 11 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ services:
- 8088:8088
command: -c config/router.yaml -s config/supergraph.graphql
depends_on:
products:
condition: service_healthy
reviews:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-X", "GET", "http://router:8088/health" ]
interval: 5s
timeout: 1s
retries: 10
- products
- reviews
products:
build:
context: .
Expand All @@ -27,7 +20,7 @@ services:
ports:
- 8080:8080
healthcheck:
test: [ "CMD", "curl", "-X", "GET", "http://products:8080/actuator/health" ]
test: [ "CMD", "curl", "http://products:8080/actuator/health" ]
interval: 5s
timeout: 1s
retries: 10
Expand All @@ -40,7 +33,7 @@ services:
ports:
- 8081:8081
healthcheck:
test: [ "CMD", "curl", "-X", "GET", "http://reviews:8081/actuator/health" ]
test: [ "CMD", "curl", "http://reviews:8081/actuator/health" ]
interval: 5s
timeout: 1s
retries: 10

0 comments on commit f5e29a3

Please sign in to comment.