@testomatio/reporter 1.6.0-beta-1-artifacts → 1.6.0-beta-2-artifacts
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/lib/bin/cli.js +1 -5
- package/lib/bin/uploadArtifacts.js +2 -7
- package/lib/uploader.js +6 -2
- package/lib/utils/pipe_utils.js +0 -2
- package/package.json +1 -1
package/lib/bin/cli.js
CHANGED
|
@@ -162,6 +162,7 @@ program
|
|
|
162
162
|
.option('--force', 'Re-upload artifacts even if they were uploaded before')
|
|
163
163
|
.action(async (opts) => {
|
|
164
164
|
const apiKey = config.TESTOMATIO;
|
|
165
|
+
|
|
165
166
|
process.env.TESTOMATIO_DISABLE_ARTIFACTS = '';
|
|
166
167
|
|
|
167
168
|
const client = new TestomatClient({
|
|
@@ -169,11 +170,6 @@ program
|
|
|
169
170
|
isBatchEnabled: false,
|
|
170
171
|
});
|
|
171
172
|
|
|
172
|
-
if (!process.env.TESTOMATIO_RUN) {
|
|
173
|
-
console.log(APP_PREFIX, 'No run ID provided');
|
|
174
|
-
process.exit(1);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
173
|
let testruns = client.uploader.readUploadedFiles(process.env.TESTOMATIO_RUN);
|
|
178
174
|
const numTotalArtifacts = testruns.length;
|
|
179
175
|
|
|
@@ -24,18 +24,13 @@ program
|
|
|
24
24
|
const apiKey = config.TESTOMATIO;
|
|
25
25
|
|
|
26
26
|
process.env.TESTOMATIO_DISABLE_ARTIFACTS = '';
|
|
27
|
-
// process.env.TESTOMATIO_ARTIFACTS_SIZE = null;
|
|
27
|
+
// process.env.TESTOMATIO_ARTIFACTS_SIZE = null;
|
|
28
28
|
|
|
29
|
-
const client = new TestomatClient({
|
|
29
|
+
const client = new TestomatClient({
|
|
30
30
|
apiKey,
|
|
31
31
|
isBatchEnabled: false,
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
if (!process.env.TESTOMATIO_RUN) {
|
|
35
|
-
console.log(APP_PREFIX, 'No run ID provided');
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
34
|
let testruns = client.uploader.readUploadedFiles(process.env.TESTOMATIO_RUN);
|
|
40
35
|
|
|
41
36
|
const numTotalArtifacts = testruns.length;
|
package/lib/uploader.js
CHANGED
|
@@ -114,7 +114,7 @@ class S3Uploader {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
readUploadedFiles(runId) {
|
|
117
|
+
readUploadedFiles(runId = null) {
|
|
118
118
|
const tempFilePath = this.#getUploadFilePath(runId);
|
|
119
119
|
|
|
120
120
|
debug('Reading file', tempFilePath);
|
|
@@ -137,7 +137,11 @@ class S3Uploader {
|
|
|
137
137
|
return lines.map(line => JSON.parse(line));
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
#getUploadFilePath(runId, forceCreate = false) {
|
|
140
|
+
#getUploadFilePath(runId = null, forceCreate = false) {
|
|
141
|
+
if (!runId && !forceCreate) {
|
|
142
|
+
return path.join(os.tmpdir(), 'testomatio.run.latest.jsonl');
|
|
143
|
+
}
|
|
144
|
+
|
|
141
145
|
const tempFilePath = path.join(os.tmpdir(), `testomatio.run.${runId}.jsonl`);
|
|
142
146
|
if (!fs.existsSync(tempFilePath) || forceCreate) {
|
|
143
147
|
debug('Creating artifacts file:', tempFilePath);
|
package/lib/utils/pipe_utils.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const { resetConfig } = require('../uploader');
|
|
2
1
|
const { APP_PREFIX } = require('../constants');
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -17,7 +16,6 @@ function setS3Credentials(artifacts) {
|
|
|
17
16
|
if (artifacts.ENDPOINT) process.env.S3_ENDPOINT = artifacts.ENDPOINT;
|
|
18
17
|
if (artifacts.SESSION_TOKEN) process.env.S3_SESSION_TOKEN = artifacts.SESSION_TOKEN;
|
|
19
18
|
if (artifacts.presign) process.env.TESTOMATIO_PRIVATE_ARTIFACTS = '1';
|
|
20
|
-
resetConfig();
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
21
|
* Generates mode request parameters based on the input params.
|