Skip to content

Commit

Permalink
Updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
BreathXV committed Jun 5, 2024
1 parent 0eec5f4 commit 0165326
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ ENV DATABASE_PATH :memory:

EXPOSE 8080

CMD ["sh", "test.sh"]
CMD ["sh", "./utils/test.sh"]
22 changes: 22 additions & 0 deletions utils/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# Start the application in the background
./rwapi &
RWAPI_PID=$!

# Wait for the application to start
sleep 5

# Run the tests
response=$(curl -s -X POST http://localhost:8080/check-whitelist -H "Content-Type: application/json" -d '{"ServerID": "1cdfa108-0ba6-45fc-9756-22e76304e8fa", "IdentityID": "465c3a56-743b-4755-bad0-2c60c625a779"}')
echo "$response" | jq .
echo "$response" | jq -e '.whitelisted == "true"' > /dev/null

# Capture the result of the test
TEST_RESULT=$?

# Stop the application
kill $RWAPI_PID

# Exit with the test result
exit $TEST_RESULT

0 comments on commit 0165326

Please sign in to comment.