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

Fix and re-enable tets around retries/abuse limits #33

Merged
merged 1 commit into from
Jul 11, 2023
Merged
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
12 changes: 6 additions & 6 deletions action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('action', () => {
test('retries transient errors', (done) => {
const scope = nock('https://api.github.com')
.get('/repos/hashicorp/copywrite/releases/tags/v0.1.3')
.reply(500, 'expected transient error')
.replyWithError(500, 'expected transient error')
.get('/repos/hashicorp/copywrite/releases/tags/v0.1.3')
.reply(200, mockRelease)
.get('/repos/hashicorp/copywrite/releases/assets/3')
Expand All @@ -135,11 +135,11 @@ describe('action', () => {
done()
})
})
// TODO: fix failing tests
test.skip('retries abuse limit errors', (done) => {

test('retries abuse limit errors', (done) => {
const scope = nock('https://api.github.com')
.get('/repos/hashicorp/copywrite/releases/tags/v0.1.3')
.reply(403, {
.replyWithError(403, {
message: 'You have triggered an abuse detection mechanism and have been temporarily blocked from content creation. Please retry your request again later.',
documentation_url: 'https://docs.github.com/rest/overview/resources-in-the-rest-api#abuse-rate-limits'
})
Expand All @@ -164,10 +164,10 @@ describe('action', () => {
})
})

test.skip('retries rate limit errors', (done) => {
test('retries rate limit errors', (done) => {
const scope = nock('https://api.github.com')
.get('/repos/hashicorp/copywrite/releases/tags/v0.1.3')
.reply(429, 'expected rate limit error')
.replyWithError(429, 'expected rate limit error')
.get('/repos/hashicorp/copywrite/releases/tags/v0.1.3')
.reply(200, mockRelease)
.get('/repos/hashicorp/copywrite/releases/assets/3')
Expand Down