Skip to content

Commit dc5ef42

Browse files
author
Aaron Roller
committed
ignoring non xml files AM-337/gtest
1 parent 3b94c80 commit dc5ef42

File tree

3 files changed

+129
-9
lines changed

3 files changed

+129
-9
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
run: |
1515
[ ${{ steps.xunit-viewer.outputs.report-file }} == "test-reports/index.html" ]
1616
- name: Attach the report
17+
if: always()
1718
uses: actions/upload-artifact@v1
1819
with:
1920
name: test-reports
@@ -36,6 +37,7 @@ jobs:
3637
run: |
3738
[ ${{ steps.xunit-viewer.outputs.report-file }} == "${{ env.RESULTS_PATH }}/index.html" ]
3839
- name: Attach the report
40+
if: always()
3941
uses: actions/upload-artifact@v1
4042
with:
4143
name: alternate-results-path-reports
@@ -56,6 +58,7 @@ jobs:
5658
run: |
5759
[ ${{ steps.xunit-viewer.outputs.report-file }} == "somewhere/custom-report.html" ]
5860
- name: Attach the report
61+
if: always()
5962
uses: actions/upload-artifact@v1
6063
with:
6164
name: alternate-report-path-reports

detection.sh

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,28 @@ suite_success(){
1010
file="$1"
1111
# look for 0 failures and errors
1212
# grep reports non zero code if anything but zero failures/errors
13-
suite_line=$(cat "$file" | grep "<testsuites")
14-
15-
if echo "$suite_line" | grep "failures=\"0\"";then
16-
if echo "$suite_line" | grep "errors=\"0\"";then
17-
return 0
13+
if cat "$file" | grep "<testsuites";then
14+
suite_line=$(cat "$file" | grep "<testsuites")
15+
if echo "$suite_line" | grep "failures=\"0\"";then
16+
if echo "$suite_line" | grep "errors=\"0\"";then
17+
return 0
18+
else
19+
echo "Error found in $file: $suite_line"
20+
return 1
21+
fi
1822
else
19-
echo "Error found in $file: $suite_line"
23+
echo "Failure found in $file: $suite_line"
2024
return 1
2125
fi
2226
else
23-
echo "Failure found in $file: $suite_line"
24-
return 1
27+
echo "Skipping file without suite: $file"
2528
fi
2629
}
2730

2831
echo "Inspecting '$file_or_folder'"
2932

3033
if [ -d "$file_or_folder" ];then
31-
for file in $file_or_folder/* ; do suite_success "$file"; done
34+
for file in $file_or_folder/*.xml ; do suite_success "$file"; done
3235
elif [ -f "$file_or_folder" ]; then
3336
suite_success "$file_or_folder"
3437
else

test/success/index.html

Lines changed: 114 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)