Skip to content

Commit

Permalink
HPCC4J-690 Github tests should continue on failure
Browse files Browse the repository at this point in the history
- Changed maven test settings to continue on failure
- Added python script to process failures and add an error annotation

Signed-off-by: James McMullan [email protected]
  • Loading branch information
jpmcmu committed Mar 6, 2025
1 parent f6a815e commit 1269feb
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 2 deletions.
30 changes: 29 additions & 1 deletion .github/workflows/baremetal-regression-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,32 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Build with Maven
run: mvn -B --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=http://eclwatch.default:8010 -Dwssqlconn=http://sql2ecl.default:8510 -DHPCC30117=open install
run: mvn -B --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=true -Dhpccconn=http://eclwatch.default:8010 -Dwssqlconn=http://sql2ecl.default:8510 -DHPCC30117=open install

- name: Process Errors
shell: python
run: |
import os
import csv
import textwrap
import json
import sys
var hadErrors = False
var failedTestPaths = ["./HPCC4j/wsclient/FailedTests.csv", "./HPCC4j/dfsclient/FailedTests.csv"]
for file_path in failedTestsPaths:
if os.path.exists(file_path):
with open(file_path, 'r') as file:
csv_reader = csv.reader(file)
for row in csv_reader:
hadErrors = True
# Each row in the CSV file is a failed test with: TestClass,Test,Error
testFailureMessages += textwrap.dedent(f"""\
## {row[0]}.{row[1]} Failed
**Error:** ```{row[2]}```
""")
printf(f"::error file={row[0]}.{row[1]}, title={row[2]}")
else:
print(f"FailedTests.csv does not exist at {file_path}")
30 changes: 29 additions & 1 deletion .github/workflows/k8s-regression-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,32 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Build with Maven
run: mvn -B --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=https://eclwatch.default:8010 -Dwssqlconn=https://sql2ecl.default:8510 -DHPCC30117=open install
run: mvn -B --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=true -Dhpccconn=https://eclwatch.default:8010 -Dwssqlconn=https://sql2ecl.default:8510 -DHPCC30117=open install

- name: Process Errors
shell: python
run: |
import os
import csv
import textwrap
import json
import sys
var hadErrors = False
var failedTestPaths = ["./HPCC4j/wsclient/FailedTests.csv", "./HPCC4j/dfsclient/FailedTests.csv"]
for file_path in failedTestsPaths:
if os.path.exists(file_path):
with open(file_path, 'r') as file:
csv_reader = csv.reader(file)
for row in csv_reader:
hadErrors = True
# Each row in the CSV file is a failed test with: TestClass,Test,Error
testFailureMessages += textwrap.dedent(f"""\
## {row[0]}.{row[1]} Failed
**Error:** ```{row[2]}```
""")
printf(f"::error file={row[0]}.{row[1]}, title={row[2]}")
else:
print(f"FailedTests.csv does not exist at {file_path}")

0 comments on commit 1269feb

Please sign in to comment.