Skip to content

Commit 6a7da0b

Browse files
committed
test: adjust for git-artifacts _workflow run_ IDs being passed around
In 961ebdb (/release: pass the git-artifacts _workflow_ runs, 2023-03-08), I fixed the automation so that the actual `git-artifacts` workflow run IDs are passed to the `release-git` workflow run (_not_ the _Check Run_ ID which would not be helpful because it lacks the artifacts that need to be downloaded). But I forgot to adjust the tests! This here commit remedies that problem. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent f33e234 commit 6a7da0b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

__tests__/index.test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,13 @@ let mockQueueCheckRun = jest.fn(() => 'check-run-id')
270270
let mockUpdateCheckRun = jest.fn()
271271
let mockListCheckRunsForCommit = jest.fn((_context, _token, _owner, _repo, rev, checkRunName) => {
272272
if (rev === 'this-will-be-rc2') {
273+
const id = checkRunName === 'git-artifacts-x86_64' ? 8664 : 686
273274
const output = {
274275
title: 'Build Git -rc2 artifacts',
275-
summary: 'Build Git -rc2 artifacts from commit this-will-be-rc2 (tag-git run #987)'
276+
summary: 'Build Git -rc2 artifacts from commit this-will-be-rc2 (tag-git run #987)',
277+
text: `For details, see [this run](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/${id})`
276278
}
277-
if (checkRunName === 'git-artifacts-x86_64') return [{ id: 8664, status: 'completed', conclusion: 'success', output }]
278-
if (checkRunName === 'git-artifacts-i686') return [{ id: 686, status: 'completed', conclusion: 'success', output }]
279+
return [{ id, status: 'completed', conclusion: 'success', output }]
279280
}
280281
if (rev === 'dee501d15') {
281282
if (checkRunName === 'tag-git') return [{
@@ -508,7 +509,7 @@ The \`release-git\` workflow run [was started](dispatched-workflow-release-git.y
508509
expect(dispatchedWorkflows).toHaveLength(1)
509510
expect(dispatchedWorkflows[0].html_url).toEqual('dispatched-workflow-release-git.yml')
510511
expect(dispatchedWorkflows[0].payload.inputs).toEqual({
511-
git_artifacts_x86_64_workflow_run_id: 8664,
512-
git_artifacts_i686_workflow_run_id: 686
512+
git_artifacts_x86_64_workflow_run_id: "8664",
513+
git_artifacts_i686_workflow_run_id: "686"
513514
})
514515
})

0 commit comments

Comments
 (0)