@testomatio/reporter 1.6.0-beta-4-artifacts → 1.6.0-beta-6-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.
Files changed (2) hide show
  1. package/lib/uploader.js +9 -0
  2. package/package.json +1 -1
package/lib/uploader.js CHANGED
@@ -129,14 +129,19 @@ class S3Uploader {
129
129
  }
130
130
 
131
131
  const stats = fs.statSync(tempFilePath);
132
+ debug('Artifacts file stats:', +stats.mtime);
133
+ debug('Current time:', +new Date());
132
134
  const diff = +new Date() - +stats.mtime;
135
+ debug('Diff:', diff);
133
136
  const diffHours = diff / 1000 / 60 / 60;
137
+ debug('Diff hours:', diffHours);
134
138
  if (diffHours > 3) {
135
139
  console.log(APP_PREFIX, "Artifacts file is too old, can't process artifacts. Please re-run the tests.");
136
140
  return [];
137
141
  }
138
142
 
139
143
  const data = fs.readFileSync(tempFilePath, 'utf8');
144
+ debug('Artifacts file contents:', data);
140
145
  const lines = data.split('\n').filter(Boolean);
141
146
  return lines.map(line => JSON.parse(line));
142
147
  }
@@ -157,6 +162,10 @@ class S3Uploader {
157
162
 
158
163
  const tempFilePath = this.#getUploadFilePath(runId);
159
164
 
165
+ if (typeof filePath === 'string' && !path.isAbsolute(filePath)) {
166
+ filePath = path.join(process.cwd(), filePath);
167
+ }
168
+
160
169
  const data = { rid, file: filePath, uploaded };
161
170
  const jsonLine = `${JSON.stringify(data)}\n`;
162
171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "1.6.0-beta-4-artifacts",
3
+ "version": "1.6.0-beta-6-artifacts",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "typings": "typings/index.d.ts",