Skip to content

Commit f876f57

Browse files
authored
chore: improve reliability of deploy integration tests (#7951)
* ci: create integration test sites in testing account This [mechanism already exists](https://github.com/netlify/cli/blob/b80b98f85929803fc35a08458c9327dc7ef63de0/tests/integration/utils/create-live-test-site.ts#L22-L36) but wasn't being used here, so it was falling back to the first account the user has access to that is returned by the accounts API. The `netlify-integration-testing` account is properly configured to host our various integration test sites, e.g. to avoid being rate limited. * ci: try DEBUG_TESTS=1 * Revert "ci: try DEBUG_TESTS=1" This reverts commit 2d186bf. * chore: bump deploy integration test timeout and concurrency
1 parent b80b98f commit f876f57

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
# We set a flag so we can skip tests that access Netlify API
7070
NETLIFY_TEST_DISABLE_LIVE:
7171
${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
72+
NETLIFY_TEST_ACCOUNT_SLUG: 'netlify-integration-testing'
7273
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
7374
# NETLIFY_TEST_GITHUB_TOKEN is used to avoid reaching GitHub API limits in exec-fetcher.js
7475
NETLIFY_TEST_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tests/integration/commands/deploy/deploy.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url'
55
import { load } from 'cheerio'
66
import execa from 'execa'
77
import fetch from 'node-fetch'
8-
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
8+
import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest'
99

1010
import { callCli } from '../../utils/call-cli.js'
1111
import { createLiveTestSite, generateSiteName } from '../../utils/create-live-test-site.js'
@@ -86,7 +86,13 @@ const context: { account: unknown; siteId: string } = {
8686
account: undefined,
8787
}
8888

89-
describe.skipIf(process.env.NETLIFY_TEST_DISABLE_LIVE === 'true').concurrent('commands/deploy', () => {
89+
const disableLiveTests = process.env.NETLIFY_TEST_DISABLE_LIVE === 'true'
90+
91+
// Running multiple entire build + deploy cycles concurrently results in a lot of network requests that may
92+
// cause resource contention anyway, so lower the default concurrency from 5 to 3.
93+
vi.setConfig({ maxConcurrency: 3 })
94+
95+
describe.skipIf(disableLiveTests).concurrent('commands/deploy', { timeout: 300_000 }, () => {
9096
beforeAll(async () => {
9197
const { account, siteId } = await createLiveTestSite(SITE_NAME)
9298
context.siteId = siteId

0 commit comments

Comments
 (0)