@@ -11,8 +11,9 @@ import { cpus } from 'os'
1111import pLimit from 'p-limit'
1212import { setNextVersionInFixture } from './next-version-helpers.mjs'
1313
14- // This is the netlify testing application
15- export const SITE_ID = process . env . NETLIFY_SITE_ID ?? 'ee859ce9-44a7-46be-830b-ead85e445e53'
14+ // https://app.netlify.com/sites/next-runtime-testing
15+ const DEFAULT_SITE_ID = 'ee859ce9-44a7-46be-830b-ead85e445e53'
16+ export const SITE_ID = process . env . NETLIFY_SITE_ID ?? DEFAULT_SITE_ID
1617const NEXT_VERSION = process . env . NEXT_VERSION || 'latest'
1718
1819export interface DeployResult {
@@ -39,6 +40,10 @@ interface E2EConfig {
3940 * Some fixtures might pin to non-latest CLI versions. This is used to verify the used CLI version matches expected one
4041 */
4142 expectedCliVersion ?: string
43+ /**
44+ * Site ID to deploy to. Defaults to the `NETLIFY_SITE_ID` environment variable or a default site.
45+ */
46+ siteId ?: string
4247}
4348
4449/**
@@ -258,12 +263,12 @@ async function verifyFixture(isolatedFixtureRoot: string, { expectedCliVersion }
258263
259264async function deploySite (
260265 isolatedFixtureRoot : string ,
261- { packagePath, cwd = '' } : E2EConfig ,
266+ { packagePath, cwd = '' , siteId = SITE_ID } : E2EConfig ,
262267) : Promise < DeployResult > {
263268 console . log ( `🚀 Building and deploying site...` )
264269
265270 const outputFile = 'deploy-output.txt'
266- let cmd = `npx ntl deploy --build --site ${ SITE_ID } `
271+ let cmd = `npx ntl deploy --build --site ${ siteId } `
267272
268273 if ( packagePath ) {
269274 cmd += ` --filter ${ packagePath } `
@@ -273,7 +278,7 @@ async function deploySite(
273278 await execaCommand ( cmd , { cwd : siteDir , all : true } ) . pipeAll ?.( join ( siteDir , outputFile ) )
274279 const output = await readFile ( join ( siteDir , outputFile ) , 'utf-8' )
275280
276- const [ url ] = new RegExp ( / h t t p s : .+ r u n t i m e - t e s t i n g \. n e t l i f y \. a p p / gm) . exec ( output ) || [ ]
281+ const [ url ] = new RegExp ( / h t t p s : .+ \. n e t l i f y \. a p p / gm) . exec ( output ) || [ ]
277282 if ( ! url ) {
278283 throw new Error ( 'Could not extract the URL from the build logs' )
279284 }
0 commit comments