ortoni-report 4.0.1-beta.3 → 4.0.1

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/changelog.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Change Log:
2
2
 
3
+ ## V4.0.1
4
+
5
+ - **Improvemnts:**
6
+
7
+ - UI (Glance page)
8
+ - Fix: Chart where Y axis is cropped
9
+ - Fix: Project logo not showing #97
10
+
11
+ - **Merge Report**
12
+
13
+ - Playwright blob report feature is now available in Ortoni Report #83
14
+ - GitHub action support - [Refer the project for example](https://github.com/ortoniKC/pw-test)
15
+ - use the command to merge report
16
+ ```bash
17
+ npx ortoni-report merge-report
18
+ ```
19
+
3
20
  ## V4.0.0
4
21
 
5
22
  #### 🚨 Breaking Changes
package/dist/cli.js CHANGED
@@ -682,14 +682,14 @@ async function mergeAllData(options = {}) {
682
682
  if (b.idx === null) return -1;
683
683
  return a.idx - b.idx;
684
684
  }).map((x) => x.f);
685
- const dedupeByTestId = true;
686
- const resultsById = /* @__PURE__ */ new Map();
685
+ const allResults = [];
687
686
  const projectSet = /* @__PURE__ */ new Set();
688
687
  let totalDurationSum = 0;
689
- let totalDurationMax = 0;
690
688
  let mergedUserConfig = null;
691
689
  let mergedUserMeta = null;
692
690
  const badShards = [];
691
+ const shardCounts = {};
692
+ const shardDurMap = {};
693
693
  for (const file of sortedFiles) {
694
694
  const fullPath = path3.join(folderPath, file);
695
695
  try {
@@ -702,26 +702,25 @@ async function mergeAllData(options = {}) {
702
702
  badShards.push(file);
703
703
  continue;
704
704
  }
705
- for (const r of shardData.results) {
706
- const id = r.key;
707
- if (dedupeByTestId) {
708
- if (!resultsById.has(id)) {
709
- resultsById.set(id, r);
710
- } else {
711
- console.info(
712
- `Ortoni Report: Duplicate test ${id} found in ${file} \u2014 keeping first occurrence.`
713
- );
714
- }
715
- } else {
716
- resultsById.set(`${id}::${Math.random().toString(36).slice(2)}`, r);
717
- }
718
- }
705
+ shardData.results.forEach((r) => allResults.push(r));
706
+ shardCounts[file] = shardData.results.length;
719
707
  if (Array.isArray(shardData.projectSet)) {
720
- for (const p of shardData.projectSet) projectSet.add(p);
708
+ shardData.projectSet.forEach((p) => projectSet.add(p));
709
+ }
710
+ const rawShardDur = shardData.totalDuration;
711
+ let durToAdd = 0;
712
+ let perTestSum = 0;
713
+ if (typeof rawShardDur === "number") {
714
+ durToAdd = rawShardDur;
715
+ } else {
716
+ perTestSum = Array.isArray(shardData.results) ? shardData.results.reduce(
717
+ (acc, t) => acc + (Number(t?.duration) || 0),
718
+ 0
719
+ ) : 0;
720
+ durToAdd = perTestSum;
721
721
  }
722
- const dur = Number(shardData.duration) || 0;
723
- totalDurationSum += dur;
724
- if (dur > totalDurationMax) totalDurationMax = dur;
722
+ totalDurationSum += durToAdd;
723
+ shardDurMap[file] = durToAdd;
725
724
  if (shardData.userConfig) {
726
725
  if (!mergedUserConfig) mergedUserConfig = { ...shardData.userConfig };
727
726
  else {
@@ -757,7 +756,6 @@ async function mergeAllData(options = {}) {
757
756
  badShards
758
757
  );
759
758
  }
760
- const allResults = Array.from(resultsById.values());
761
759
  const totalDuration = totalDurationSum;
762
760
  const saveHistoryFromOptions = typeof options.saveHistory === "boolean" ? options.saveHistory : void 0;
763
761
  const saveHistoryFromShard = mergedUserConfig && typeof mergedUserConfig.saveHistory === "boolean" ? mergedUserConfig.saveHistory : void 0;
@@ -798,19 +796,23 @@ async function mergeAllData(options = {}) {
798
796
  dbManager
799
797
  );
800
798
  const finalReportData = await htmlGenerator.generateFinalReport(
799
+ // filteredResults: typically filter out skipped for display (keeps existing behavior)
801
800
  allResults.filter((r) => r.status !== "skipped"),
802
801
  totalDuration,
803
802
  allResults,
804
803
  projectSet
804
+ // pass Set<string> as original generateFinalReport expects
805
805
  );
806
806
  const fileManager = new FileManager(folderPath);
807
807
  const outputFileName = options.file || "ortoni-report.html";
808
- const outputPath = await fileManager.writeReportFile(
808
+ const outputPath = fileManager.writeReportFile(
809
809
  outputFileName,
810
810
  finalReportData
811
811
  );
812
- console.log(`\u2705 Final merged report generated at ${outputPath}`);
813
- if (runId) console.log(`\u2705 DB runId: ${runId}`);
812
+ console.log(`\u2705 Final merged report generated at ${await outputPath}`);
813
+ console.log(`\u2705 Shards merged: ${sortedFiles.length}`);
814
+ console.log(`\u2705 Tests per shard:`, shardCounts);
815
+ console.log(`\u2705 Total tests merged ${allResults.length}`);
814
816
  }
815
817
 
816
818
  // src/utils/expressServer.ts
package/dist/cli.mjs CHANGED
@@ -38,14 +38,14 @@ async function mergeAllData(options = {}) {
38
38
  if (b.idx === null) return -1;
39
39
  return a.idx - b.idx;
40
40
  }).map((x) => x.f);
41
- const dedupeByTestId = true;
42
- const resultsById = /* @__PURE__ */ new Map();
41
+ const allResults = [];
43
42
  const projectSet = /* @__PURE__ */ new Set();
44
43
  let totalDurationSum = 0;
45
- let totalDurationMax = 0;
46
44
  let mergedUserConfig = null;
47
45
  let mergedUserMeta = null;
48
46
  const badShards = [];
47
+ const shardCounts = {};
48
+ const shardDurMap = {};
49
49
  for (const file of sortedFiles) {
50
50
  const fullPath = path.join(folderPath, file);
51
51
  try {
@@ -58,26 +58,25 @@ async function mergeAllData(options = {}) {
58
58
  badShards.push(file);
59
59
  continue;
60
60
  }
61
- for (const r of shardData.results) {
62
- const id = r.key;
63
- if (dedupeByTestId) {
64
- if (!resultsById.has(id)) {
65
- resultsById.set(id, r);
66
- } else {
67
- console.info(
68
- `Ortoni Report: Duplicate test ${id} found in ${file} \u2014 keeping first occurrence.`
69
- );
70
- }
71
- } else {
72
- resultsById.set(`${id}::${Math.random().toString(36).slice(2)}`, r);
73
- }
74
- }
61
+ shardData.results.forEach((r) => allResults.push(r));
62
+ shardCounts[file] = shardData.results.length;
75
63
  if (Array.isArray(shardData.projectSet)) {
76
- for (const p of shardData.projectSet) projectSet.add(p);
64
+ shardData.projectSet.forEach((p) => projectSet.add(p));
65
+ }
66
+ const rawShardDur = shardData.totalDuration;
67
+ let durToAdd = 0;
68
+ let perTestSum = 0;
69
+ if (typeof rawShardDur === "number") {
70
+ durToAdd = rawShardDur;
71
+ } else {
72
+ perTestSum = Array.isArray(shardData.results) ? shardData.results.reduce(
73
+ (acc, t) => acc + (Number(t?.duration) || 0),
74
+ 0
75
+ ) : 0;
76
+ durToAdd = perTestSum;
77
77
  }
78
- const dur = Number(shardData.duration) || 0;
79
- totalDurationSum += dur;
80
- if (dur > totalDurationMax) totalDurationMax = dur;
78
+ totalDurationSum += durToAdd;
79
+ shardDurMap[file] = durToAdd;
81
80
  if (shardData.userConfig) {
82
81
  if (!mergedUserConfig) mergedUserConfig = { ...shardData.userConfig };
83
82
  else {
@@ -113,7 +112,6 @@ async function mergeAllData(options = {}) {
113
112
  badShards
114
113
  );
115
114
  }
116
- const allResults = Array.from(resultsById.values());
117
115
  const totalDuration = totalDurationSum;
118
116
  const saveHistoryFromOptions = typeof options.saveHistory === "boolean" ? options.saveHistory : void 0;
119
117
  const saveHistoryFromShard = mergedUserConfig && typeof mergedUserConfig.saveHistory === "boolean" ? mergedUserConfig.saveHistory : void 0;
@@ -154,19 +152,23 @@ async function mergeAllData(options = {}) {
154
152
  dbManager
155
153
  );
156
154
  const finalReportData = await htmlGenerator.generateFinalReport(
155
+ // filteredResults: typically filter out skipped for display (keeps existing behavior)
157
156
  allResults.filter((r) => r.status !== "skipped"),
158
157
  totalDuration,
159
158
  allResults,
160
159
  projectSet
160
+ // pass Set<string> as original generateFinalReport expects
161
161
  );
162
162
  const fileManager = new FileManager(folderPath);
163
163
  const outputFileName = options.file || "ortoni-report.html";
164
- const outputPath = await fileManager.writeReportFile(
164
+ const outputPath = fileManager.writeReportFile(
165
165
  outputFileName,
166
166
  finalReportData
167
167
  );
168
- console.log(`\u2705 Final merged report generated at ${outputPath}`);
169
- if (runId) console.log(`\u2705 DB runId: ${runId}`);
168
+ console.log(`\u2705 Final merged report generated at ${await outputPath}`);
169
+ console.log(`\u2705 Shards merged: ${sortedFiles.length}`);
170
+ console.log(`\u2705 Tests per shard:`, shardCounts);
171
+ console.log(`\u2705 Total tests merged ${allResults.length}`);
170
172
  }
171
173
 
172
174
  // src/cli.ts