Skip to content

Commit

Permalink
fixes issues
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Gutierrez <[email protected]>
  • Loading branch information
AlfredoG87 committed Aug 19, 2024
1 parent bbfe7bd commit a0524d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ jobs:
distribution: 'temurin'
java-version: '21'

- name: Install grpcurl
run: |
curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -o grpcurl.tar.gz
sudo tar -xzf grpcurl.tar.gz -C /usr/local/bin grpcurl
rm grpcurl.tar.gz
- name: Cache Gradle packages
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
Expand All @@ -72,15 +79,15 @@ jobs:
- name: Build application
run: ${{ env.GRADLE_EXEC }} build

- name: Run application in background, capture logs, and save PID in a variable
- name: Run application in background, capture logs in app.log
run: |
${{ env.GRADLE_EXEC }} run 2> output.log < /dev/null
APP_PID=$!
${{ env.GRADLE_EXEC }} run 2> server/src/test/resources/app.log < /dev/null &
echo "Application started with PID $APP_PID"
sleep 10
- name: Smoke Test
run: ./server/src/test/resources/smoke-test.sh app.log
- name: Kill application
run: kill $APP_PID
- name: Print App Logs
run: cat server/src/test/resources/app.log

- name: Smoke Test
working-directory: server/src/test/resources/
run: ./smoke-test.sh app.log
2 changes: 1 addition & 1 deletion server/src/test/resources/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ trap "shutdown; exit 1" ERR SIGINT SIGTERM

# 1. Verify that the logs have the startup pattern (only if log file is provided)
LOG_FILE=$1
STARTUP_PATTERN="Expected startup pattern"
STARTUP_PATTERN="Block Node Server started at port"

if [[ -n "$LOG_FILE" ]]; then
if grep -q "$STARTUP_PATTERN" "$LOG_FILE"; then
Expand Down

0 comments on commit a0524d5

Please sign in to comment.