Skip to content

Commit

Permalink
Print errors if there are any
Browse files Browse the repository at this point in the history
  • Loading branch information
KapStorm committed Sep 4, 2024
1 parent f553e59 commit c25dc26
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,27 @@ jobs:
run: CI=true sbt "testOnly controllers.AdminControllerSpec"

- name: Print test results
if: failure()
run: |
# Find all XML files in the target/test-reports directory
sudo apt-get update && sudo apt-get install -y libxml2-utils &&
# Find all XML files in the server/target/test-reports directory
for file in server/target/test-reports/*.xml; do
if [ -f "$file" ]; then
echo "Contents of $file:"
cat "$file"
# check if file has <failure> tags
# dont print boolean
if xmllint --xpath 'boolean(//testsuite/testcase/failure)' "$file"; then
echo "Processing $file:"
# Extract and print <failure> tags inside <testcase> tags
xmllint --xpath '//testsuite/testcase/failure/text()' "$file"
echo
fi
# echo "Processing $file:"
# Extract and print <failure> tags inside <testcase> tags
# xmllint --xpath '//testsuite/testcase/failure/text()' "$file"
# if there are <failure> tags, print <testcase> classname and name attributes
# xmllint --xpath '//testsuite/testcase/failure/parent::testcase/@classname | //testsuite/testcase/failure/parent::testcase/@name' "$file"
echo
else
echo "No XML files found."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class AdminControllerSpec extends PlayPostgresSpec with LoginUtils with MockitoS
}

"return no results" in withApiClient { client =>
throw new NotImplementedError("Kappa error")
val response = client.adminGetUserLogs(UUID.randomUUID()).futureValue
response.data.isEmpty must be(true)
}
Expand Down

0 comments on commit c25dc26

Please sign in to comment.