mirror of
https://github.com/actions/deploy-pages.git
synced 2026-02-09 03:45:15 +00:00
Add extra test
This commit is contained in:
5
dist/index.js
generated
vendored
5
dist/index.js
generated
vendored
@@ -9660,7 +9660,10 @@ async function getArtifactMetadata({ githubToken, runId, artifactName }) {
|
||||
size: artifactSize
|
||||
}
|
||||
} catch (error) {
|
||||
core.error('Fetching artifact metadata failed', error)
|
||||
core.error(
|
||||
'Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages or Actions? Please re-run the deployment at a later time.',
|
||||
error
|
||||
)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -320,6 +320,23 @@ describe('Deployment', () => {
|
||||
artifactMetadataScope.done()
|
||||
})
|
||||
|
||||
it('fails with error message if list artifact endpoint returns 500', async () => {
|
||||
process.env.GITHUB_SHA = 'valid-build-version'
|
||||
|
||||
const artifactMetadataScope = nock(`https://api.github.com`)
|
||||
.get(
|
||||
`/repos/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}/artifacts?name=github-pages`
|
||||
)
|
||||
.reply(500, { message: 'oh no' })
|
||||
|
||||
const deployment = new Deployment()
|
||||
await expect(deployment.create(fakeJwt)).rejects.toThrow(
|
||||
`Failed to create deployment (status: 500) with build version valid-build-version. Server error, is githubstatus.com reporting a Pages outage? Please re-run the deployment at a later time.`
|
||||
)
|
||||
|
||||
artifactMetadataScope.done()
|
||||
})
|
||||
|
||||
it('warns if the artifact size is bigger than maximum', async () => {
|
||||
process.env.GITHUB_SHA = 'valid-build-version'
|
||||
const artifactSize = ONE_GIGABYTE + 1
|
||||
|
||||
@@ -43,7 +43,10 @@ async function getArtifactMetadata({ githubToken, runId, artifactName }) {
|
||||
size: artifactSize
|
||||
}
|
||||
} catch (error) {
|
||||
core.error('Fetching artifact metadata failed', error)
|
||||
core.error(
|
||||
'Fetching artifact metadata failed. Is githubstatus.com reporting issues with API requests, Pages or Actions? Please re-run the deployment at a later time.',
|
||||
error
|
||||
)
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user