@empiricalrun/test-run 0.4.1 → 0.4.2
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 +6 -3
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/bin/index.js
CHANGED
|
@@ -40,11 +40,14 @@ const utils_1 = require("../utils");
|
|
|
40
40
|
let environmentSpecificProjects = [];
|
|
41
41
|
let platform = types_1.Platform.WEB;
|
|
42
42
|
if (process.env.TEST_RUN_ENVIRONMENT) {
|
|
43
|
-
const { environment, build } = await (0, dashboard_1.fetchEnvironmentAndBuild)();
|
|
43
|
+
const { environment, build: latestBuild } = await (0, dashboard_1.fetchEnvironmentAndBuild)();
|
|
44
44
|
platform = environment.platform;
|
|
45
45
|
environmentSpecificProjects = environment.playwright_projects;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
if (!process.env.BUILD_URL) {
|
|
47
|
+
process.env.BUILD_URL = latestBuild?.build_url; // pick the one coming from dispatch, otherwise use the latest build from DB
|
|
48
|
+
}
|
|
49
|
+
const buildUrl = process.env.BUILD_URL;
|
|
50
|
+
await (0, utils_1.downloadBuild)(buildUrl);
|
|
48
51
|
}
|
|
49
52
|
const projectFilters = await (0, utils_1.generateProjectFilters)({
|
|
50
53
|
platform,
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, SourceFile } from "ts-morph";
|
|
2
|
-
import {
|
|
2
|
+
import { Platform, TestFramework } from "../types";
|
|
3
3
|
export declare function cmd(command: string[], options: {
|
|
4
4
|
env?: Record<string, string>;
|
|
5
5
|
}): Promise<number>;
|
|
@@ -36,6 +36,6 @@ export declare const generateProjectFilters: ({ platform, filteringSets, }: {
|
|
|
36
36
|
filteringSets: string[];
|
|
37
37
|
}) => Promise<string[]>;
|
|
38
38
|
export declare function buildRepoName(projectName: string): string;
|
|
39
|
-
export declare const downloadBuild: (
|
|
39
|
+
export declare const downloadBuild: (buildUrl: string) => Promise<void>;
|
|
40
40
|
export declare const getTestRunner: (platform: Platform) => TestFramework;
|
|
41
41
|
//# 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,OAAO,
|
|
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,OAAO,EAAsB,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,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,YAAY,EAAE,IAAI,GAAG,SAAS,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC,CAatE;AAED,wBAAsB,YAAY,CAAC,EACjC,QAAQ,EACR,YAAY,GACb,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,OAAO,CAAC,CAMnB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,IAAI,GAAG,SAAS,CA2BlB;AAED,wBAAsB,0CAA0C,CAC9D,QAAQ,EAAE,MAAM,oBA+BjB;AAED,wBAAsB,cAAc,CAAC,EACnC,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACtC,YAAY,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,iBAgBA;AAED,wBAAsB,+BAA+B,CAAC,QAAQ,EAAE,QAAQ,gBAevE;AAED,eAAO,MAAM,4BAA4B,UAEhC,MAAM,EAAE,mBAGE,MAAM,EAAE,EAAE,KAC1B,MAAM,EAUR,CAAC;AAEF,eAAO,MAAM,sBAAsB;cAIvB,QAAQ;mBACH,MAAM,EAAE;MACrB,QAAQ,MAAM,EAAE,CAmBnB,CAAC;AAEF,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,eAAO,MAAM,aAAa,aAAoB,MAAM,KAAG,QAAQ,IAAI,CAWlE,CAAC;AAEF,eAAO,MAAM,aAAa,aAAc,QAAQ,KAAG,aAIlD,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -202,14 +202,14 @@ function buildRepoName(projectName) {
|
|
|
202
202
|
return `${projectName}-tests`;
|
|
203
203
|
}
|
|
204
204
|
exports.buildRepoName = buildRepoName;
|
|
205
|
-
const downloadBuild = async (
|
|
205
|
+
const downloadBuild = async (buildUrl) => {
|
|
206
206
|
const packageJSONPath = "package.json";
|
|
207
207
|
const packageJsonStr = await fs_extra_1.default.readFile(packageJSONPath, "utf-8");
|
|
208
208
|
const packageJSONData = JSON.parse(packageJsonStr);
|
|
209
209
|
const buildDownloadScript = packageJSONData.scripts["download"];
|
|
210
|
-
if (buildDownloadScript &&
|
|
211
|
-
console.log(`Downloading build from ${
|
|
212
|
-
await cmd(`npm run download ${
|
|
210
|
+
if (buildDownloadScript && buildUrl) {
|
|
211
|
+
console.log(`Downloading build from ${buildUrl}`);
|
|
212
|
+
await cmd(`npm run download ${buildUrl}`.split(" "), {
|
|
213
213
|
env: { ...Object(process.env) },
|
|
214
214
|
});
|
|
215
215
|
}
|