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

add manual trigger for extended tests in pull requests #14331

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
91 changes: 91 additions & 0 deletions .github/workflows/extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,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({
Copy link
Contributor

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

octokit.rest.checks.update({
        owner,
repo,
check_run_id,
output.summary,
output.annotations[].path,
output.annotations[].start_line,
output.annotations[].end_line,
output.annotations[].annotation_level,
output.annotations[].message,
output.images[].alt,
output.images[].image_url,
actions[].label,
actions[].description,
actions[].identifier
      })

see in the docs that I have linked the "Update a check run" under the checks api

wdyt @alamb ?

Copy link
Contributor

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.

Copy link
Contributor

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

Screenshot 2025-01-29 at 12 26 18 PM

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

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 }}
submodules: true
fetch-depth: 1
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
Expand All @@ -55,9 +85,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
Expand All @@ -75,9 +110,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
Expand All @@ -94,9 +134,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
Expand All @@ -105,3 +150,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."
})