Skip to content

Commit 20e6ff2

Browse files
committed
pass ci build id
1 parent 131fbc4 commit 20e6ff2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,23 @@ async function runCypressTests (baseUrl, record, spec, group) {
6767
// https://on.cypress.io/module-api
6868
const cypress = require('cypress')
6969

70-
debug('run cypress params %o', { baseUrl, record, spec, group })
70+
let ciBuildId
71+
if (record) {
72+
// https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
73+
// unique build id we can use to link preBuild and postBuild recordings
74+
ciBuildId = process.env.BUILD_ID
75+
}
76+
77+
debug('run cypress params %o', { baseUrl, record, spec, group, ciBuildId })
7178

7279
return await cypress.run({
7380
config: {
7481
baseUrl,
7582
},
7683
spec,
7784
record,
78-
group
85+
group,
86+
ciBuildId
7987
})
8088
}
8189

0 commit comments

Comments
 (0)