Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-31573 Add Github Action for ESP Regression Suite #18504

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading