flakiness 0.299.0 → 0.301.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/lib/cli/cli.js CHANGED
@@ -957,13 +957,27 @@ var TestOutcomes;
957
957
  return x.regressed + x.expected + x.flaked + x.skipped + x.unexpected;
958
958
  }
959
959
  TestOutcomes2.sumAllCounts = sumAllCounts;
960
+ TestOutcomes2.LABELS = {
961
+ regressed: "regressed",
962
+ unexpected: "failed",
963
+ flaked: "flaky",
964
+ expected: "passed",
965
+ skipped: "skipped"
966
+ };
967
+ TestOutcomes2.EMOJI = {
968
+ regressed: "\u{1F525}",
969
+ unexpected: "\u274C",
970
+ expected: "\u2705",
971
+ flaked: "\u26A0\uFE0F",
972
+ skipped: "\u229D"
973
+ };
960
974
  function formatCounts(x, format) {
961
975
  const result = [];
962
- if (x.regressed > 0) result.push(format(x.regressed, "regressed", "regressed", "\u{1F525}"));
963
- if (x.unexpected > 0) result.push(format(x.unexpected, "unexpected", "failed", "\u274C"));
964
- if (x.expected > 0) result.push(format(x.expected, "expected", "passed", "\u2705"));
965
- if (x.flaked > 0) result.push(format(x.flaked, "flaked", "flaked", "\u26A0\uFE0F"));
966
- if (x.skipped > 0) result.push(format(x.skipped, "skipped", "skipped", "\u229D"));
976
+ if (x.regressed > 0) result.push(format(x.regressed, "regressed", TestOutcomes2.LABELS["regressed"], TestOutcomes2.EMOJI["regressed"]));
977
+ if (x.unexpected > 0) result.push(format(x.unexpected, "unexpected", TestOutcomes2.LABELS["unexpected"], TestOutcomes2.EMOJI["unexpected"]));
978
+ if (x.expected > 0) result.push(format(x.expected, "expected", TestOutcomes2.LABELS["expected"], TestOutcomes2.EMOJI["expected"]));
979
+ if (x.flaked > 0) result.push(format(x.flaked, "flaked", TestOutcomes2.LABELS["flaked"], TestOutcomes2.EMOJI["flaked"]));
980
+ if (x.skipped > 0) result.push(format(x.skipped, "skipped", TestOutcomes2.LABELS["skipped"], TestOutcomes2.EMOJI["skipped"]));
967
981
  return result;
968
982
  }
969
983
  TestOutcomes2.formatCounts = formatCounts;
@@ -1044,7 +1058,7 @@ import path7 from "path";
1044
1058
  // ../package.json
1045
1059
  var package_default = {
1046
1060
  name: "@flakiness/monorepo",
1047
- version: "0.299.0",
1061
+ version: "0.301.0",
1048
1062
  type: "module",
1049
1063
  private: true,
1050
1064
  scripts: {
@@ -1859,20 +1873,16 @@ async function cmdDownload(options) {
1859
1873
  let runIds = [];
1860
1874
  if (options.runId) {
1861
1875
  runIds = [options.runId, options.runId];
1862
- } else if (options.since) {
1863
- runIds = await api.project.listRuns.GET({
1864
- orgSlug: project.org.orgSlug,
1865
- projectSlug: project.projectSlug,
1866
- sinceTimestampMs: +options.since
1867
- });
1868
- console.log(`Found ${Ranges.cardinality(runIds)} reports uploaded since ${options.since}`);
1869
1876
  } else {
1877
+ const { snapshotId } = await api.snapshot.get.GET({ orgSlug, projectSlug });
1878
+ const sinceTimestampMs = options.since ? +options.since : +/* @__PURE__ */ new Date("Jan 1, 2000");
1870
1879
  runIds = await api.project.listRuns.GET({
1871
1880
  orgSlug: project.org.orgSlug,
1872
1881
  projectSlug: project.projectSlug,
1873
- sinceTimestampMs: +/* @__PURE__ */ new Date("Jan 1, 2000")
1882
+ snapshotId,
1883
+ sinceTimestampMs
1874
1884
  });
1875
- console.log(`Found ${Ranges.cardinality(runIds)} reports`);
1885
+ console.log(options.since ? `Found ${Ranges.cardinality(runIds)} reports uploaded since ${options.since}` : `Found ${Ranges.cardinality(runIds)} reports`);
1876
1886
  }
1877
1887
  const alreadyExisting = fs4.readdirSync(process.cwd());
1878
1888
  const downloadedRuns = alreadyExisting.filter((entry) => entry.startsWith(RUN_DIR_PREFIX)).map((run) => parseInt(run.substring(RUN_DIR_PREFIX.length), 10)).filter((runId) => !isNaN(runId));
@@ -2066,6 +2076,7 @@ async function cmdListTests(options) {
2066
2076
  accessToken: options.accessToken,
2067
2077
  flakinessProject: options.flakinessProject
2068
2078
  });
2079
+ const { snapshotId } = await api.snapshot.get.GET({ orgSlug, projectSlug });
2069
2080
  let preset;
2070
2081
  if (options.pr !== void 0)
2071
2082
  preset = { type: "pr", number: options.pr };
@@ -2074,6 +2085,7 @@ async function cmdListTests(options) {
2074
2085
  const result = await api.report.testStats.POST({
2075
2086
  orgSlug,
2076
2087
  projectSlug,
2088
+ snapshotId,
2077
2089
  preset,
2078
2090
  pageOptions: {
2079
2091
  // CLI pages are 1-based while backend pages are 0-based.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flakiness",
3
- "version": "0.299.0",
3
+ "version": "0.301.0",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "flakiness": "./lib/cli/cli.js"
@@ -19,8 +19,8 @@
19
19
  "author": "Degu Labs, Inc",
20
20
  "license": "MIT",
21
21
  "devDependencies": {
22
- "@flakiness/server": "0.299.0",
23
- "@flakiness/shared": "0.299.0",
22
+ "@flakiness/server": "0.301.0",
23
+ "@flakiness/shared": "0.301.0",
24
24
  "@playwright/test": "^1.62.1",
25
25
  "@types/debug": "^4.1.13",
26
26
  "@types/express": "^4.17.25",