@argos-ci/core 2.0.0 → 2.2.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/dist/index.d.ts +3 -0
- package/dist/index.mjs +18 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ interface UploadParameters {
|
|
|
17
17
|
prNumber?: number;
|
|
18
18
|
/** Name of the build used to trigger multiple Argos builds on one commit */
|
|
19
19
|
buildName?: string;
|
|
20
|
+
/** Mode of comparison applied */
|
|
21
|
+
mode?: "ci" | "monitoring";
|
|
20
22
|
/** Parallel test suite mode */
|
|
21
23
|
parallel?: {
|
|
22
24
|
/** Unique build ID for this parallel build */
|
|
@@ -66,6 +68,7 @@ interface Config {
|
|
|
66
68
|
runId: string | null;
|
|
67
69
|
prNumber: number | null;
|
|
68
70
|
prHeadCommit: string | null;
|
|
71
|
+
mode: "ci" | "monitoring" | null;
|
|
69
72
|
}
|
|
70
73
|
declare function readConfig(options?: Partial<Config>): Promise<Config>;
|
|
71
74
|
export { UploadParameters, upload, Config, readConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -185,7 +185,7 @@ const getBranch = ({ env })=>{
|
|
|
185
185
|
};
|
|
186
186
|
const getRepository$1 = ({ env })=>{
|
|
187
187
|
if (!env.GITHUB_REPOSITORY) return null;
|
|
188
|
-
return env.GITHUB_REPOSITORY.split("/")[1];
|
|
188
|
+
return env.GITHUB_REPOSITORY.split("/")[1] || null;
|
|
189
189
|
};
|
|
190
190
|
const readEventPayload = ({ env })=>{
|
|
191
191
|
if (!env.GITHUB_EVENT_PATH) return null;
|
|
@@ -417,6 +417,15 @@ const schema = {
|
|
|
417
417
|
format: String,
|
|
418
418
|
nullable: true
|
|
419
419
|
},
|
|
420
|
+
mode: {
|
|
421
|
+
env: "ARGOS_MODE",
|
|
422
|
+
format: [
|
|
423
|
+
"ci",
|
|
424
|
+
"monitoring"
|
|
425
|
+
],
|
|
426
|
+
default: null,
|
|
427
|
+
nullable: true
|
|
428
|
+
},
|
|
420
429
|
prNumber: {
|
|
421
430
|
env: "ARGOS_PR_NUMBER",
|
|
422
431
|
format: Number,
|
|
@@ -509,7 +518,8 @@ async function readConfig(options = {}) {
|
|
|
509
518
|
runId: ciEnv?.runId || null,
|
|
510
519
|
parallel: options.parallel ?? config.get("parallel") ?? false,
|
|
511
520
|
parallelNonce: options.parallelNonce || config.get("parallelNonce") || ciEnv?.nonce || null,
|
|
512
|
-
parallelTotal: options.parallelTotal || config.get("parallelTotal") || null
|
|
521
|
+
parallelTotal: options.parallelTotal || config.get("parallelTotal") || null,
|
|
522
|
+
mode: options.mode || config.get("mode") || null
|
|
513
523
|
});
|
|
514
524
|
config.validate();
|
|
515
525
|
return config.get();
|
|
@@ -676,7 +686,11 @@ async function uploadFilesToS3(files) {
|
|
|
676
686
|
debug(`Uploading chunk ${i + 1}/${chunks.length}`);
|
|
677
687
|
const timeLabel = `Chunk ${i + 1}/${chunks.length}`;
|
|
678
688
|
debugTime(timeLabel);
|
|
679
|
-
|
|
689
|
+
const chunk = chunks[i];
|
|
690
|
+
if (!chunk) {
|
|
691
|
+
throw new Error(`Invariant: chunk ${i} is empty`);
|
|
692
|
+
}
|
|
693
|
+
await Promise.all(chunk.map(async ({ url, path, contentType })=>{
|
|
680
694
|
await upload$1({
|
|
681
695
|
url,
|
|
682
696
|
path,
|
|
@@ -749,6 +763,7 @@ async function uploadFilesToS3(files) {
|
|
|
749
763
|
commit: config.commit,
|
|
750
764
|
branch: config.branch,
|
|
751
765
|
name: config.buildName,
|
|
766
|
+
mode: config.mode,
|
|
752
767
|
parallel: config.parallel,
|
|
753
768
|
parallelNonce: config.parallelNonce,
|
|
754
769
|
screenshotKeys,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/core",
|
|
3
3
|
"description": "Visual testing solution to avoid visual regression. The core component of Argos SDK that handles build creation.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"build": "rollup -c",
|
|
60
60
|
"e2e": "node ./e2e/upload.cjs && node ./e2e/upload.mjs"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "5b18339a0b9e3a1e7529dfa999ed91227842c43c"
|
|
63
63
|
}
|