From a0524d5728b3f0afdb9ba69f2736833d368fcf35 Mon Sep 17 00:00:00 2001 From: Alfredo Gutierrez Date: Thu, 15 Aug 2024 19:55:05 -0600 Subject: [PATCH] fixes issues Signed-off-by: Alfredo Gutierrez --- .github/workflows/smoke-test.yaml | 23 +++++++++++++++-------- server/src/test/resources/smoke-test.sh | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/smoke-test.yaml b/.github/workflows/smoke-test.yaml index a714412d4..542eeda1c 100644 --- a/.github/workflows/smoke-test.yaml +++ b/.github/workflows/smoke-test.yaml @@ -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: @@ -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 diff --git a/server/src/test/resources/smoke-test.sh b/server/src/test/resources/smoke-test.sh index 787b49c1a..b0ee4c50c 100755 --- a/server/src/test/resources/smoke-test.sh +++ b/server/src/test/resources/smoke-test.sh @@ -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