@testim/testim-cli 3.235.0 → 3.236.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/testRunStatus.js CHANGED
@@ -174,7 +174,21 @@ RunStatus.prototype.testStartReport = function (test, executionId, testRetryKey)
174
174
  }
175
175
  return runHook(this.options.beforeTest, Object.assign({}, test, { exportsGlobal: this.exportsGlobal }), this.options.userData.loginData.token)
176
176
  .then(async params => {
177
- this.options.runParams[test.resultId] = test.config.testData = Object.assign({}, test.config.testData, this.exportsGlobal, this.fileUserParamsData, this.beforeSuiteParams, params);
177
+ // Temporary Sapiens log (SUP-3192)
178
+ if (this.options.projectData && this.options.projectData.projectId === 'fZ63D61PRQQVvvtGY6Ue' && this.options.suites && this.options.suites.includes('Sanity')) {
179
+ logger.info('testRunStatus - testStartReport', {
180
+ 'test.config.testData': test.config.testData,
181
+ 'this.exportsGlobal': this.exportsGlobal,
182
+ 'this.fileUserParamsData': this.fileUserParamsData,
183
+ 'this.beforeSuiteParams': this.beforeSuiteParams,
184
+ params,
185
+ executionId,
186
+ 'test.testId': test.testId,
187
+ 'test.resultId': test.resultId,
188
+ });
189
+ }
190
+ test.config.testData = Object.assign({}, test.config.testData, this.exportsGlobal, this.fileUserParamsData, this.beforeSuiteParams, params);
191
+ this.options.runParams[test.resultId] = test.config.testData;
178
192
  test.startTime = Date.now();
179
193
  await this.updateTestStatusRunning(test, executionId, testRetryKey);
180
194
 
@@ -234,8 +248,10 @@ RunStatus.prototype.testEnd = function (wid, result, executionId, sessionId, isR
234
248
  const duration = (result.endTime - result.startTime) || 0;
235
249
  test.sessionId = sessionId;
236
250
  test.startTime = result.startTime || test.startTime || Date.now();
237
- test.duration = result.duration = duration;
238
- result.failureReason = test.failureReason = result.failureReason || result.reason;
251
+ test.duration = duration;
252
+ result.duration = duration;
253
+ test.failureReason = result.failureReason || result.reason;
254
+ result.failureReason = test.failureReason;
239
255
  test.failurePath = result.failurePath;
240
256
  test.resultId = result.resultId;
241
257
  test.success = result.success;
@@ -245,8 +261,9 @@ RunStatus.prototype.testEnd = function (wid, result, executionId, sessionId, isR
245
261
  }
246
262
 
247
263
  test.resultUrl = utils.getTestUrl(this.options.editorUrl, this.options.project, test.testId, test.resultId, this.branchToUse);
264
+ test.status = this.calcResultText(result);
248
265
 
249
- test.status = result.status = this.calcResultText(result);
266
+ result.status = test.status;
250
267
  result.name = test.name;
251
268
  result.testStatus = test.testStatus;
252
269
  result.testId = result.testId || test.testId;
@@ -263,7 +280,19 @@ RunStatus.prototype.testEnd = function (wid, result, executionId, sessionId, isR
263
280
  const isCodeMode = this.options.files.length > 0;
264
281
  reporter.onTestFinished(test, wid, isRerun, isCodeMode);
265
282
 
266
- this.exportsGlobal = Object.assign({}, this.exportsGlobal, result.exportsGlobal);
283
+ const afterMerge = Object.assign({}, this.exportsGlobal, result.exportsGlobal);
284
+ // Temporary Sapiens log (SUP-3192)
285
+ if (this.options.projectData && this.options.projectData.projectId === 'fZ63D61PRQQVvvtGY6Ue' && this.options.suites && this.options.suites.includes('Sanity')) {
286
+ logger.info('testRunStatus - testEnd', {
287
+ 'this.exportsGlobal': this.exportsGlobal,
288
+ 'result.exportsGlobal': result.exportsGlobal,
289
+ afterMerge,
290
+ executionId,
291
+ 'test.testId': test.testId,
292
+ 'test.resultId': test.resultId,
293
+ });
294
+ }
295
+ this.exportsGlobal = afterMerge;
267
296
  return test;
268
297
  };
269
298