@empiricalrun/test-run 0.2.1 → 0.3.0
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 +6 -0
- package/dist/bin/index.js +10 -1
- package/dist/dashboard.d.ts +3 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +22 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/bin/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const commander_1 = require("commander");
|
|
5
5
|
const __1 = require("..");
|
|
6
|
+
const dashboard_1 = require("../dashboard");
|
|
6
7
|
const utils_1 = require("../utils");
|
|
7
8
|
(async function main() {
|
|
8
9
|
// TODO: add support for suites
|
|
@@ -35,7 +36,15 @@ const utils_1 = require("../utils");
|
|
|
35
36
|
.slice(2)
|
|
36
37
|
.filter((arg) => !optionsToStrip.includes(arg));
|
|
37
38
|
try {
|
|
38
|
-
|
|
39
|
+
let environmentSpecificProjects = [];
|
|
40
|
+
if (process.env.TEST_RUN_ENVIRONMENT) {
|
|
41
|
+
const environmentDetail = await (0, dashboard_1.fetchEnvironment)();
|
|
42
|
+
environmentSpecificProjects = environmentDetail.playwright_projects;
|
|
43
|
+
}
|
|
44
|
+
const projectFilters = await (0, utils_1.generateProjectFilters)([
|
|
45
|
+
...options.project,
|
|
46
|
+
...environmentSpecificProjects,
|
|
47
|
+
]);
|
|
39
48
|
pwOptions.push(...projectFilters);
|
|
40
49
|
const { hasTestPassed } = await (0, __1.runTest)({
|
|
41
50
|
name: options.name,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../src/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC,eAAO,MAAM,gBAAgB,QAAa,QAAQ,WAAW,CA0B5D,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchEnvironment = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
const DOMAIN = process.env.DASHBOARD_DOMAIN || "https://dash.empirical.run";
|
|
6
|
+
const fetchEnvironment = async () => {
|
|
7
|
+
const projectRepo = (0, utils_1.buildRepoName)(process.env.PROJECT_NAME);
|
|
8
|
+
const environmentSlug = `${process.env.TEST_RUN_ENVIRONMENT}`;
|
|
9
|
+
const resp = await fetch(`${DOMAIN}/api/environments?project_repo_name=${projectRepo}&environment_slug=${environmentSlug}`, {
|
|
10
|
+
method: "GET",
|
|
11
|
+
headers: {
|
|
12
|
+
"Content-Type": "application/json",
|
|
13
|
+
Authorization: `weQPMWKT`,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
if (!resp.ok) {
|
|
17
|
+
throw new Error(`Failed to fetch environment details from dashboard`);
|
|
18
|
+
}
|
|
19
|
+
const data = (await resp.json());
|
|
20
|
+
return data.data.environment;
|
|
21
|
+
};
|
|
22
|
+
exports.fetchEnvironment = fetchEnvironment;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -31,4 +31,5 @@ export declare function markTestAsOnly({ sourceFile, parentDescribeNode, testCas
|
|
|
31
31
|
export declare function getProjectsFromPlaywrightConfig(): Promise<string[]>;
|
|
32
32
|
export declare const filterArrayByGlobMatchersSet: (input: string[], globMatcherSets: string[][]) => string[];
|
|
33
33
|
export declare const generateProjectFilters: (filteringSets: string[]) => Promise<string[]>;
|
|
34
|
+
export declare function buildRepoName(projectName: string): string;
|
|
34
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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;AAGjE,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACxC,OAAO,CAAC,MAAM,CAAC,CA2BjB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,aAAa,GAAE,MAAW,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAqBnB;AAED,wBAAsB,eAAe,CAAC,EACpC,QAAQ,EACR,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC;IAAE,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this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generateProjectFilters = exports.filterArrayByGlobMatchersSet = exports.getProjectsFromPlaywrightConfig = exports.markTestAsOnly = exports.hasTopLevelDescribeConfigureWithSerialMode = exports.findFirstSerialDescribeBlock = exports.hasTestBlock = exports.getTestCaseNode = exports.getAllFilePaths = exports.cmd = void 0;
|
|
6
|
+
exports.buildRepoName = exports.generateProjectFilters = exports.filterArrayByGlobMatchersSet = exports.getProjectsFromPlaywrightConfig = exports.markTestAsOnly = exports.hasTopLevelDescribeConfigureWithSerialMode = exports.findFirstSerialDescribeBlock = exports.hasTestBlock = exports.getTestCaseNode = exports.getAllFilePaths = exports.cmd = void 0;
|
|
7
7
|
const child_process_1 = require("child_process");
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const minimatch_1 = require("minimatch");
|
|
@@ -197,3 +197,7 @@ const generateProjectFilters = async (filteringSets) => {
|
|
|
197
197
|
return filteredProjects.map((projectName) => `--project ${projectName}`);
|
|
198
198
|
};
|
|
199
199
|
exports.generateProjectFilters = generateProjectFilters;
|
|
200
|
+
function buildRepoName(projectName) {
|
|
201
|
+
return `${projectName}-tests`;
|
|
202
|
+
}
|
|
203
|
+
exports.buildRepoName = buildRepoName;
|