Skip to content

Commit

Permalink
ci: fix integration tests (#1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
subzero10 authored Dec 27, 2023
1 parent 89139b5 commit c2d9161
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 26 deletions.
48 changes: 24 additions & 24 deletions packages/js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"cosmiconfig": "^8.3.6"
},
"devDependencies": {
"@playwright/test": "1.38.1",
"@playwright/test": "1.39.0",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-replace": "^5.0.2",
Expand Down
21 changes: 20 additions & 1 deletion packages/js/test/e2e/browserstack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,25 @@ const clientPlaywrightVersion = cp
.trim()
.split(' ')[1]

const getGitBranchUsingCommand = () => {
return cp
.execSync('git rev-parse --abbrev-ref HEAD')
.toString()
}

const getBuildLabel = () => {
let branchName = process.env.GITHUB_REF_NAME
if (!branchName) {
branchName = getGitBranchUsingCommand()
}

if (branchName.startsWith('fatal: not a git repository')) {
branchName = new Date().toDateString()
}

return `honeybadger-playwright-browserstack-${branchName}`
}

export const bsLocal = new BrowserStackLocal.Local()

export const BS_LOCAL_ARGS = {
Expand All @@ -23,7 +42,7 @@ const defaultCapabilities = {
os: 'osx',
os_version: 'catalina',
name: 'Honeybadger Integration Tests',
build: 'honeybadger-playwright-browserstack',
build: getBuildLabel(),
'browserstack.username': process.env.BROWSERSTACK_USERNAME,
'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
'browserstack.local': true, // we are running a local web server, so we need this to be true
Expand Down

0 comments on commit c2d9161

Please sign in to comment.