@empiricalrun/test-run 0.10.2 → 0.10.4
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 +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/lib/cmd.d.ts.map +1 -1
- package/dist/lib/cmd.js +2 -1
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +11 -0
- package/package.json +3 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @empiricalrun/test-run
|
|
2
2
|
|
|
3
|
+
## 0.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b533712: chore: remove verbose logs, hide pw glass pane
|
|
8
|
+
|
|
9
|
+
## 0.10.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- cfb157a: fix: follow-ups for playwright reporter upgrade
|
|
14
|
+
|
|
3
15
|
## 0.10.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAY,QAAQ,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAY,QAAQ,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAC;AAczC,wBAAsB,aAAa,CAAC,EAClC,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;;;GAiBA;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
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.spawnCmd = exports.runSpecificTestsCmd = void 0;
|
|
7
7
|
exports.runSingleTest = runSingleTest;
|
|
8
8
|
exports.getAllPlaywrightProjects = getAllPlaywrightProjects;
|
|
9
|
-
const
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
11
|
const cmd_1 = require("./lib/cmd");
|
|
12
12
|
Object.defineProperty(exports, "spawnCmd", { enumerable: true, get: function () { return cmd_1.spawnCmd; } });
|
|
@@ -18,6 +18,13 @@ 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
|
+
function getSummaryJsonPath(repoDir) {
|
|
22
|
+
const pathForPlaywright147 = path_1.default.join(repoDir, "playwright-report", "summary.json");
|
|
23
|
+
const pathForOtherPlaywrightVersions = path_1.default.join(repoDir, "summary.json");
|
|
24
|
+
return fs_1.default.existsSync(pathForPlaywright147)
|
|
25
|
+
? pathForPlaywright147
|
|
26
|
+
: pathForOtherPlaywrightVersions;
|
|
27
|
+
}
|
|
21
28
|
async function runSingleTest({ testName, suites, filePath, projects, envOverrides, repoDir, }) {
|
|
22
29
|
const testDir = "tests";
|
|
23
30
|
const commandToRun = await (0, run_specific_test_1.runSpecificTestsCmd)({
|
|
@@ -28,8 +35,8 @@ async function runSingleTest({ testName, suites, filePath, projects, envOverride
|
|
|
28
35
|
repoDir,
|
|
29
36
|
});
|
|
30
37
|
const { hasTestPassed } = await (0, cmd_1.runTestsForCmd)(commandToRun, repoDir);
|
|
31
|
-
const jsonFilePath =
|
|
32
|
-
const jsonFileContents =
|
|
38
|
+
const jsonFilePath = getSummaryJsonPath(repoDir);
|
|
39
|
+
const jsonFileContents = fs_1.default.readFileSync(jsonFilePath, "utf8");
|
|
33
40
|
const summaryJson = JSON.parse(jsonFileContents);
|
|
34
41
|
return {
|
|
35
42
|
hasTestPassed,
|
package/dist/lib/cmd.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/lib/cmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/lib/cmd.ts"],"names":[],"mappings":"AAGA,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,CAClC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,YAAY,EACpC,GAAG,EAAE,MAAM;;GAeZ;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
|
@@ -4,6 +4,7 @@ exports.getCommandFromString = getCommandFromString;
|
|
|
4
4
|
exports.runTestsForCmd = runTestsForCmd;
|
|
5
5
|
exports.spawnCmd = spawnCmd;
|
|
6
6
|
const child_process_1 = require("child_process");
|
|
7
|
+
const logger_1 = require("../logger");
|
|
7
8
|
function getCommandFromString(command) {
|
|
8
9
|
const regex = /[^\s"']+|"([^"]*)"|'([^']*)'/g;
|
|
9
10
|
const matches = command.match(regex) || [];
|
|
@@ -19,7 +20,7 @@ function getCommandFromString(command) {
|
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
async function runTestsForCmd({ command, args, env }, cwd) {
|
|
22
|
-
|
|
23
|
+
logger_1.logger.debug(`Running cmd: ${command} with args: ${args}`);
|
|
23
24
|
let hasTestPassed = true;
|
|
24
25
|
try {
|
|
25
26
|
await spawnCmd(command, args, {
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,MAAyB,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,MAAM,eAGjB,CAAC"}
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logger = void 0;
|
|
7
|
+
const console_log_level_1 = __importDefault(require("console-log-level"));
|
|
8
|
+
exports.logger = (0, console_log_level_1.default)({
|
|
9
|
+
prefix: "test-run",
|
|
10
|
+
level: process.env.LOG_LEVEL || "info",
|
|
11
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/test-run",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -17,12 +17,14 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"async-retry": "^1.3.3",
|
|
19
19
|
"commander": "^12.1.0",
|
|
20
|
+
"console-log-level": "^1.4.1",
|
|
20
21
|
"dotenv": "^16.4.5",
|
|
21
22
|
"minimatch": "^10.0.1",
|
|
22
23
|
"ts-morph": "^23.0.0"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@types/async-retry": "^1.4.8",
|
|
27
|
+
"@types/console-log-level": "^1.4.5",
|
|
26
28
|
"@types/node": "^22.5.5",
|
|
27
29
|
"memfs": "^4.17.1"
|
|
28
30
|
},
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/dashboard.ts","./src/index.ts","./src/bin/index.ts","./src/lib/cmd.ts","./src/lib/run-all-tests.ts","./src/lib/run-specific-test.ts","./src/lib/memfs/read-hello-world.ts","./src/parser/index.ts","./src/types/index.ts","./src/utils/config-parser.ts","./src/utils/config.ts","./src/utils/index.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["./src/dashboard.ts","./src/index.ts","./src/logger.ts","./src/bin/index.ts","./src/lib/cmd.ts","./src/lib/run-all-tests.ts","./src/lib/run-specific-test.ts","./src/lib/memfs/read-hello-world.ts","./src/parser/index.ts","./src/types/index.ts","./src/utils/config-parser.ts","./src/utils/config.ts","./src/utils/index.ts"],"version":"5.8.3"}
|