Skip to content

Commit

Permalink
Update integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
masayag committed Oct 29, 2023
1 parent 19f5550 commit 40e0d33
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,18 @@ jobs:
with:
compose-file: "docker-compose.yml"
down-flags: "--volumes --remove-orphans --rmi local"
test-container: "blood-info"
test-command: "$(wget -q -O- --no-check-certificate https://localhost:8443/station | jq '. | length') -gt 0"

- name: Run Tests
shell: bash
run: |
chmod +x ./github/workflows/test.sh # Make the script executable
./github/workflows/test.sh # Run the test script
- name: Display Test Results
shell: bash
run: |
if [ $? -eq 0 ]; then
echo "Tests passed"
else
echo "Tests failed"
fi
11 changes: 11 additions & 0 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

result=$(wget -q -O- --no-check-certificate https://localhost:8443/stations | jq '. | length')

if [ -n "$result" ] && [ "$result" -ne 0 ]; then
echo "Test passed: Result is not empty and not zero."
exit 0 # Test passed
else
echo "Test failed: Result is empty or zero."
exit 1 # Test failed
fi

0 comments on commit 40e0d33

Please sign in to comment.