Skip to content

Commit

Permalink
test: scaffold test setup for running as command
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 committed Dec 4, 2023
1 parent 14b11cf commit 20a6d30
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker.test.command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker test run as command

on:
push:
branches:
- 'main'
tags:
- '*'
pull_request:

jobs:
docker-test:
env:
COMPOSE_ARGS: -f docker-compose.yml -f docker-compose.ci.command.yml
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: docker-compose up
run: docker-compose ${{ env.COMPOSE_ARGS }} up -d

- name: Make a sparql request
run: |
NUM_BINDINGS=$(curl 'http://localhost:9999/bigdata/namespace/wdq/sparql' -H 'Accept: application/sparql-results+json' --data-raw 'query=SELECT+*+WHERE%7B+%3Fs+%3Fp+%3Fo+%7D' | jq '.results.bindings | length')
# should be plenty more than 100
if [[ "$NUM_BINDINGS" -lt 100 ]]; then
exit 1
fi
- name: docker-compose logs > output.log
if: always()
run: docker-compose ${{ env.COMPOSE_ARGS }} logs --no-color > "output.log"

- name: Archive output.log
uses: actions/upload-artifact@v2
if: always()
with:
name: DockerTestLog
if-no-files-found: error
path: output.log

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker test
name: Docker test run as service

on:
push:
Expand All @@ -11,7 +11,7 @@ on:
jobs:
docker-test:
env:
COMPOSE_ARGS: -f docker-compose.yml -f docker-compose.ci.yml
COMPOSE_ARGS: -f docker-compose.yml -f docker-compose.ci.service.yml
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
File renamed without changes.

0 comments on commit 20a6d30

Please sign in to comment.