Skip to content

Umutuzgur/sc 23256/pwt native code package simple #1042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 66 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
df79d4d
feat: add playwright config filepath flag
ferrandiaz Feb 20, 2025
e4bbc5d
feat: load project faster
ferrandiaz Feb 20, 2025
1c69242
feat: add endpoint to upload code bundle
ferrandiaz Feb 20, 2025
d2750f8
feat: add ability to parse playwright project
ferrandiaz Feb 20, 2025
94acdcf
fix: use source for bucket path
ferrandiaz Feb 24, 2025
19b61b8
fix: add dependency
ferrandiaz Feb 25, 2025
ce5f6ef
fix: use codeBundlePath instead of source
ferrandiaz Feb 27, 2025
7a01b04
feat: support Playwright construct with static method [sc-23256]
umutuzgur Mar 3, 2025
3d02352
fix: use absolute path of testDir [sc-23256]
umutuzgur Mar 3, 2025
2f92a78
fix: use absolute path of testDir [sc-23256]
umutuzgur Mar 3, 2025
f0ef2c5
feat: add playwrightConfig flag to deploy
ferrandiaz Mar 4, 2025
a8112f3
feat: update package-lock.json
clample Mar 4, 2025
0134d13
chore: simplify bundling and cleanup tar creation [sc-23256]
umutuzgur Mar 12, 2025
4312b50
chore: remove example project [sc-23256]
umutuzgur Mar 12, 2025
43b46a9
chore: remove example project [sc-23256]
umutuzgur Mar 12, 2025
23e7dd4
fix: create tmp dir correctly [sc-23256]
umutuzgur Mar 12, 2025
2527c42
chore: remove types as they come from the package now [sc-0]
umutuzgur Mar 17, 2025
d4f698c
fix: remove file loading and error omiting [sc-0]
umutuzgur Mar 18, 2025
be782c6
feat: add more PW params and browsers suppport [sc-0]
umutuzgur Mar 20, 2025
3a1c74c
feat: add more PW params and browsers suppport [sc-0]
umutuzgur Mar 20, 2025
5f65915
feat: add more PW params and browsers suppport [sc-0]
umutuzgur Mar 20, 2025
0175d3e
fix: handle use field not existing [sc-0]
umutuzgur Mar 20, 2025
6fb947b
fix: append projects correctly [sc-0]
umutuzgur Mar 20, 2025
40e36fd
fix: append projects correctly [sc-0]
umutuzgur Mar 20, 2025
7186c5d
fix: add a default browser if none was found [sc-0]
umutuzgur Mar 24, 2025
80b33fb
feat: bundle only files pwt is going to use
ferrandiaz Mar 31, 2025
414ac1d
fix: pass pw config path to the test command [sc-0]
umutuzgur Apr 1, 2025
6c68959
feat: run pwt checks without checkly config file
ferrandiaz Apr 4, 2025
00d6681
Merge branch 'main' into umutuzgur/sc-23256/pwt-native-code-package-s…
ferrandiaz Apr 4, 2025
602cc74
fix: modify default frequency to 10m
ferrandiaz Apr 7, 2025
2dc4a84
feat: write checkly config file if it does not exist
ferrandiaz Apr 7, 2025
895168b
fix: allow regex
ferrandiaz Apr 7, 2025
6e0c662
fix: re-add bundle output file flag
ferrandiaz Apr 7, 2025
f6e060e
fix: support include field for bundling [sc-0]
umutuzgur Apr 8, 2025
91b5df2
fix: remove default config fields
ferrandiaz Apr 9, 2025
231388b
feat: allow null install command
ferrandiaz Apr 9, 2025
67ed81d
Merge branch 'main' into umutuzgur/sc-23256/pwt-native-code-package-s…
ferrandiaz Apr 9, 2025
7283fc7
fix: use canary label without event
ferrandiaz Apr 9, 2025
0140338
fix: workflow
ferrandiaz Apr 9, 2025
30d1509
fix: workflow
ferrandiaz Apr 9, 2025
f57b604
fix: only support test files with the regex and ignore node_modules […
umutuzgur Apr 10, 2025
6de7e35
feat: allow .js config files for playwright
ferrandiaz Apr 10, 2025
daa9405
feat: add group support for playwright checks
ferrandiaz Apr 15, 2025
985f579
Merge branch 'main' into umutuzgur/sc-23256/pwt-native-code-package-s…
ferrandiaz Apr 15, 2025
920849e
feat: install dependencies after merge
ferrandiaz Apr 15, 2025
ed7d7e8
Merge branch 'main' into umutuzgur/sc-23256/pwt-native-code-package-s…
ferrandiaz Apr 16, 2025
f828afd
fix: remove unused dep
ferrandiaz Apr 22, 2025
b38f7f8
feat: allow support for global setup/teardown
ferrandiaz Apr 22, 2025
fe47192
Merge branch 'main' into umutuzgur/sc-23256/pwt-native-code-package-s…
ferrandiaz Apr 22, 2025
c51987f
chore: cleanup file definition access [sc-0]
umutuzgur Apr 22, 2025
12cfc40
chore: add runParallel support [sc-0]
umutuzgur Apr 22, 2025
fa372d6
chore: remove gitignore support [sc-0]
umutuzgur Apr 23, 2025
a4b8d5e
chore: use pw config class to dissect info about pw config [sc-0]
umutuzgur Apr 28, 2025
b2477fd
fix: load file if exists
ferrandiaz Apr 29, 2025
fb5e96c
Merge branch 'main' into umutuzgur/sc-23256/pwt-native-code-package-s…
ferrandiaz Apr 29, 2025
aba26f3
feat: add snapshot bundling [sc-0]
umutuzgur May 5, 2025
c3e171d
feat: add pnpm and yarn files
ferrandiaz May 6, 2025
f681793
feat: use generic package manager for test command
ferrandiaz May 6, 2025
878e7f7
fix: throw an error when the group cant be found [sc-0]
umutuzgur May 6, 2025
4ff8089
Merge branch 'main' into umutuzgur/sc-23256/pwt-native-code-package-s…
umutuzgur May 8, 2025
8607983
chore: update package lock [sc-0]
umutuzgur May 8, 2025
93e068b
fix: throw error when could not parse files/deps
ferrandiaz May 14, 2025
762ad63
feat: add logicalId to pwt native checks
ferrandiaz May 14, 2025
f272056
fix: race condition on loading checks
ferrandiaz May 14, 2025
88680f7
fix: missing imports test file
ferrandiaz May 14, 2025
680d147
fix: improve formatting for multiple links
ferrandiaz May 14, 2025
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
24 changes: 14 additions & 10 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ jobs:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
# Extract the dynamic value from the canary label if present
- name: Extract dynamic value from canary label
- name: Extract CANARY_TAG
id: extract-canary
run: |
if [[ "${GITHUB_EVENT_LABEL_NAME}" == canary:* ]]; then
CANARY_TAG="${GITHUB_EVENT_LABEL_NAME#canary:}"
echo "CANARY_TAG=${CANARY_TAG}" >> $GITHUB_ENV
fi
env:
GITHUB_EVENT_LABEL_NAME: ${{ github.event.label.name }}
export LABELS_JSON='${{ toJson(github.event.pull_request.labels) }}'
CANARY_TAG=$(node -e "
const labels = JSON.parse(process.env.LABELS_JSON || '[]');
const canaryLabel = labels.find(label => label.name.startsWith('canary:'));
if (canaryLabel) console.log(canaryLabel.name.split(':')[1]);
")
echo "CANARY_TAG=$CANARY_TAG" >> $GITHUB_ENV
# Ensure that the README is published with the package
- run: rm -f packages/cli/README.md && cp README.md packages/cli
- run: echo "PR_VERSION=0.0.0-pr.${{github.event.pull_request.number}}.$(git rev-parse --short HEAD)" >> $GITHUB_ENV
Expand All @@ -36,10 +37,13 @@ jobs:
# Publish to npm with the additional tag if CANARY_TAG is set
- run: |
npm publish --workspace packages/cli --tag experimental
if [[ -n "${{ env.CANARY_TAG }}" ]]; then
npm dist-tag add checkly@${{ env.PR_VERSION }} ${{ env.CANARY_TAG }}
fi
if [[ -n "$CANARY_TAG" ]]; then
echo "Publishing with additional tag: $CANARY_TAG"
npm dist-tag add checkly@$PR_VERSION $CANARY_TAG
fi
env:
CANARY_TAG: ${{ env.CANARY_TAG }}
PR_VERSION: ${{ env.PR_VERSION }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: marocchino/sticky-pull-request-comment@v2
with:
Expand Down
11,318 changes: 744 additions & 10,574 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@
"@oclif/plugin-not-found": "^3.2.44",
"@oclif/plugin-plugins": "^5.4.36",
"@oclif/plugin-warn-if-update-available": "^3.1.35",
"@types/archiver": "6.0.3",
"@typescript-eslint/typescript-estree": "^8.30.0",
"acorn": "^8.14.1",
"acorn-walk": "^8.3.4",
"archiver": "7.0.1",
"axios": "^1.8.4",
"chalk": "^4.1.2",
"ci-info": "^4.2.0",
Expand All @@ -89,6 +91,7 @@
"jwt-decode": "^3.1.2",
"log-symbols": "^4.1.0",
"luxon": "^3.6.1",
"minimatch": "9.0.5",
"mqtt": "^5.11.0",
"open": "^8.4.2",
"p-queue": "^6.6.2",
Expand Down
18 changes: 17 additions & 1 deletion packages/cli/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { Runtime } from '../rest/runtimes'
import {
Check, AlertChannelSubscription, AlertChannel, CheckGroup, Dashboard,
MaintenanceWindow, PrivateLocation, PrivateLocationCheckAssignment, PrivateLocationGroupAssignment,
Project, ProjectData, BrowserCheck,
Project, ProjectData, BrowserCheck, PlaywrightCheck,
} from '../constructs'
import chalk from 'chalk'
import { splitConfigFilePath, getGitInformation } from '../services/util'
Expand Down Expand Up @@ -114,6 +114,9 @@ export default class Deploy extends AuthCommand {
defaultRuntimeId: account.runtimeId,
verifyRuntimeDependencies,
checklyConfigConstructs,
playwrightConfigPath: checklyConfig.checks?.playwrightConfigPath,
include: checklyConfig.checks?.include,
playwrightChecks: checklyConfig.checks?.playwrightChecks,
})
const repoInfo = getGitInformation(project.repoUrl)

Expand All @@ -128,6 +131,19 @@ export default class Deploy extends AuthCommand {
}
check.snapshots = await uploadSnapshots(check.rawSnapshots)
}

for (const check of Object.values(project.data.check)) {
// TODO: Improve bundling and uploading
if (!(check instanceof PlaywrightCheck) || check.codeBundlePath) {
continue
}
const {
relativePlaywrightConfigPath, browsers, key,
} = await PlaywrightCheck.bundleProject(check.playwrightConfigPath, check.include)
check.codeBundlePath = key
check.browsers = browsers
check.playwrightConfigPath = relativePlaywrightConfigPath
}
Comment on lines +135 to +146
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

New code to bundle Playwright checks during deployment.

The implementation follows the same pattern as browser check snapshot handling, bundling Playwright projects and updating check metadata before deployment.

The TODO comment mentions that bundling and uploading should be improved. Consider tracking this as a separate ticket for future optimization.


🏁 Script executed:

#!/bin/bash
# Check for similar bundling patterns in the codebase that could be consolidated
rg -A 2 "bundleProject" --type ts

Length of output: 1502


Approve Playwright bundling implementation; consolidate repetition and track TODO

The new bundling code in deploy.ts follows the established pattern in test.ts and project-parser.ts and correctly updates the PlaywrightCheck metadata before deployment. However, there’s repeated logic across three locations:

• packages/cli/src/commands/deploy.ts (lines 135–146)
• packages/cli/src/commands/test.ts (similar bundleProject call and metadata assignment)
• packages/cli/src/services/project-parser.ts (bundleProject + instantiation)

Suggestions:

  • Extract the repeated metadata‐assignment block (setting codeBundlePath, browsers, playwrightConfigPath) into a shared helper or method on PlaywrightCheck.
  • Track the “TODO: Improve bundling and uploading” as a separate ticket to revisit performance and network‐stream optimizations.
🤖 Prompt for AI Agents
In packages/cli/src/commands/deploy.ts around lines 135 to 146, the code for
bundling Playwright checks duplicates logic found in test.ts and
project-parser.ts. To fix this, refactor by extracting the repeated metadata
assignment (setting codeBundlePath, browsers, and playwrightConfigPath) into a
shared helper function or a method on the PlaywrightCheck class. Also, ensure
the existing TODO about improving bundling and uploading is tracked separately
as a future enhancement ticket.

}

const projectPayload = project.synthesize(false)
Expand Down
19 changes: 18 additions & 1 deletion packages/cli/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { filterByFileNamePattern, filterByCheckNamePattern, filterByTags } from '../services/test-filters'
import type { Runtime } from '../rest/runtimes'
import { AuthCommand } from './authCommand'
import { BrowserCheck, Check, HeartbeatCheck, MultiStepCheck, Project, RetryStrategyBuilder, Session } from '../constructs'
import { BrowserCheck, Check, HeartbeatCheck, MultiStepCheck, PlaywrightCheck, Project, RetryStrategyBuilder, Session } from '../constructs'
import type { Region } from '..'
import { splitConfigFilePath, getGitInformation, getCiInformation, getEnvs } from '../services/util'
import { createReporters, ReporterType } from '../reporters/reporter'
Expand Down Expand Up @@ -146,6 +146,7 @@
'update-snapshots': updateSnapshots,
retries,
'verify-runtime-dependencies': verifyRuntimeDependencies,
playwrightConfig,

Check warning on line 149 in packages/cli/src/commands/test.ts

View workflow job for this annotation

GitHub Actions / lint

'playwrightConfig' is assigned a value but never used
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Unused playwrightConfig parameter.

The playwrightConfig flag is defined but never used in the code.

Either remove this unused parameter or implement its functionality. The static analyzer flagged this as well.

-      playwrightConfig,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
playwrightConfig,
🧰 Tools
🪛 GitHub Check: lint

[warning] 149-149:
'playwrightConfig' is assigned a value but never used

🤖 Prompt for AI Agents
In packages/cli/src/commands/test.ts at line 149, the parameter playwrightConfig
is defined but not used anywhere in the code. To fix this, either remove the
playwrightConfig parameter entirely if it is unnecessary, or implement the
intended functionality that uses this parameter to avoid unused variable
warnings and improve code clarity.

} = flags
const filePatterns = argv as string[]

Expand Down Expand Up @@ -182,6 +183,9 @@
defaultRuntimeId: account.runtimeId,
verifyRuntimeDependencies,
checklyConfigConstructs,
playwrightConfigPath: checklyConfig.checks?.playwrightConfigPath,
include: checklyConfig.checks?.include,
playwrightChecks: checklyConfig.checks?.playwrightChecks,
})
const checks = Object.entries(project.data.check)
.filter(([, check]) => {
Expand Down Expand Up @@ -230,6 +234,19 @@
check.snapshots = await uploadSnapshots(check.rawSnapshots)
}

for (const check of checks) {
// TODO: Improve bundling and uploading
if (!(check instanceof PlaywrightCheck) || check.codeBundlePath) {
continue
}
const {
relativePlaywrightConfigPath, browsers, key,
} = await PlaywrightCheck.bundleProject(check.playwrightConfigPath, check.include)
check.codeBundlePath = key
check.browsers = browsers
check.playwrightConfigPath = relativePlaywrightConfigPath
}

if (this.fancy) {
ux.action.stop()
}
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/constructs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ export * from './telegram-alert-channel'
export * from './status-page'
export * from './status-page-service'
export * from './incident'
export * from './playwright-check'
124 changes: 124 additions & 0 deletions packages/cli/src/constructs/playwright-check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import fs from 'fs'
import type { AxiosResponse } from 'axios'
import { Check, CheckProps } from './check'
import { Session } from './project'
import {
bundlePlayWrightProject, cleanup,
} from '../services/util'
import { checklyStorage } from '../rest/api'
import { ValidationError } from './validator-error'

export interface PlaywrightCheckProps extends CheckProps {
playwrightConfigPath: string
codeBundlePath?: string
installCommand?: string
testCommand?: string
pwProjects?: string|string[]
pwTags?: string|string[]
browsers?: string[]
include?: string|string[]
groupName?: string
logicalId: string
}

Comment on lines +11 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Redundant logicalId property in props causes API misuse

PlaywrightCheckProps requires a logicalId, yet the constructor already receives logicalId as its first positional argument and ignores the value in props.
This forces callers to supply the same value twice and risks accidental divergence.

Recommend dropping the field from the interface:

 export interface PlaywrightCheckProps extends CheckProps {
   playwrightConfigPath: string
   codeBundlePath?: string
@@
-  groupName?: string
-  logicalId: string
+  groupName?: string
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export interface PlaywrightCheckProps extends CheckProps {
playwrightConfigPath: string
codeBundlePath?: string
installCommand?: string
testCommand?: string
pwProjects?: string|string[]
pwTags?: string|string[]
browsers?: string[]
include?: string|string[]
groupName?: string
logicalId: string
}
export interface PlaywrightCheckProps extends CheckProps {
playwrightConfigPath: string
codeBundlePath?: string
installCommand?: string
testCommand?: string
pwProjects?: string|string[]
pwTags?: string|string[]
browsers?: string[]
include?: string|string[]
groupName?: string
}
🤖 Prompt for AI Agents
In packages/cli/src/constructs/playwright-check.ts between lines 11 and 23,
remove the redundant logicalId property from the PlaywrightCheckProps interface
since logicalId is already passed as the first positional argument to the
constructor and the value in props is ignored. This prevents API misuse by
avoiding the need to supply logicalId twice and eliminates the risk of
inconsistent values.

export class PlaywrightCheck extends Check {
installCommand?: string
testCommand: string
playwrightConfigPath: string
pwProjects: string[]
pwTags: string[]
codeBundlePath?: string
browsers?: string[]
include: string[]
groupName?: string
name: string
constructor (logicalId: string, props: PlaywrightCheckProps) {
super(logicalId, props)
this.logicalId = logicalId
this.name = props.name
this.codeBundlePath = props.codeBundlePath
this.installCommand = props.installCommand
this.browsers = props.browsers
this.pwProjects = props.pwProjects
? (Array.isArray(props.pwProjects) ? props.pwProjects : [props.pwProjects])
: []
this.pwTags = props.pwTags
? (Array.isArray(props.pwTags) ? props.pwTags : [props.pwTags])
: []
this.include = props.include
? (Array.isArray(props.include) ? props.include : [props.include])
: []
this.testCommand = props.testCommand ?? 'npx playwright test'
if (!fs.existsSync(props.playwrightConfigPath)) {
throw new ValidationError(`Playwright config doesnt exist ${props.playwrightConfigPath}`)
}
this.groupName = props.groupName
this.playwrightConfigPath = props.playwrightConfigPath
this.applyGroup(this.groupName)
Session.registerConstruct(this)
}

applyGroup (groupName?: string) {
if (!groupName) {
return
}
const checkGroups = Session.project?.data?.['check-group']
if (!checkGroups) {
return
}
const group = Object.values(checkGroups).find(group => group.name === groupName)
if (group) {
this.groupId = group.ref()
} else {
throw new ValidationError(`Error: No group named "${groupName}". Please verify the group exists in your code or create it.`)
}
}

getSourceFile () {
return this.__checkFilePath ?? this.logicalId
}

static buildTestCommand (
testCommand: string, playwrightConfigPath: string, playwrightProject?: string[], playwrightTag?: string[],
) {
return `${testCommand} --config ${playwrightConfigPath}${playwrightProject?.length ? ' --project ' + playwrightProject.map(project => `"${project}"`).join(' ') : ''}${playwrightTag?.length ? ' --grep="' + playwrightTag.join('|') + '"' : ''}`
}

static async bundleProject (playwrightConfigPath: string, include: string[]) {
let dir = ''
try {
const {
outputFile, browsers, relativePlaywrightConfigPath,
} = await bundlePlayWrightProject(playwrightConfigPath, include)
dir = outputFile
const { data: { key } } = await PlaywrightCheck.uploadPlaywrightProject(dir)
return { key, browsers, relativePlaywrightConfigPath }
} finally {
await cleanup(dir)
}
}

static async uploadPlaywrightProject (dir: string): Promise<AxiosResponse> {
const { size } = await fs.promises.stat(dir)
const stream = fs.createReadStream(dir)
return checklyStorage.uploadCodeBundle(stream, size)
}


synthesize () {
const testCommand = PlaywrightCheck.buildTestCommand(
this.testCommand,
this.playwrightConfigPath,
this.pwProjects,
this.pwTags,
)
return {
...super.synthesize(),
checkType: 'PLAYWRIGHT',
codeBundlePath: this.codeBundlePath,
testCommand,
installCommand: this.installCommand,
browsers: this.browsers,
}
}
}
12 changes: 6 additions & 6 deletions packages/cli/src/reporters/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ export default class ListReporter extends AbstractListReporter {
printLn(formatCheckTitle(CheckStatus.RETRIED, checkResult, { printRetryDuration: true }))
printLn(indentString(formatCheckResult(checkResult), 4), 2, 1)
if (links) {
printLn(indentString('View result: ' + chalk.underline.cyan(`${links.testResultLink}`), 4))
printLn(indentString('View result: ' + chalk.underline.cyan(links.testResultLink), 4))
if (links.testTraceLinks?.length) {
// TODO: print all video files URLs
printLn(indentString('View trace : ' + chalk.underline.cyan(links.testTraceLinks.join(', ')), 4))
printLn(indentString('View trace : ' + links.testTraceLinks.map(link => chalk.underline.cyan(link)).join(', '), 4))
}
if (links.videoLinks?.length) {
// TODO: print all trace files URLs
printLn(indentString('View video : ' + chalk.underline.cyan(`${links.videoLinks.join(', ')}`), 4))
printLn(indentString('View video : ' + links.videoLinks.map(link => chalk.underline.cyan(link)).join(', '), 4))
}
printLn('')
}
Expand All @@ -76,14 +76,14 @@ export default class ListReporter extends AbstractListReporter {
}

if (links) {
printLn(indentString('View result: ' + chalk.underline.cyan(`${links.testResultLink}`), 4))
printLn(indentString('View result: ' + chalk.underline.cyan(links.testResultLink), 4))
if (links.testTraceLinks?.length) {
// TODO: print all video files URLs
printLn(indentString('View trace : ' + chalk.underline.cyan(links.testTraceLinks.join(', ')), 4))
printLn(indentString('View trace : ' + links.testTraceLinks.map(link => chalk.underline.cyan(link)).join(', '), 4))
}
if (links.videoLinks?.length) {
// TODO: print all trace files URLs
printLn(indentString('View video : ' + chalk.underline.cyan(`${links.videoLinks.join(', ')}`), 4))
printLn(indentString('View video : ' + links.videoLinks.map(link => chalk.underline.cyan(link)).join(', '), 4))
}
printLn('')
}
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/rest/checkly-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ class ChecklyStorage {
)
}

uploadCodeBundle (stream: Readable, size: number) {
return this.api.post<{ key: string }>(
'/next/checkly-storage/upload-code-bundle',
stream,
{ headers: { 'Content-Type': 'application/octet-stream', 'content-length': size } },
)
}

download (key: string) {
return this.api.post('/next/checkly-storage/download', { key }, { responseType: 'stream' })
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
testMatch: 'tests.*.ts',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'Chromium',
}
],

});
Loading
Loading