Enable slow tests in nightly ADO pipeline and add on-demand workflow_dispatch trigger#466
Enable slow tests in nightly ADO pipeline and add on-demand workflow_dispatch trigger#466Copilot wants to merge 14 commits into
Conversation
…ia PR comment - Add runSlowTests parameter to ADO test-pip-wheels.yml template (default '1') to enable QDK_CHEMISTRY_RUN_SLOW_TESTS in nightly builds - Add workflow_dispatch input to GitHub Actions build-and-test.yaml to allow running slow tests on demand - Add slow-tests-on-demand.yaml workflow triggered by '@copilot run slow tests' PR comment that dispatches Build and Test with slow tests enabled Agent-Logs-Url: https://github.com/microsoft/qdk-chemistry/sessions/6d975f68-c9c1-4ef3-9659-3cace814bf78 Co-authored-by: lorisercole <30901257+lorisercole@users.noreply.github.com>
… wording - ADO test-pip-wheels.yml: change runSlowTests to type: boolean (default: true) - GitHub Actions build-and-test.yaml: change run_slow_tests to type: boolean - slow-tests-on-demand.yaml: accept '@copilot run slow tests', '@copilot run slow-tests', and '@copilot run tests' as triggers Agent-Logs-Url: https://github.com/microsoft/qdk-chemistry/sessions/ddb44b52-9955-4412-90c3-ec4df55c4b48 Co-authored-by: lorisercole <30901257+lorisercole@users.noreply.github.com>
📊 Coverage Summary
Detailed Coverage ReportsC++ Coverage DetailsPython Coverage DetailsPybind11 Coverage Details |
|
@copilot address the failing pre-commit test |
Agent-Logs-Url: https://github.com/microsoft/qdk-chemistry/sessions/735e4af4-62d7-45ba-8bf1-e78633122aa9 Co-authored-by: lorisercole <30901257+lorisercole@users.noreply.github.com>
|
@copilot write and update the description of this PR. |
Updated the PR description with a summary of all changes across the three files. |
|
@copilot run slow tests |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (3)
.github/workflows/slow-tests-on-demand.yaml:25
- The job-level
if:that checksgithub.event.issue.pull_requestand matches/qdkbot ...commands is currently commented out. As written, this workflow will run on every newissue_comment(including on issues that are not PRs), and will also run onpull_requestevents for the temporary branch trigger, causing unintended workflow dispatches (and likely 404s whenpulls.getis called for a non-PR issue). Re-enable anif:guard (or equivalent early-exit) so the workflow only runs for PR comments that contain the expected commands.
trigger-slow-tests:
name: Trigger Slow Tests
# if: >
# github.event.issue.pull_request && (
# contains(github.event.comment.body, '/qdkbot run slow tests') ||
# contains(github.event.comment.body, '/qdkbot run slow-tests') ||
# contains(github.event.comment.body, '/qdkbot run tests') ||
# contains(github.event.comment.body, '/qdkbot tests')
# )
runs-on: ubuntu-latest
.github/workflows/slow-tests-on-demand.yaml:45
- This workflow can be triggered by any user who can comment, which allows untrusted actors to repeatedly dispatch expensive CI runs. Add an authorization gate (e.g., check
github.event.comment.author_associationis OWNER/MEMBER/COLLABORATOR, or verify team membership) before dispatching.
- name: Get PR details
id: pr
uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const headRepoFullName = pr.data.head.repo.full_name;
const baseRepoFullName = pr.data.base.repo.full_name;
if (headRepoFullName !== baseRepoFullName) {
core.setFailed(`Cannot dispatch workflow for fork PRs (head repo: ${headRepoFullName}, base repo: ${baseRepoFullName}).`);
return;
}
core.setOutput('ref', pr.data.head.ref);
core.setOutput('sha', pr.data.head.sha);
.github/workflows/slow-tests-on-demand.yaml:14
- The workflow posts an acknowledgment via
github.rest.issues.createComment, but the workflow permissions do not includeissues: write.pull-requests: writedoes not grant access to the Issues Comments API, so this step will fail with 403. Addissues: write(or switch to an API that is covered by existing permissions).
permissions:
contents: read
pull-requests: write
actions: write
Agent-Logs-Url: https://github.com/microsoft/qdk-chemistry/sessions/2eca976c-6300-45bf-a114-0bf8d8565213 Co-authored-by: lorisercole <30901257+lorisercole@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
.github/workflows/qdk-bot.yaml:24
- The job-level
if:that restricts execution to PR comments containing/qdkbot ...commands is commented out. With the currenton: issue_commenttrigger, the job will run for every new comment (including non-command comments), which can lead to unintended workflow dispatches and noisy failures.
trigger-slow-tests:
name: Trigger Slow Tests
# if: >
# github.event.issue.pull_request && (
# contains(github.event.comment.body, '/qdkbot run slow tests') ||
# contains(github.event.comment.body, '/qdkbot run slow-tests') ||
# contains(github.event.comment.body, '/qdkbot run tests') ||
# contains(github.event.comment.body, '/qdkbot tests')
# )
Agent-Logs-Url: https://github.com/microsoft/qdk-chemistry/sessions/6fd43ba3-eba2-4f8f-b3d9-91cafe861233 Co-authored-by: lorisercole <30901257+lorisercole@users.noreply.github.com>
|
@copilot rewrite the PR description |
Updated the PR description to reflect the current state of the changes (two files: ADO template + GitHub Actions workflow dispatch input). |
|
I've just triggered it. Let's see if it works... https://github.com/microsoft/qdk-chemistry/actions/runs/26236398282 |

Wires up the
QDK_CHEMISTRY_RUN_SLOW_TESTSenvironment variable so that slow Python tests can be enabled on-demand or in nightly CI runs.Changes
ADO nightly pipeline (
.pipelines/templates/test-pip-wheels.yml)runSlowTestsboolean parameter (default:true) to the wheel-test template.QDK_CHEMISTRY_RUN_SLOW_TESTSinto both Docker and native test execution environments.GitHub Actions (
build-and-test.yaml)workflow_dispatchboolean inputrun_slow_tests(default:false).QDK_CHEMISTRY_RUN_SLOW_TESTSfor the Python test step ('1'when enabled,'0'otherwise).