Skip to content

Commit

Permalink
test: use branch/alias deploys for e2e test suite (#39222)
Browse files Browse the repository at this point in the history
* test: use branch/alias deploys for e2e test suite

* test: use permalink url and not alias url

---------

Co-authored-by: Michal Piechowiak <[email protected]>
  • Loading branch information
mrstork and pieh authored Jan 30, 2025
1 parent aa403a4 commit 346314d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion e2e-tests/adapters/scripts/deploy-and-run/netlify.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ const npmScriptToRun = process.argv[2] || "test:netlify"
// ensure clean build
await execa(`npm`, [`run`, `clean`], { stdio: `inherit` })

const deployAlias = "gatsby-e2e-tests"
const deployResults = await execa(
"npx",
[
"ntl",
"deploy",
"--build",
"--json",
"--alias",
deployAlias,
"--message",
deployTitle,
process.env.EXTRA_NTL_CLI_ARGS ?? "--cwd=.",
Expand All @@ -47,7 +50,9 @@ if (deployResults.exitCode !== 0) {

const deployInfo = JSON.parse(deployResults.stdout)

const deployUrl = deployInfo.deploy_url + (process.env.PATH_PREFIX ?? ``)
const deployUrl =
`https://${deployInfo.deploy_id}--${deployInfo.site_name}.netlify.app` +
(process.env.PATH_PREFIX ?? ``)
process.env.DEPLOY_URL = deployUrl

console.log(`Deployed to ${deployUrl}`)
Expand Down

0 comments on commit 346314d

Please sign in to comment.