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

Debug/parallel routes revalidation #2700

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:
DATADOG_TRACE_NEXTJS_TEST: true
DATADOG_API_KEY: foo
TEST_CONCURRENCY: 2
NEXT_E2E_TEST_TIMEOUT: 300000
NEXT_E2E_TEST_TIMEOUT: 600000
NEXT_TELEMETRY_DISABLED: 1
NEXT_SKIP_NATIVE_POSTINSTALL: 1
TURBO_API: ${{ secrets.TURBO_API }}
Expand Down Expand Up @@ -60,8 +60,8 @@ jobs:
echo "total=4" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "pull_request" ]; then
VERSION_SELECTORS=[\"latest\"]
echo "group=[1, 2, 3, 4]" >> $GITHUB_OUTPUT
echo "total=4" >> $GITHUB_OUTPUT
echo "group=[1]" >> $GITHUB_OUTPUT
echo "total=1" >> $GITHUB_OUTPUT
else
VERSION_SELECTORS=[\"latest\",\"canary\",\"14.2.15\",\"13.5.1\"]
echo "group=[1, 2, 3, 4]" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -198,7 +198,7 @@ jobs:
NODE_ENV: production
NEXT_EXTERNAL_TESTS_FILTERS: ${{ steps.test-filters.outputs.filters }}
NEXT_TEST_SKIP_RETRY_MANIFEST: ${{ steps.test-filters.outputs.skip-retry }}
run: node run-tests.js -g ${{ matrix.group }}/${{ needs.setup.outputs.total }} -c ${TEST_CONCURRENCY} --type e2e --timings
run: node run-tests.js -g ${{ matrix.group }}/${{ needs.setup.outputs.total }} -c ${TEST_CONCURRENCY} --type e2e --timings --test-pattern "(test/e2e/app-dir/parallel-route-not-found/parallel-route-not-found.test.ts|test/e2e/app-dir/reexport-client-component-metadata/reexport-client-component-metadata.test.ts|test/e2e/app-dir/revalidatetag-rsc/revalidatetag-rsc.test.ts|test/e2e/app-dir/route-page-manifest-bug/route-page-manifest-bug.test.ts|test/e2e/app-dir/rsc-webpack-loader/rsc-webpack-loader.test.ts|test/e2e/app-dir/parallel-routes-revalidation/parallel-routes-revalidation.test.ts|test/e2e/app-dir/scss/basic-module-include-paths/basic-module-include-paths.test.ts|test/e2e/app-dir/scss/catch-all-module/catch-all-module.test.ts)"
working-directory: ${{ env.next-path }}

- name: Upload Test Results
Expand Down
31 changes: 31 additions & 0 deletions tests/netlify-deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class NextDeployInstance extends NextInstance {
private _cliOutput: string
private _buildId: string
private _deployId: string
private _shouldDeleteDeploy: boolean = false

public get buildId() {
// get deployment ID via fetch since we can't access
Expand All @@ -50,6 +51,9 @@ export class NextDeployInstance extends NextInstance {
this._buildId = process.env.BUILD_ID
return
}

const setupStartTime = Date.now()

// create the test site
await super.createTestDir({ parentSpan, skipInstall: true })

Expand Down Expand Up @@ -146,6 +150,7 @@ export class NextDeployInstance extends NextInstance {
this._url = url
this._parsedUrl = new URL(this._url)
this._deployId = deployID
this._shouldDeleteDeploy = !process.env.NEXT_TEST_SKIP_CLEANUP
this._cliOutput = deployRes.stdout + deployRes.stderr
require('console').log(`Deployment URL: ${this._url}`)

Expand All @@ -169,6 +174,32 @@ export class NextDeployInstance extends NextInstance {
).trim()

require('console').log(`Got buildId: ${this._buildId}`)
require('console').log(`Setup time: ${(Date.now() - setupStartTime) / 1000.0}s`)
}

public async destroy(): Promise<void> {
if (this._shouldDeleteDeploy) {
require('console').log(`Deleting project with deploy_id ${this._deployId}`)

const deleteResponse = await execa('npx', [
'ntl',
'api',
'deleteDeploy',
'--data',
`{ "deploy_id": "${this._deployId}" }`,
])

if (deleteResponse.exitCode !== 0) {
require('console').error(
`Failed to delete deploy ${deleteResponse.stdout} ${deleteResponse.stderr} (${deleteResponse.exitCode})`,
)
} else {
require('console').log(`Successfully deleted deploy with deploy_id ${this._deployId}`)
this._shouldDeleteDeploy = false
}
}

await super.destroy()
}

public get cliOutput() {
Expand Down
Loading