-
Notifications
You must be signed in to change notification settings - Fork 1.5k
add manual trigger for extended tests in pull requests #14331
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
Changes from all commits
1856d57
f7752ab
5130040
0790b2c
bb918d4
6a44a1f
95bb489
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -33,16 +33,46 @@ on: | |||||
push: | ||||||
branches: | ||||||
- main | ||||||
issue_comment: | ||||||
types: [created] | ||||||
|
||||||
permissions: | ||||||
pull-requests: write | ||||||
|
||||||
jobs: | ||||||
# Check issue comment and notify that extended tests are running | ||||||
check_issue_comment: | ||||||
name: Check issue comment | ||||||
runs-on: ubuntu-latest | ||||||
if: github.event.issue.pull_request && github.event.comment.body == 'run extended tests' | ||||||
steps: | ||||||
- uses: actions/github-script@v7 | ||||||
with: | ||||||
github-token: ${{secrets.GITHUB_TOKEN}} | ||||||
script: | | ||||||
github.rest.issues.createComment({ | ||||||
issue_number: context.issue.number, | ||||||
owner: context.repo.owner, | ||||||
repo: context.repo.repo, | ||||||
body: "Running extended tests..." | ||||||
}) | ||||||
|
||||||
# Check crate compiles and base cargo check passes | ||||||
linux-build-lib: | ||||||
name: linux build test | ||||||
runs-on: ubuntu-latest | ||||||
container: | ||||||
image: amd64/rust | ||||||
if: | | ||||||
github.event_name == 'push' || | ||||||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests') | ||||||
steps: | ||||||
- uses: actions/checkout@v4 | ||||||
with: | ||||||
# Check out the pull request branch if triggered by a comment | ||||||
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.ref || github.ref }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A fully formatted ref should work. Probably there are other ways to fetch the same info as well.
Suggested change
Test PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @danila-b 🙏 🤔
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apparently it did run them, it's just not visible in GitHub UI. I have just double checked it with a bit different implementation on the same branch. Unfortunately, it seems that
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried messing around with this again this morning and didn't have much luck There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you again for the help -- I am out of my league in terms of github actions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alamb I gave it a stab implementing this here without any 3rd party actions: #15101 Testing this is a bit of a pain since I don't know any better way than to just merge the workflow to the main branch of the fork and run several test PRs. At least seems to work properly from a quick glance, will test a bit more during the weekend. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thank you! I'll try and check this out shortly |
||||||
submodules: true | ||||||
fetch-depth: 1 | ||||||
- name: Setup Rust toolchain | ||||||
uses: ./.github/actions/setup-builder | ||||||
with: | ||||||
|
@@ -57,9 +87,14 @@ jobs: | |||||
runs-on: ubuntu-latest | ||||||
container: | ||||||
image: amd64/rust | ||||||
if: | | ||||||
github.event_name == 'push' || | ||||||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests') | ||||||
steps: | ||||||
- uses: actions/checkout@v4 | ||||||
with: | ||||||
# Check out the pull request branch if triggered by a comment | ||||||
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.ref || github.ref }} | ||||||
submodules: true | ||||||
fetch-depth: 1 | ||||||
- name: Setup Rust toolchain | ||||||
|
@@ -77,9 +112,14 @@ jobs: | |||||
runs-on: ubuntu-latest | ||||||
container: | ||||||
image: amd64/rust | ||||||
if: | | ||||||
github.event_name == 'push' || | ||||||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests') | ||||||
steps: | ||||||
- uses: actions/checkout@v4 | ||||||
with: | ||||||
# Check out the pull request branch if triggered by a comment | ||||||
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.ref || github.ref }} | ||||||
submodules: true | ||||||
fetch-depth: 1 | ||||||
- name: Setup Rust toolchain | ||||||
|
@@ -96,9 +136,14 @@ jobs: | |||||
runs-on: ubuntu-latest | ||||||
container: | ||||||
image: amd64/rust | ||||||
if: | | ||||||
github.event_name == 'push' || | ||||||
(github.event_name == 'issue_comment' && github.event.issue.pull_request && github.event.comment.body == 'run extended tests') | ||||||
steps: | ||||||
- uses: actions/checkout@v4 | ||||||
with: | ||||||
# Check out the pull request branch if triggered by a comment | ||||||
ref: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request.head.ref || github.ref }} | ||||||
submodules: true | ||||||
fetch-depth: 1 | ||||||
- name: Setup Rust toolchain | ||||||
|
@@ -107,3 +152,49 @@ jobs: | |||||
rust-version: stable | ||||||
- name: Run sqllogictest | ||||||
run: cargo test --profile release-nonlto --test sqllogictests -- --include-sqlite | ||||||
|
||||||
notify_if_run_on_pr_success: | ||||||
name: Notify | ||||||
runs-on: ubuntu-latest | ||||||
needs: | ||||||
[ | ||||||
linux-test-extended, | ||||||
hash-collisions, | ||||||
sqllogictest-sqlite, | ||||||
check_issue_comment, | ||||||
] | ||||||
if: success() | ||||||
steps: | ||||||
- uses: actions/github-script@v7 | ||||||
with: | ||||||
github-token: ${{secrets.GITHUB_TOKEN}} | ||||||
script: | | ||||||
github.rest.issues.createComment({ | ||||||
issue_number: context.issue.number, | ||||||
owner: context.repo.owner, | ||||||
repo: context.repo.repo, | ||||||
body: "extended test suite ran successfully on this PR." | ||||||
}) | ||||||
|
||||||
notify_if_run_on_pr_failure: | ||||||
name: Notify | ||||||
runs-on: ubuntu-latest | ||||||
needs: | ||||||
[ | ||||||
linux-test-extended, | ||||||
hash-collisions, | ||||||
sqllogictest-sqlite, | ||||||
check_issue_comment, | ||||||
] | ||||||
if: failure() | ||||||
steps: | ||||||
- uses: actions/github-script@v7 | ||||||
with: | ||||||
github-token: ${{secrets.GITHUB_TOKEN}} | ||||||
script: | | ||||||
github.rest.issues.createComment({ | ||||||
issue_number: context.issue.number, | ||||||
owner: context.repo.owner, | ||||||
repo: context.repo.repo, | ||||||
body: "extended test suite failed on this PR." | ||||||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we can create a check in the PR to show that the running the tests is in progress,
we can use https://octokit.github.io/rest.js/v21/#checks
to create a check if the comment is available,
and when the pipeline runs, we can update the check using the update the check
see in the docs that I have linked the "Update a check run" under the checks api
wdyt @alamb ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using other actions in an apache repo is problematic as I previously found out. However, it's not hard to have an action post a comment and then edit it to show progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it in my fork, see this PR:
It seems to have worked great
Here is the workflow run:
https://github.com/alamb/datafusion/actions/runs/13036912907
I am going to wait to see what happens on success and then I will purposely introduce a failure in extended tests and see what happens