From 327315f41c3d159a03bf917a5567e9307095b613 Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Mon, 11 Sep 2023 16:32:44 +0100 Subject: [PATCH] Drop replay option defaulting (#315) This is now BE-driven Blocked on the BE part of this going live. --- package.json | 8 ++-- src/action.ts | 29 +++----------- src/utils/constants.ts | 2 +- yarn.lock | 86 +++++++++++++++++++----------------------- 4 files changed, 49 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index e00d0ab7..d0807a65 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,11 @@ "dependencies": { "@actions/core": "^1.10.0", "@actions/github": "^5.1.1", - "@alwaysmeticulous/client": "^2.71.0", - "@alwaysmeticulous/common": "^2.70.0", + "@alwaysmeticulous/client": "^2.73.0", + "@alwaysmeticulous/common": "^2.73.0", "//": "Upgrading `replay-orchestrator-launcher`? Consider bumping the environment version `LOGICAL_ENVIRONMENT_VERSION` in `constants.ts` if the new version includes visible changes.", - "@alwaysmeticulous/replay-orchestrator-launcher": "^2.71.1", - "@alwaysmeticulous/sentry": "^2.40.3", + "@alwaysmeticulous/replay-orchestrator-launcher": "^2.73.0", + "@alwaysmeticulous/sentry": "^2.72.0", "@sentry/node": "^7.50.0", "lodash.debounce": "^4.0.8", "loglevel": "^1.8.1", diff --git a/src/action.ts b/src/action.ts index ba0eb949..82187996 100644 --- a/src/action.ts +++ b/src/action.ts @@ -1,15 +1,12 @@ import { setFailed } from "@actions/core"; import { context, getOctokit } from "@actions/github"; -import { applyDefaultExecutionOptionsFromProject } from "@alwaysmeticulous/client"; import { + DEFAULT_EXECUTION_OPTIONS, METICULOUS_LOGGER_NAME, setMeticulousLocalDataDir, } from "@alwaysmeticulous/common"; import { executeTestRun } from "@alwaysmeticulous/replay-orchestrator-launcher"; -import { - ReplayExecutionOptions, - RunningTestRunExecution, -} from "@alwaysmeticulous/sdk-bundles-api"; +import { RunningTestRunExecution } from "@alwaysmeticulous/sdk-bundles-api"; import { initSentry } from "@alwaysmeticulous/sentry"; import debounce from "lodash.debounce"; import log from "loglevel"; @@ -25,20 +22,9 @@ import { initLogger, setLogLevel, shortSha } from "./utils/logger.utils"; import { ResultsReporter } from "./utils/results-reporter"; import { waitForDeploymentUrl } from "./utils/wait-for-deployment-url"; -const DEFAULT_EXECUTION_OPTIONS: ReplayExecutionOptions = { - headless: true, - devTools: false, - bypassCSP: false, - shiftTime: true, - networkStubbing: true, - skipPauses: true, - moveBeforeClick: false, - disableRemoteFonts: false, +const EXECUTION_OPTIONS = { + ...DEFAULT_EXECUTION_OPTIONS, noSandbox: true, - maxDurationMs: 5 * 60 * 1_000, // 5 minutes - maxEventCount: null, - essentialFeaturesOnly: false, - logPossibleNonDeterminism: false, }; export const runMeticulousTestsAction = async (): Promise => { @@ -161,11 +147,6 @@ export const runMeticulousTestsAction = async (): Promise => { await throwIfCannotConnectToOrigin(urlToTestAgainst); } - const executionOptions = await applyDefaultExecutionOptionsFromProject({ - executionOptions: DEFAULT_EXECUTION_OPTIONS, - apiToken, - }); - const results = await executeTestRun({ testsFile, apiToken, @@ -173,7 +154,7 @@ export const runMeticulousTestsAction = async (): Promise => { baseCommitSha: shaToCompareAgainst, baseTestRunId: null, appUrl: urlToTestAgainst, - executionOptions, + executionOptions: EXECUTION_OPTIONS, screenshottingOptions: { enabled: true, storyboardOptions: { enabled: true }, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 71d2b444..f648d735 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -13,6 +13,6 @@ export const EXPECTED_PERMISSIONS_BLOCK = [ // The version of the environment in which a replay is executed. This should be bumped whenever // the environment changes in a way that would cause a replay to behave differently, e.g. upgrading to a newer // replay-orchestrator-launcher version, or changing the version of puppeteer. -export const LOGICAL_ENVIRONMENT_VERSION = 2; +export const LOGICAL_ENVIRONMENT_VERSION = 3; export const DOCS_URL = "https://app.meticulous.ai/docs/github-actions-v2"; diff --git a/yarn.lock b/yarn.lock index 8e7647c4..bea2ae74 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32,47 +32,39 @@ resolved "https://registry.yarnpkg.com/@alwaysmeticulous/api/-/api-2.70.0.tgz#3523886f32582edee8f52a455424369c52dec1be" integrity sha512-61U3cPZnlPuSerl/x8JPFqqGM/+dmjY+w5oNBbwUHShRoGVEJb11Dg+1ziHPoLffT+QKoM3g8XpuD3d4FIziZw== -"@alwaysmeticulous/api@^2.71.0": - version "2.71.0" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/api/-/api-2.71.0.tgz#e5268607674ddf8619fb493e893ddd1f9d4e914a" - integrity sha512-Bmug6Ye1mUgdeCsbJjuRQ4FSGb3JLXBWldgm1FEwyinKkOhwmDR69lA0T+Dv8HW3nlfxiiQdO+fxnN1qd3vu1g== - -"@alwaysmeticulous/client@^2.71.0": - version "2.71.0" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/client/-/client-2.71.0.tgz#f0a2cf9c518a4daab2117be8e64d33583b79b0c2" - integrity sha512-fzzIUxNj4gaH5Kco8f+RHeNrUbI1odliHHQ/O8br0xVEgOhsbVkI3kLiUYUDmsbd36aYBL/x6tCG+OyjAVK9yg== - dependencies: - "@alwaysmeticulous/api" "^2.71.0" - "@alwaysmeticulous/common" "^2.71.0" - "@alwaysmeticulous/sdk-bundles-api" "^2.71.0" +"@alwaysmeticulous/api@^2.73.0": + version "2.73.0" + resolved "https://registry.yarnpkg.com/@alwaysmeticulous/api/-/api-2.73.0.tgz#20d0c4e4ed1ae4f8b05cdbc08820c4281430160a" + integrity sha512-u4ZtmqvOovMcDhG8XJEjSWdzr9apEunL4HWvpF4L46L7HKF0vrk7Mwx2e0XT8C3Xn39TgbdMhKc++4W0ANtk5w== + +"@alwaysmeticulous/client@^2.73.0": + version "2.73.0" + resolved "https://registry.yarnpkg.com/@alwaysmeticulous/client/-/client-2.73.0.tgz#7e7bc3304306a091a537c64baf2e06e2fb7d4d66" + integrity sha512-WCv7EVjBfkaHG0RLqqki1eynt04iJBcT/v/TVfqbfDaaajrrbg+8y1Jl47if9vEvbc2lNtFxZGac1DjFBGtOJg== + dependencies: + "@alwaysmeticulous/api" "^2.73.0" + "@alwaysmeticulous/common" "^2.73.0" + "@alwaysmeticulous/sdk-bundles-api" "^2.73.0" axios "^1.2.6" axios-retry "^3.5.0" loglevel "^1.8.0" -"@alwaysmeticulous/common@^2.70.0": - version "2.70.0" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/common/-/common-2.70.0.tgz#72ace5a67a8759fbcfb1c155f01abaaa31783b9f" - integrity sha512-mkhbwuPb2v8MoLSPKxU9ucbDwKKiAeuL1BKoaQa51WJj+K5awB4q2i8VKoauF5tbv3UOS83IyWpbeM4MTvE31A== - dependencies: - loglevel "^1.8.0" - luxon "^3.2.1" - -"@alwaysmeticulous/common@^2.71.0": - version "2.71.0" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/common/-/common-2.71.0.tgz#7a8319a895e755b0b7e7923ad45a5dab1d31e272" - integrity sha512-sWWd9yTJl126CvZMiJ3TSYAqiBDlh37hofSOpA7h1IqXfQBpOLfooaOrVZdYh8Mhh/8XiU+Vdgiz4WVD5aXRQw== +"@alwaysmeticulous/common@^2.73.0": + version "2.73.0" + resolved "https://registry.yarnpkg.com/@alwaysmeticulous/common/-/common-2.73.0.tgz#a8a59aef4dafb8f6803c28de5fbf8c6feb9cb781" + integrity sha512-WizYQbToI+Ysm1rls7CtNfm5ykmHFJa8sS8breOQ9X5uXo7HPTPVU0krL9VIUr1ZmJAG+nv9iKNqKFXJsePAPg== dependencies: loglevel "^1.8.0" luxon "^3.2.1" -"@alwaysmeticulous/downloading-helpers@^2.71.1": - version "2.71.1" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/downloading-helpers/-/downloading-helpers-2.71.1.tgz#2ce3c515db7bea6ad99dc46833a22635e35b2fa3" - integrity sha512-6rYZdpbyvucjNJGbuMSeHyLaYgOcKun7RnLMP71gccGLh0c24ZED6pFVbmhObqVz5mCzrQh0DKY8Ib5dbuIhcw== +"@alwaysmeticulous/downloading-helpers@^2.73.0": + version "2.73.0" + resolved "https://registry.yarnpkg.com/@alwaysmeticulous/downloading-helpers/-/downloading-helpers-2.73.0.tgz#cc5b5744e02b7cb965eba846baff3ca1675668b1" + integrity sha512-mJbvoRAMHHY8EmK38ThfuxEHuNCj5MtSb1P4phCbT47nmV0GEoCrNXYK19JraYCzJFhuyWTjkLBmbZ9JoIHtTQ== dependencies: - "@alwaysmeticulous/api" "^2.71.0" - "@alwaysmeticulous/client" "^2.71.0" - "@alwaysmeticulous/common" "^2.71.0" + "@alwaysmeticulous/api" "^2.73.0" + "@alwaysmeticulous/client" "^2.73.0" + "@alwaysmeticulous/common" "^2.73.0" axios "^1.2.6" axios-retry "^3.5.0" extract-zip "^2.0.1" @@ -80,14 +72,14 @@ luxon "^3.2.1" proper-lockfile "^4.1.2" -"@alwaysmeticulous/replay-orchestrator-launcher@^2.71.1": - version "2.71.1" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/replay-orchestrator-launcher/-/replay-orchestrator-launcher-2.71.1.tgz#080486813258eff101407c1155962b7850649d31" - integrity sha512-Ax6bgzK7167ejEbHrrsJ2tIAfxPqK8kM2oZ7cFG2J+mLMuVKxqFEi/79PtI9ilY48zknlHkqAnwtNL1UX0kJIQ== +"@alwaysmeticulous/replay-orchestrator-launcher@^2.73.0": + version "2.73.0" + resolved "https://registry.yarnpkg.com/@alwaysmeticulous/replay-orchestrator-launcher/-/replay-orchestrator-launcher-2.73.0.tgz#cc9d1d968948bfc14b49eb6b1cafece957893e47" + integrity sha512-/Cjbv962q4Bld1m8uBnFGZwg2qWS54QWj4xGJfscb3/ScZmXblz3TzWJ7aQ55NSvTosZ9oCslPwZUD3XLYRMxQ== dependencies: - "@alwaysmeticulous/common" "^2.71.0" - "@alwaysmeticulous/downloading-helpers" "^2.71.1" - "@alwaysmeticulous/sdk-bundles-api" "^2.71.0" + "@alwaysmeticulous/common" "^2.73.0" + "@alwaysmeticulous/downloading-helpers" "^2.73.0" + "@alwaysmeticulous/sdk-bundles-api" "^2.73.0" loglevel "^1.8.0" puppeteer "19.11.1" @@ -96,15 +88,15 @@ resolved "https://registry.yarnpkg.com/@alwaysmeticulous/sdk-bundles-api/-/sdk-bundles-api-2.70.0.tgz#28b019f49f872d36b9f38a5238054a05fe693620" integrity sha512-bWd3c0nOsY/LKvUOTSu3ll1GGyqdWHrLrMbZKm1zLYDLQl9Mh6d7r0a2u1TBhPiw0thbDyufKQrClx2F3P5gnw== -"@alwaysmeticulous/sdk-bundles-api@^2.71.0": - version "2.71.0" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/sdk-bundles-api/-/sdk-bundles-api-2.71.0.tgz#c7350a58dac95a263f828c69c4e618f34defed8c" - integrity sha512-WNlxUUZ5Xgki9KchAfqKv5orvX+uq2MXgJ236YGO06fV08O1x3K9TRLqqs06y6I90s+CPUM3X5SX1csDLYja0Q== +"@alwaysmeticulous/sdk-bundles-api@^2.73.0": + version "2.73.0" + resolved "https://registry.yarnpkg.com/@alwaysmeticulous/sdk-bundles-api/-/sdk-bundles-api-2.73.0.tgz#20334fa234bf871c616ba79fdeff89fea5c6046d" + integrity sha512-aUGk1dhTPPcsjDtJSJpx5TrWpw53vmUIzYLjIuqRxdaC9kdmQ7UdJfffmg/PmBXtctefb+e2tsNEETg416LcdQ== -"@alwaysmeticulous/sentry@^2.40.3": - version "2.40.3" - resolved "https://registry.yarnpkg.com/@alwaysmeticulous/sentry/-/sentry-2.40.3.tgz#544814084023df5c945dc168f170d8b3520f045a" - integrity sha512-DCFBxjaCyICg+JZT4IsD1PnAxBHd78RMSRX4XmMpvWoamVk5GjdN7d6ZMBBOqsbkSxMXrzMA3Evky0mCriNg/A== +"@alwaysmeticulous/sentry@^2.72.0": + version "2.72.0" + resolved "https://registry.yarnpkg.com/@alwaysmeticulous/sentry/-/sentry-2.72.0.tgz#472391f330dc6b961c2be85da27ad93484cf517c" + integrity sha512-u8BL9/HApUTE2ZFW37c1qb3XPxPQGijJKxuLovkKmYr8+1a8Jgj/UzUOX0GP5AyHIGOI7c8MlgQpCYqEaZhhTw== dependencies: "@sentry/node" "^7.36.0" "@sentry/tracing" "^7.36.0"