projektor-publish 3.9.0 → 3.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projektor-publish",
3
- "version": "3.9.0",
3
+ "version": "3.10.0",
4
4
  "homepage": "https://projektor.dev/docs/node-script/",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.js CHANGED
@@ -132,7 +132,10 @@ async function run(args, env, publishToken, defaultConfigFilePath) {
132
132
  }
133
133
 
134
134
  const shouldPublish =
135
- resultsFileGlobs || performanceFileGlobs || codeQualityFileGlobs;
135
+ resultsFileGlobs ||
136
+ coverageFileGlobs ||
137
+ performanceFileGlobs ||
138
+ codeQualityFileGlobs;
136
139
 
137
140
  if (shouldPublish) {
138
141
  // https://go-vela.github.io/docs/concepts/pipeline/steps/environment/
@@ -158,6 +161,7 @@ async function run(args, env, publishToken, defaultConfigFilePath) {
158
161
  const {
159
162
  resultsBlob,
160
163
  performanceResults,
164
+ coverageFilePayloads,
161
165
  reportUrl,
162
166
  publicId,
163
167
  error: publishError,
@@ -183,15 +187,23 @@ async function run(args, env, publishToken, defaultConfigFilePath) {
183
187
  gitMainBranchNames
184
188
  );
185
189
 
186
- const hasResults = resultsBlob || performanceFileGlobs;
190
+ const hasTestResults = resultsBlob;
191
+ const hasCoverageResults =
192
+ coverageFilePayloads && coverageFilePayloads.length > 0;
193
+ const hasPerformanceResults =
194
+ performanceResults && performanceResults.length > 0;
187
195
 
188
- if (!hasResults) {
196
+ if (resultsFileGlobs && resultsFileGlobs.length > 0 && !hasTestResults) {
189
197
  console.log(
190
198
  `No test results files found in locations ${resultsFileGlobs}`
191
199
  );
192
200
  }
193
201
 
194
- if (performanceFileGlobs && performanceResults.length === 0) {
202
+ if (
203
+ performanceFileGlobs &&
204
+ performanceFileGlobs.length > 0 &&
205
+ !hasPerformanceResults
206
+ ) {
195
207
  console.log(
196
208
  `No performance results files found in locations ${performanceFileGlobs}`
197
209
  );
@@ -206,6 +218,9 @@ async function run(args, env, publishToken, defaultConfigFilePath) {
206
218
  slackMessageFileName || "projektor_failure_message.json";
207
219
  const messageProjectName = slackProjectName || projectName;
208
220
 
221
+ const hasResults =
222
+ hasTestResults || hasCoverageResults || hasPerformanceResults;
223
+
209
224
  if (hasResults) {
210
225
  writeSlackMessageFileToDisk(
211
226
  reportUrl,
package/src/publish.js CHANGED
@@ -187,6 +187,7 @@ const collectAndSendResults = async (
187
187
 
188
188
  const shouldPublish =
189
189
  resultsBlob.length > 0 ||
190
+ coverageFilePayloads.length > 0 ||
190
191
  performanceResults.length > 0 ||
191
192
  codeQualityFilePayloads.length > 0;
192
193
 
@@ -229,6 +230,7 @@ const collectAndSendResults = async (
229
230
  reportUrl,
230
231
  performanceResults,
231
232
  codeQualityFilePayloads,
233
+ coverageFilePayloads,
232
234
  };
233
235
  } catch (e) {
234
236
  console.error(
@@ -243,6 +245,7 @@ const collectAndSendResults = async (
243
245
  resultsBlob,
244
246
  performanceResults,
245
247
  codeQualityFilePayloads,
248
+ coverageFilePayloads,
246
249
  publicId: null,
247
250
  reportUrl: null,
248
251
  error: e,
@@ -253,6 +256,7 @@ const collectAndSendResults = async (
253
256
  resultsBlob,
254
257
  performanceResults,
255
258
  codeQualityFilePayloads,
259
+ coverageFilePayloads,
256
260
  publicId: null,
257
261
  reportUrl: null,
258
262
  };