Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/test-optimization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:
with:
version: ${{ matrix.version }}
- uses: ./.github/actions/install
- name: Get latest Playwright version
- name: Get Playwright version from versions package.json
id: playwright-version
run: |
PLAYWRIGHT_VERSION=$(npm view @playwright/test version)
PLAYWRIGHT_VERSION=$(node -p "require('./packages/dd-trace/test/plugins/versions/package.json').dependencies['@playwright/test']")
echo "version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
echo "Latest Playwright version: $PLAYWRIGHT_VERSION"
echo "Playwright version: $PLAYWRIGHT_VERSION"
- name: Cache Playwright browsers
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,23 @@ describe('test optimization automatic log submission', () => {
'@playwright/test',
], true)

before(done => {
before(async () => {
cwd = sandboxCwd()
const { NODE_OPTIONS, ...restOfEnv } = process.env
// Install chromium (configured in integration-tests/playwright.config.js)
// *Be advised*: this means that we'll only be using chromium for this test suite
execSync('npx playwright install --with-deps chromium', { cwd, env: restOfEnv, stdio: 'inherit' })
webAppServer.listen(0, () => {
const address = webAppServer.address()
if (!address || typeof address === 'string') {
return done(new Error('Failed to determine web app server port'))
}
webAppPort = address.port
done()
// Must run in before hook: sandbox is created at test time so workflow can't install
execSync('npx playwright install chromium', { cwd, env: restOfEnv, stdio: 'inherit' })
await new Promise((resolve, reject) => {
webAppServer.listen(0, () => {
const address = webAppServer.address()
if (!address || typeof address === 'string') {
reject(new Error('Failed to determine web app server port'))
return
}
webAppPort = address.port
resolve()
})
})
})

Expand Down
Loading