@empiricalrun/test-run 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @empiricalrun/test-run
2
2
 
3
+ ## 0.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 333b99f: fix: test run tool should report correct status
8
+ - 3739bc0: fix: replace tsx with an execSync call to fetch playwright projects
9
+
3
10
  ## 0.9.2
4
11
 
5
12
  ### Patch Changes
package/dist/bin/index.js CHANGED
@@ -95,6 +95,7 @@ dotenv_1.default.config({
95
95
  const projectFilters = await (0, utils_1.generateProjectFilters)({
96
96
  platform,
97
97
  filteringSets: [...options.project, ...environmentSpecificProjects],
98
+ repoDir: process.cwd(),
98
99
  });
99
100
  if (options.skipTeardown) {
100
101
  await (0, utils_1.handleTeardownSkipFlag)(directory);
@@ -107,6 +108,7 @@ dotenv_1.default.config({
107
108
  projects: projectFilters,
108
109
  passthroughArgs: pwOptions.join(" "),
109
110
  platform,
111
+ repoDir: process.cwd(),
110
112
  });
111
113
  }
112
114
  else {
package/dist/index.d.ts CHANGED
@@ -2,12 +2,13 @@ import { spawnCmd } from "./lib/cmd";
2
2
  import { runSpecificTestsCmd } from "./lib/run-specific-test";
3
3
  import { TestCase } from "./types";
4
4
  export { runSpecificTestsCmd, spawnCmd };
5
- export declare function runSingleTest({ testName, suites, fileName, projects, envOverrides, }: {
5
+ export declare function runSingleTest({ testName, suites, fileName, projects, envOverrides, repoDir, }: {
6
6
  testName: string;
7
7
  suites: string[];
8
8
  fileName: string;
9
9
  projects: string[];
10
10
  envOverrides?: Record<string, string>;
11
+ repoDir: string;
11
12
  }): Promise<{
12
13
  hasTestPassed: boolean;
13
14
  summaryJson: any;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAA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M,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;;;GAkBA;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;CACjD,CAAC,CAaD"}
package/dist/index.js CHANGED
@@ -18,17 +18,18 @@ const utils_1 = require("./utils");
18
18
  // For test-run package, the library entrypoint, we only support web platform
19
19
  // The bin entrypoint has support for mobile also
20
20
  const supportedPlatform = types_1.Platform.WEB;
21
- async function runSingleTest({ testName, suites, fileName, projects, envOverrides, }) {
21
+ async function runSingleTest({ testName, suites, fileName, projects, envOverrides, repoDir, }) {
22
22
  const testDir = "tests";
23
- const filePath = path_1.default.relative(process.cwd(), fileName);
23
+ const filePath = path_1.default.relative(repoDir, fileName);
24
24
  const commandToRun = await (0, run_specific_test_1.runSpecificTestsCmd)({
25
25
  tests: [{ name: testName, dir: testDir, filePath, suites }],
26
26
  projects,
27
27
  envOverrides,
28
28
  platform: supportedPlatform,
29
+ repoDir,
29
30
  });
30
31
  const { hasTestPassed } = await (0, cmd_1.runTestsForCmd)(commandToRun);
31
- const jsonFilePath = path_1.default.join(process.cwd(), "playwright-report", `summary.json`);
32
+ const jsonFilePath = path_1.default.join(repoDir, "playwright-report", `summary.json`);
32
33
  const jsonFileContents = await promises_1.default.readFile(jsonFilePath, "utf8");
33
34
  const summaryJson = JSON.parse(jsonFileContents);
34
35
  return {
@@ -38,12 +39,12 @@ async function runSingleTest({ testName, suites, fileName, projects, envOverride
38
39
  }
39
40
  async function getAllPlaywrightProjects(repoDir) {
40
41
  const testRunner = (0, utils_1.getTestRunner)(types_1.Platform.WEB);
41
- const env = Object({ ...process.env });
42
42
  const args = [testRunner, "test", "--list"];
43
43
  const { output, code } = await (0, cmd_1.spawnCmd)("npx", args, {
44
- env,
45
44
  cwd: repoDir,
45
+ envOverrides: {},
46
46
  captureOutput: true,
47
+ throwOnError: true,
47
48
  });
48
49
  if (!output) {
49
50
  throw new Error(`Failed to run list command; exit code: ${code}`);
package/dist/lib/cmd.d.ts CHANGED
@@ -6,11 +6,11 @@ export declare function getCommandFromString(command: string): {
6
6
  export declare function runTestsForCmd({ command, args, env }: CommandToRun): Promise<{
7
7
  hasTestPassed: boolean;
8
8
  }>;
9
- export declare function spawnCmd(command: string, args: string[], options?: {
10
- env?: Record<string, string>;
11
- cwd?: string;
12
- captureOutput?: boolean;
13
- throwOnError?: boolean;
9
+ export declare function spawnCmd(command: string, args: string[], options: {
10
+ cwd: string;
11
+ envOverrides: Record<string, string>;
12
+ captureOutput: boolean;
13
+ throwOnError: boolean;
14
14
  }): Promise<{
15
15
  code: number;
16
16
  output?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/lib/cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAeA;AAED,wBAAsB,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,YAAY;;GASxE;AAED,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE;IACP,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;CAIxB,GACA,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA6C5C"}
1
+ {"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/lib/cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAeA;AAED,wBAAsB,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,YAAY;;GAcxE;AAED,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IACP,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;CACvB,GACA,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA6C5C"}
package/dist/lib/cmd.js CHANGED
@@ -22,22 +22,24 @@ async function runTestsForCmd({ command, args, env }) {
22
22
  console.log(`Running cmd: ${command} with args: ${args}`);
23
23
  let hasTestPassed = true;
24
24
  try {
25
- await spawnCmd(command, args, { env });
25
+ await spawnCmd(command, args, {
26
+ cwd: process.cwd(),
27
+ envOverrides: env,
28
+ captureOutput: false,
29
+ throwOnError: true,
30
+ });
26
31
  }
27
32
  catch (e) {
28
33
  hasTestPassed = false;
29
34
  }
30
35
  return { hasTestPassed };
31
36
  }
32
- async function spawnCmd(command, args, options = {
33
- captureOutput: false,
34
- throwOnError: true,
35
- }) {
37
+ async function spawnCmd(command, args, options) {
36
38
  let output = options.captureOutput ? "" : undefined;
37
39
  let errorLogs = [];
38
40
  return new Promise((resolveFunc, rejectFunc) => {
39
41
  const p = (0, child_process_1.spawn)(command, args, {
40
- env: { ...process.env, ...options.env },
42
+ env: { ...process.env, ...options.envOverrides },
41
43
  cwd: options.cwd,
42
44
  // Ensure child process receives signals
43
45
  detached: false,
@@ -1,10 +1,11 @@
1
1
  import { CommandToRun, Platform, TestCase } from "../types";
2
- export declare function runSpecificTestsCmd({ tests, projects, passthroughArgs, platform, envOverrides, }: {
2
+ export declare function runSpecificTestsCmd({ tests, projects, passthroughArgs, platform, envOverrides, repoDir, }: {
3
3
  tests?: TestCase[];
4
4
  projects: string[];
5
5
  passthroughArgs?: string;
6
6
  platform: Platform;
7
7
  filesFilter?: string;
8
8
  envOverrides?: Record<string, string>;
9
+ repoDir: string;
9
10
  }): Promise<CommandToRun>;
10
11
  //# sourceMappingURL=run-specific-test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-specific-test.d.ts","sourceRoot":"","sources":["../../src/lib/run-specific-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAY5D,wBAAsB,mBAAmB,CAAC,EACxC,KAAU,EACV,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,YAAY,GACb,EAAE;IACD,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC,GAAG,OAAO,CAAC,YAAY,CAAC,CAiFxB"}
1
+ {"version":3,"file":"run-specific-test.d.ts","sourceRoot":"","sources":["../../src/lib/run-specific-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAY5D,wBAAsB,mBAAmB,CAAC,EACxC,KAAU,EACV,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,OAAO,GACR,EAAE;IACD,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,YAAY,CAAC,CAuFxB"}
@@ -3,13 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runSpecificTestsCmd = runSpecificTestsCmd;
4
4
  const utils_1 = require("../utils");
5
5
  const run_all_tests_1 = require("./run-all-tests");
6
- async function runSpecificTestsCmd({ tests = [], projects, passthroughArgs, platform, envOverrides, }) {
6
+ async function runSpecificTestsCmd({ tests = [], projects, passthroughArgs, platform, envOverrides, repoDir, }) {
7
7
  if (!tests || tests.length === 0) {
8
8
  throw new Error("No tests found");
9
9
  }
10
10
  let patternsToGrep = [];
11
11
  let filesToRun = [];
12
12
  for (const testCase of tests) {
13
+ // TODO: Why do we have this getAllFilePaths call?
14
+ // TODO: Can we remove `dir` from the test case entity?
13
15
  const files = await (0, utils_1.getAllFilePaths)(testCase.dir, {
14
16
  filePath: testCase.filePath,
15
17
  });
@@ -55,7 +57,7 @@ async function runSpecificTestsCmd({ tests = [], projects, passthroughArgs, plat
55
57
  }
56
58
  }
57
59
  }
58
- const teardownLabels = await (0, utils_1.labelTeardownProjects)(projects, platform);
60
+ const teardownLabels = await (0, utils_1.labelTeardownProjects)(projects, platform, repoDir);
59
61
  const isRunningForTeardownProjectOnly = teardownLabels && teardownLabels.every((label) => label.isTeardown);
60
62
  if (isRunningForTeardownProjectOnly) {
61
63
  // To run teardown projects, we need to run the `setup` project first, and playwright runs
@@ -6,6 +6,6 @@ type PlaywrightProject = {
6
6
  testIgnore: string[] | string | undefined;
7
7
  teardown: string | undefined;
8
8
  };
9
- export declare function getProjectsFromPlaywrightConfig(platform: Platform): Promise<PlaywrightProject[]>;
9
+ export declare function getProjectsFromPlaywrightConfig(platform: Platform, repoDir: string): Promise<PlaywrightProject[]>;
10
10
  export {};
11
11
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAqC9B"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IACzC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA8B9B"}
@@ -4,40 +4,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getProjectsFromPlaywrightConfig = getProjectsFromPlaywrightConfig;
7
+ const child_process_1 = require("child_process");
8
+ const fs_1 = __importDefault(require("fs"));
7
9
  const path_1 = __importDefault(require("path"));
8
- // For TypeScript type safety
9
- let tsxImport = null;
10
10
  const types_1 = require("../types");
11
- async function getProjectsFromPlaywrightConfig(platform) {
11
+ async function getProjectsFromPlaywrightConfig(platform, repoDir) {
12
12
  const configName = platform === types_1.Platform.WEB ? "playwright.config.ts" : "appwright.config.ts";
13
- const directoryPath = ".";
14
- const pwFile = path_1.default.resolve(directoryPath, configName);
15
- if (typeof window !== "undefined") {
16
- throw new Error("readPlaywrightConfig cannot be used in browser environments");
17
- }
18
- else {
19
- // Only initialize on server side
20
- // This will only execute on the server
21
- await import("tsx/cjs/api")
22
- .then((module) => {
23
- tsxImport = module;
24
- })
25
- .catch(() => {
26
- console.warn("Failed to import tsx: --->");
27
- });
28
- }
29
- if (!tsxImport) {
30
- console.warn("tsx module not available");
31
- return [];
32
- }
33
- const repoDir = process.cwd();
34
- const [lastDir] = repoDir.split("/").reverse();
35
13
  try {
36
- const playwrightConfig = (await tsxImport.require(pwFile, `${repoDir}/${lastDir}`)).default;
37
- return playwrightConfig.projects;
14
+ const configPath = path_1.default.join(repoDir, configName);
15
+ const tmpScriptPath = path_1.default.resolve(__dirname, "temp-extract-projects.js");
16
+ fs_1.default.writeFileSync(tmpScriptPath, `
17
+ // Import the config directly with the full path
18
+ const configModule = require('${configPath.replace(/\\/g, "\\\\")}');
19
+ const projects = configModule.default.projects;
20
+ console.log(JSON.stringify(projects));
21
+ `);
22
+ const result = (0, child_process_1.execSync)(`npx -y ts-node ${tmpScriptPath}`, {
23
+ encoding: "utf8",
24
+ env: {
25
+ ...process.env,
26
+ TS_NODE_PROJECT: path_1.default.join(repoDir, "tsconfig.json"),
27
+ NODE_PATH: path_1.default.join(repoDir, "node_modules"),
28
+ },
29
+ });
30
+ fs_1.default.unlinkSync(tmpScriptPath);
31
+ const projects = JSON.parse(result);
32
+ return projects;
38
33
  }
39
- catch (err) {
40
- console.error("Error getting project list from playwright config", err);
34
+ catch (error) {
35
+ console.error("Error extracting Playwright projects:", error);
41
36
  }
42
37
  return [];
43
38
  }
@@ -27,13 +27,14 @@ export declare function markTestAsOnly({ sourceFile, parentDescribeNode, testCas
27
27
  filePath: string;
28
28
  }): Promise<void>;
29
29
  export declare const filterArrayByGlobMatchersSet: (input: string[], globMatcherSets: string[][]) => string[];
30
- export declare function labelTeardownProjects(projectNames: string[], platform: Platform): Promise<{
30
+ export declare function labelTeardownProjects(projectNames: string[], platform: Platform, repoDir: string): Promise<{
31
31
  isTeardown: boolean;
32
32
  correspondingSetupProject: string | undefined;
33
33
  }[]>;
34
- export declare const generateProjectFilters: ({ platform, filteringSets, }: {
34
+ export declare const generateProjectFilters: ({ platform, filteringSets, repoDir, }: {
35
35
  platform: Platform;
36
36
  filteringSets: string[];
37
+ repoDir: string;
37
38
  }) => Promise<string[]>;
38
39
  export declare function buildRepoName(projectName: string): string;
39
40
  export declare const pickNameFromPackageJson: () => Promise<string | undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAW,UAAU,EAAc,MAAM,UAAU,CAAC;AAIjE,OAAO,EAAsB,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvE,wBAAsB,eAAe,CACnC,aAAa,GAAE,MAAgB,EAC/B,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CA4BnB;AAED,eAAO,MAAM,gCAAgC,GAC3C,YAAY,UAAU,KACrB,MAgBF,CAAC;AAEF,wBAAsB,eAAe,CA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AAQ,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CACR;IACE,UAAU,EAAE,OAAO,CAAC;IACpB,yBAAyB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/C,EAAE,CACJ,CAkBA;AAED,eAAO,MAAM,sBAAsB,GAAU,uCAI1C;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB,KAAG,OAAO,CAAC,MAAM,EAAE,CAgBnB,CAAC;AAEF,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,eAAO,MAAM,uBAAuB,QAAa,OAAO,CACtD,MAAM,GAAG,SAAS,CAMnB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAclE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,UAAU,QAAQ,KAAG,aAIlD,CAAC;AA4DF,eAAO,MAAM,sBAAsB,GAAU,WAAW,MAAM,kBAkB7D,CAAC;AA0BF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG;IACF,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;CACxB,CA8CA"}
@@ -179,8 +179,8 @@ globMatcherSets) => {
179
179
  return filteredList;
180
180
  };
181
181
  exports.filterArrayByGlobMatchersSet = filterArrayByGlobMatchersSet;
182
- async function labelTeardownProjects(projectNames, platform) {
183
- const allProjects = await (0, config_1.getProjectsFromPlaywrightConfig)(platform);
182
+ async function labelTeardownProjects(projectNames, platform, repoDir) {
183
+ const allProjects = await (0, config_1.getProjectsFromPlaywrightConfig)(platform, repoDir);
184
184
  return projectNames.map((projectName) => {
185
185
  const setupForTeardown = allProjects.find((p) => p.teardown === projectName);
186
186
  if (setupForTeardown) {
@@ -197,8 +197,8 @@ async function labelTeardownProjects(projectNames, platform) {
197
197
  }
198
198
  });
199
199
  }
200
- const generateProjectFilters = async ({ platform, filteringSets, }) => {
201
- const allProjects = await (0, config_1.getProjectsFromPlaywrightConfig)(platform);
200
+ const generateProjectFilters = async ({ platform, filteringSets, repoDir, }) => {
201
+ const allProjects = await (0, config_1.getProjectsFromPlaywrightConfig)(platform, repoDir);
202
202
  const allProjectNames = allProjects.map((project) => project.name);
203
203
  const filters = filteringSets.map((matchingString) => matchingString.split(","));
204
204
  const filteredProjects = (0, exports.filterArrayByGlobMatchersSet)(allProjectNames, filters);
@@ -226,7 +226,10 @@ const downloadBuild = async (buildUrl) => {
226
226
  if (buildDownloadScript && buildUrl) {
227
227
  console.log(`Downloading build from ${buildUrl}`);
228
228
  await (0, cmd_1.spawnCmd)(`npm`, ["run", "download", buildUrl], {
229
- env: { ...Object(process.env) },
229
+ cwd: process.cwd(),
230
+ envOverrides: {},
231
+ captureOutput: false,
232
+ throwOnError: true,
230
233
  });
231
234
  }
232
235
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/test-run",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -19,8 +19,7 @@
19
19
  "commander": "^12.1.0",
20
20
  "dotenv": "^16.4.5",
21
21
  "minimatch": "^10.0.1",
22
- "ts-morph": "^23.0.0",
23
- "tsx": "^4.16.2"
22
+ "ts-morph": "^23.0.0"
24
23
  },
25
24
  "devDependencies": {
26
25
  "@types/async-retry": "^1.4.8",