Skip to content

Commit

Permalink
WIP: Attempt to display test failures with GH issues in PRs.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel (dB.) Doubrovkine <[email protected]>
  • Loading branch information
dblock committed Dec 1, 2022
1 parent b4c2f73 commit 20f7029
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 457 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/auto-release.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/backport.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/changelog_verifier.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/code-hygiene.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/create-documentation-issue.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/delete_backport_branch.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/dependabot_pr.yml

This file was deleted.

24 changes: 8 additions & 16 deletions .github/workflows/gradle-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- 'backport/**'
- 'create-pull-request/**'
- 'dependabot/**'
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]

permissions:
Expand All @@ -26,7 +26,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup environment variables (PR)
if: github.event_name == 'pull_request_target'
if: github.event_name == 'pull_request'
run: |
echo "pr_from_sha=$(jq --raw-output .pull_request.head.sha $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
echo "pr_from_clone_url=$(jq --raw-output .pull_request.head.repo.clone_url $GITHUB_EVENT_PATH)" >> $GITHUB_ENV
Expand Down Expand Up @@ -55,26 +55,18 @@ jobs:

- name: Trigger jenkins workflow to run gradle check
run: |
set -e
set -o pipefail
bash opensearch-build/scripts/gradle/gradle-check.sh ${{ secrets.JENKINS_GRADLE_CHECK_GENERIC_WEBHOOK_TOKEN }} | tee -a gradle-check.log
# ignore
- name: Setup Result Status
if: always()
run: |
WORKFLOW_URL=`cat gradle-check.log | grep 'WORKFLOW_URL' | awk '{print $2}'`
WORKFLOW_URL=https://build.ci.opensearch.org/job/gradle-check/7517/
RESULT=`cat gradle-check.log | grep 'Result:' | awk '{print $2}'`
echo "workflow_url=$WORKFLOW_URL" >> $GITHUB_ENV
echo "result=$RESULT" >> $GITHUB_ENV
- name: Upload Coverage Report
if: success()
uses: codecov/codecov-action@v2
with:
files: ./codeCoverage.xml

- name: Create Comment Success
if: ${{ github.event_name == 'pull_request_target' && success() && env.result == 'SUCCESS' }}
if: ${{ github.event_name == 'pull_request' && success() && env.result == 'SUCCESS' }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ env.pr_number }}
Expand All @@ -85,7 +77,7 @@ jobs:
* **CommitID:** ${{ env.pr_from_sha }}
- name: Extract Test Failure
if: ${{ github.event_name == 'pull_request_target' && env.result != 'SUCCESS' }}
if: ${{ github.event_name == 'pull_request' && env.result != 'SUCCESS' }}
run: |
TEST_FAILURES=`curl -s "${{ env.workflow_url }}/testReport/api/json?tree=suites\[cases\[status,className,name\]\]" | jq -r '.. | objects | select(.status=="FAILED",.status=="REGRESSION") | (.className + "." + .name)'`
TEST_FAILURES_WITH_ISSUES=""
Expand All @@ -109,7 +101,7 @@ jobs:
fi
- name: Create Comment Flaky
if: ${{ github.event_name == 'pull_request_target' && success() && env.result != 'SUCCESS' }}
if: ${{ github.event_name == 'pull_request' && success() && env.result != 'SUCCESS' }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ env.pr_number }}
Expand All @@ -121,7 +113,7 @@ jobs:
Please review all [flaky tests](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) that succeeded after retry and create an issue if one does not already exist to track the flaky failure.
- name: Create Comment Failure
if: ${{ github.event_name == 'pull_request_target' && failure() }}
if: ${{ github.event_name == 'pull_request' && failure() }}
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ env.pr_number }}
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/links.yml

This file was deleted.

59 changes: 0 additions & 59 deletions .github/workflows/lucene-snapshots.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/precommit.yml

This file was deleted.

Loading

0 comments on commit 20f7029

Please sign in to comment.