Skip to content

Commit

Permalink
Merge pull request #18504 from jpmcmu/HPCC-31573
Browse files Browse the repository at this point in the history
HPCC-31573 Add Github Action for ESP Regression Suite

Reviewed-By: Rodrigo Pastrana <[email protected]>
Reviewed-by: Gordon Smith <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Apr 10, 2024
2 parents 8a69683 + 111c1c8 commit 8009423
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .github/actions/hpcc4j-esp-regression-suite/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: 'HPCC4j ESP Regression Suite'
description: 'Runs the HPCC4j ESP Regression Suite'
inputs:
repository:
description: 'Repository'
required: false
default: 'hpcc-systems/hpcc4j'
branch-name:
description: 'Branch Name'
required: true
comments-url:
description: 'Comments URL'
required: true
github-token:
description: 'GitHub Token'
required: true
runs:
using: "composite"
steps:
- name: Checkout HPCC4j
uses: actions/checkout@v3
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.branch-name }}
path: ./HPCC4j

- name: Run HPCC4j ESP Regression Suite
shell: bash
run: |
cd ./HPCC4j
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 -pl '!dfsclient' install
- name: Process errors
env:
comments_url: ${{ inputs.comments-url }}
github_token: ${{ inputs.github-token }}
branch_name: ${{ inputs.branch-name }}
repository: ${{ inputs.repository }}
shell: python
run: |
import os
import csv
import textwrap
import json
branch_name = os.getenv('branch_name')
comments_url = os.getenv('comments_url')
github_token = os.getenv('github_token')
repository = os.getenv('repository')
file_path = "./HPCC4j/wsclient/FailedTests.csv"
if os.path.exists(file_path):
with open(file_path, 'r') as file:
testFailureMessages = ""
csv_reader = csv.reader(file)
for row in csv_reader:
# 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]}```
**Test Command:** ```mvn -B -Dhpccconn=https://eclwatch.default:8010 -Dtest={row[0]}#{row[1]} test```
""")
if testFailureMessages:
message = textwrap.dedent(f"""\
# ESP Regression Suite Test Failures:
The following tests failed; checkout a copy of the HPCC4j project with the following command and run the individual test commands below to debug the failures.
```
git clone https://github.com/{repository}.git hpcc4j
cd hpcc4j && git checkout {branch_name}
```
""")
message += testFailureMessages
# Escape result for json
message = json.dumps(message)
curlCommand = 'curl -X POST %s -H "Content-Type: application/json" -H "Authorization: token %s" --data \'{ "body": %s }\'' % ( comments_url, github_token, message)
os.system(curlCommand)
sys.exit(1)
else:
print(f"FailedTests.csv does not exist at {file_path}")
6 changes: 6 additions & 0 deletions .github/workflows/test-regression-suite-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ jobs:
os: ${{ inputs.os }}
asset-name: ${{ inputs.asset-name }}
platform-folder: ./HPCC-Platform
- name: Run ESP Regression Suite
with:
branch-name: ${{ github.base_ref }}
comments-url: ${{ github.event.pull_request.comments_url }}
github-token: ${{ secrets.GITHUB_TOKEN }}
uses: ./HPCC-Platform/.github/actions/hpcc4j-esp-regression-suite

succeeded:
runs-on: ${{ inputs.os }}
Expand Down

0 comments on commit 8009423

Please sign in to comment.