Skip to content

Commit fd43ea1

Browse files
committed
tests: verify MSYS2 runtime deployments
We are about to change for which architectures the two separate MSYS2 runtime packages are built: the v3.3.* legacy package will be built only for i686, the regular package only for x86_64. To ensure that those changes are done correctly, let's document the current behavior first. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 30ae420 commit fd43ea1

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

__tests__/index.test.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ let mockGitHubApiRequest = jest.fn((_context, _token, method, requestPath, paylo
109109
if (method === 'GET' && requestPath.endsWith('/pulls/74')) return {
110110
head: { sha: 'a7e4b90' }
111111
}
112+
if (method === 'GET' && requestPath.endsWith('/pulls/90')) return {
113+
head: { sha: '265d07e' }
114+
}
115+
if (method === 'GET' && requestPath.endsWith('/pulls/96')) return {
116+
head: { sha: 'b7b0dfc' }
117+
}
112118
if (method === 'GET' && requestPath.endsWith('/pulls/4322')) return {
113119
head: { sha: 'c8edb521bdabec14b07e9142e48cab77a40ba339' }
114120
}
@@ -389,6 +395,50 @@ The [i686/x86_64](dispatched-workflow-build-and-deploy.yml) and the [arm64](disp
389395
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['aarch64', undefined])
390396
})
391397

398+
testIssueComment('/deploy msys2-runtime', {
399+
issue: {
400+
number: 90,
401+
title: 'msys2-runtime: avoid sharing incompatible cygheaps, take two',
402+
body: 'This is a companion to https://github.com/git-for-windows/msys2-runtime/pull/49.',
403+
pull_request: {
404+
html_url: 'https://github.com/git-for-windows/MSYS2-packages/pull/90'
405+
}
406+
},
407+
repository: {
408+
name: 'MSYS2-packages'
409+
}
410+
}, async (context) => {
411+
expect(await index(context, context.req)).toBeUndefined()
412+
expect(context.res.body).toEqual(`I edited the comment: appended-comment-body-existing comment body
413+
414+
The [x86_64](dispatched-workflow-build-and-deploy.yml) and the [i686](dispatched-workflow-build-and-deploy.yml) workflow runs were started.`)
415+
expect(mockQueueCheckRun).toHaveBeenCalledTimes(2)
416+
expect(mockUpdateCheckRun).toHaveBeenCalledTimes(2)
417+
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686', 'x86_64'])
418+
})
419+
420+
testIssueComment('/deploy msys2-runtime-3.3', {
421+
issue: {
422+
number: 96,
423+
title: 'add a msys2-runtime-3.3 package',
424+
body: 'The first step of phase 2 of the current timeline(https://github.com/git-for-windows/git/issues/4279#issue-1577622335)',
425+
pull_request: {
426+
html_url: 'https://github.com/git-for-windows/MSYS2-packages/pull/96'
427+
}
428+
},
429+
repository: {
430+
name: 'MSYS2-packages'
431+
}
432+
}, async (context) => {
433+
expect(await index(context, context.req)).toBeUndefined()
434+
expect(context.res.body).toEqual(`I edited the comment: appended-comment-body-existing comment body
435+
436+
The [x86_64](dispatched-workflow-build-and-deploy.yml) and the [i686](dispatched-workflow-build-and-deploy.yml) workflow runs were started.`)
437+
expect(mockQueueCheckRun).toHaveBeenCalledTimes(2)
438+
expect(mockUpdateCheckRun).toHaveBeenCalledTimes(2)
439+
expect(dispatchedWorkflows.map(e => e.payload.inputs.architecture)).toEqual(['i686', 'x86_64'])
440+
})
441+
392442
testIssueComment('/add release note', {
393443
issue: {
394444
number: 4281,

0 commit comments

Comments
 (0)