Skip to content

Commit a7e1bb6

Browse files
committed
fix: pw-test must also store pw check bundles (mistakenly only added to deploy, test)
1 parent 624ae34 commit a7e1bb6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

packages/cli/src/commands/pw-test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { DEFAULT_REGION } from '../helpers/constants'
3737
import { cased } from '../sourcegen'
3838
import { shellQuote } from '../services/shell'
3939
import { Runtime } from '../runtimes'
40+
import { PlaywrightCheckLocalBundle } from '../constructs/playwright-check-bundle'
4041

4142
export default class PwTestCommand extends AuthCommand {
4243
static coreCommand = true
@@ -243,6 +244,31 @@ export default class PwTestCommand extends AuthCommand {
243244
}
244245
})()
245246

247+
const bundledChecksByType = {
248+
playwright: [] as string[],
249+
}
250+
251+
for (const [logicalId, { bundle }] of Object.entries(projectBundle.data.check)) {
252+
if (bundle instanceof PlaywrightCheckLocalBundle) {
253+
bundledChecksByType.playwright.push(logicalId)
254+
}
255+
}
256+
257+
if (bundledChecksByType.playwright.length) {
258+
this.style.actionStart('Uploading Playwright code bundles')
259+
try {
260+
for (const logicalId of bundledChecksByType.playwright) {
261+
const resourceData = projectBundle.data.check[logicalId]
262+
const bundle = resourceData.bundle as PlaywrightCheckLocalBundle
263+
resourceData.bundle = await bundle.store()
264+
}
265+
this.style.actionSuccess()
266+
} catch (err) {
267+
this.style.actionFailure()
268+
throw err
269+
}
270+
}
271+
246272
const checkBundles = Object.values(projectBundle.data.check)
247273

248274
if (!checkBundles.length) {

0 commit comments

Comments
 (0)