@flakiness/sdk 2.2.0 → 2.2.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/lib/browser.js +3 -7
- package/lib/index.js +3 -7
- package/package.json +1 -1
package/lib/browser.js
CHANGED
|
@@ -233,7 +233,6 @@ function deduplicateTestsSuitesEnvironments(report) {
|
|
|
233
233
|
gEnvs.set(envId, env);
|
|
234
234
|
gEnvIds.set(env, envId);
|
|
235
235
|
}
|
|
236
|
-
const usedEnvIds = /* @__PURE__ */ new Set();
|
|
237
236
|
function visitTests2(tests, suiteId) {
|
|
238
237
|
for (const test of tests ?? []) {
|
|
239
238
|
const testId = computeTestId(test, suiteId);
|
|
@@ -241,9 +240,6 @@ function deduplicateTestsSuitesEnvironments(report) {
|
|
|
241
240
|
gTestIds.set(test, testId);
|
|
242
241
|
gSuiteTests.set(suiteId, test);
|
|
243
242
|
for (const attempt of test.attempts) {
|
|
244
|
-
const env = report.environments[attempt.environmentIdx ?? 0];
|
|
245
|
-
const envId = gEnvIds.get(env);
|
|
246
|
-
usedEnvIds.add(envId);
|
|
247
243
|
if (attempt.annotations && !attempt.annotations.length)
|
|
248
244
|
delete attempt.annotations;
|
|
249
245
|
if (attempt.stdout && !attempt.stdout.length)
|
|
@@ -295,11 +291,11 @@ function deduplicateTestsSuitesEnvironments(report) {
|
|
|
295
291
|
visitTests2(report.tests ?? [], "suiteless");
|
|
296
292
|
for (const suite of report.suites ?? [])
|
|
297
293
|
visitSuite(suite);
|
|
298
|
-
const
|
|
299
|
-
const envIdToIndex = new Map(
|
|
294
|
+
const uniqueEnvIds = [...gEnvs.keys()];
|
|
295
|
+
const envIdToIndex = new Map(uniqueEnvIds.map((envId, index) => [envId, index]));
|
|
300
296
|
return {
|
|
301
297
|
...report,
|
|
302
|
-
environments:
|
|
298
|
+
environments: uniqueEnvIds.map((envId) => gEnvs.get(envId)),
|
|
303
299
|
suites: transformSuites(report.suites ?? []),
|
|
304
300
|
tests: transformTests(report.tests ?? [])
|
|
305
301
|
};
|
package/lib/index.js
CHANGED
|
@@ -891,7 +891,6 @@ function deduplicateTestsSuitesEnvironments(report) {
|
|
|
891
891
|
gEnvs.set(envId, env);
|
|
892
892
|
gEnvIds.set(env, envId);
|
|
893
893
|
}
|
|
894
|
-
const usedEnvIds = /* @__PURE__ */ new Set();
|
|
895
894
|
function visitTests2(tests, suiteId) {
|
|
896
895
|
for (const test of tests ?? []) {
|
|
897
896
|
const testId = computeTestId(test, suiteId);
|
|
@@ -899,9 +898,6 @@ function deduplicateTestsSuitesEnvironments(report) {
|
|
|
899
898
|
gTestIds.set(test, testId);
|
|
900
899
|
gSuiteTests.set(suiteId, test);
|
|
901
900
|
for (const attempt of test.attempts) {
|
|
902
|
-
const env = report.environments[attempt.environmentIdx ?? 0];
|
|
903
|
-
const envId = gEnvIds.get(env);
|
|
904
|
-
usedEnvIds.add(envId);
|
|
905
901
|
if (attempt.annotations && !attempt.annotations.length)
|
|
906
902
|
delete attempt.annotations;
|
|
907
903
|
if (attempt.stdout && !attempt.stdout.length)
|
|
@@ -953,11 +949,11 @@ function deduplicateTestsSuitesEnvironments(report) {
|
|
|
953
949
|
visitTests2(report.tests ?? [], "suiteless");
|
|
954
950
|
for (const suite of report.suites ?? [])
|
|
955
951
|
visitSuite(suite);
|
|
956
|
-
const
|
|
957
|
-
const envIdToIndex = new Map(
|
|
952
|
+
const uniqueEnvIds = [...gEnvs.keys()];
|
|
953
|
+
const envIdToIndex = new Map(uniqueEnvIds.map((envId, index) => [envId, index]));
|
|
958
954
|
return {
|
|
959
955
|
...report,
|
|
960
|
-
environments:
|
|
956
|
+
environments: uniqueEnvIds.map((envId) => gEnvs.get(envId)),
|
|
961
957
|
suites: transformSuites(report.suites ?? []),
|
|
962
958
|
tests: transformTests(report.tests ?? [])
|
|
963
959
|
};
|