Skip to content

Commit 42f436f

Browse files
Merge pull request hapifhir#810 from hapifhir/feature/improve-log-output-smoke-test
feat: enhance smoke tests with logging and error highlighting
2 parents 10b75b3 + 81dab90 commit 42f436f

File tree

1 file changed

+48
-19
lines changed

1 file changed

+48
-19
lines changed

.github/workflows/smoke-tests.yml

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,51 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- name: Checkout project
24-
uses: actions/checkout@v4
25-
- name: Set up JDK 17
26-
uses: actions/setup-java@v3
27-
with:
28-
java-version: 17
29-
distribution: zulu
30-
- name: Build with Maven
31-
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
32-
- name: Docker Pull HTTP client
33-
run: docker pull jetbrains/intellij-http-client
34-
- name: Start server with jetty
35-
run: |
36-
mvn -P jetty spring-boot:run & export JPA_PROCESS=$!
37-
sleep 80
38-
- name: Execute smoke tests
39-
run: docker run --rm -v $PWD:/workdir --add-host host.docker.internal:host-gateway jetbrains/intellij-http-client -D src/test/smoketest/plain_server.http --env-file src/test/smoketest/http-client.env.json --env default
40-
41-
23+
- name: Checkout project
24+
uses: actions/checkout@v4
25+
26+
- name: Set up JDK 17
27+
uses: actions/setup-java@v3
28+
with:
29+
java-version: 17
30+
distribution: zulu
31+
32+
- name: Build with Maven
33+
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
34+
35+
- name: Docker Pull HTTP client
36+
run: docker pull jetbrains/intellij-http-client
37+
38+
- name: Start server with jetty
39+
run: |
40+
mkdir -p logs
41+
mvn -P jetty spring-boot:run | tee logs/server.log &
42+
sleep 80
43+
44+
- name: Execute smoke tests
45+
run: docker run --rm -v $PWD:/workdir --add-host host.docker.internal:host-gateway jetbrains/intellij-http-client -D src/test/smoketest/plain_server.http --env-file src/test/smoketest/http-client.env.json --env default
46+
47+
- name: Show last server logs
48+
if: always()
49+
run: |
50+
echo "===== Last 200 Lines of Server Log ====="
51+
tail -n 200 logs/server.log || true
52+
53+
- name: Highlight server errors
54+
if: always()
55+
run: |
56+
echo "===== Highlighted Server Errors ====="
57+
if grep 'ERROR' logs/server.log > /dev/null; then
58+
grep 'ERROR' logs/server.log | while read -r line; do
59+
echo "::error::${line}"
60+
done
61+
else
62+
echo "No errors found in server logs."
63+
fi
64+
65+
- name: Upload server logs
66+
if: always()
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: server-logs
70+
path: logs/server.log

0 commit comments

Comments
 (0)