Skip to content

Commit

Permalink
tests/ci: minimize test log output and produce a readable report
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser committed Aug 4, 2022
1 parent 8560d9a commit 2a64225
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/linux-build-clang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,18 @@ jobs:
run: cmake --build build -j$((`nproc`+1))

- name: Run Tests
env:
GTEST_OUTPUT: ${{ github.workspace }}/test-report.xml
run: ./test.sh

- name: Generate Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit Tests
path: ${{ github.workspace }}/test-report.xml
reporter: jest-junit

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/linux-build-gcc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,18 @@ jobs:

- name: Run Tests - With Coverage
working-directory: ./build
env:
GTEST_OUTPUT: ${{ github.workspace }}/test-report.xml
run: ninja goalc-test_coverage -w dupbuild=warn

- name: Generate Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit Tests
path: ${{ github.workspace }}/test-report.xml
reporter: jest-junit

- name: Submit Coverage Report to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
continue-on-error: true
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/windows-build-clang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,17 @@ jobs:

- name: Run Tests
timeout-minutes: 10
run: ./build/bin/goalc-test.exe --gtest_color=yes --gtest_filter="-*MANUAL_TEST*"
env:
GTEST_OUTPUT: ${{ github.workspace }}/test-report.xml
run: ./build/bin/goalc-test.exe --gtest_color=yes --gtest_brief=1 --gtest_filter="-*MANUAL_TEST*"

- name: Generate Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit Tests
path: ${{ github.workspace }}/test-report.xml
reporter: jest-junit

- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/windows-build-msvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,14 @@ jobs:
- name: Run Tests
timeout-minutes: 10
run: ./build/bin/goalc-test.exe --gtest_color=yes --gtest_filter="-*MANUAL_TEST*"
env:
GTEST_OUTPUT: ${{ github.workspace }}/test-report.xml
run: ./build/bin/goalc-test.exe --gtest_color=yes --gtest_brief=1 --gtest_filter="-*MANUAL_TEST*"

- name: Generate Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Unit Tests
path: ${{ github.workspace }}/test-report.xml
reporter: jest-junit
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

$DIR/build/goalc-test --gtest_color=yes "$@" --gtest_filter="-*MANUAL_TEST*"
$DIR/build/goalc-test --gtest_brief=1 --gtest_color=yes "$@" --gtest_filter="-*MANUAL_TEST*"
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if(UNIX AND CMAKE_COMPILER_IS_GNUCXX AND CODE_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
setup_target_for_coverage_lcov(NAME goalc-test_coverage
EXECUTABLE goalc-test --gtest_color=yes
EXECUTABLE goalc-test --gtest_color=yes --gtest_brief=1 --gtest_filter="-*MANUAL_TEST*"
DEPENDENCIES goalc-test
EXCLUDE "third-party/*" "/usr/include/*")
endif()

0 comments on commit 2a64225

Please sign in to comment.