@fabricorg/experiments 0.6.4 → 0.6.5

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/dist/bin/fx.js CHANGED
@@ -7540,7 +7540,8 @@ var TestRunListInput = external_exports.object({
7540
7540
  status: TestRunStatus.optional(),
7541
7541
  source: CreateTestRunInput.shape.source.optional(),
7542
7542
  suite: external_exports.string().min(1).max(240).optional(),
7543
- limit: external_exports.coerce.number().int().min(1).max(200).optional()
7543
+ limit: external_exports.coerce.number().int().min(1).max(200).optional(),
7544
+ offset: external_exports.coerce.number().int().min(0).max(1e5).optional()
7544
7545
  });
7545
7546
  var TestRunListResponse = external_exports.object({
7546
7547
  runs: external_exports.array(TestRun.omit({ cases: true }))
@@ -8659,6 +8660,42 @@ function normalizeTestEvidence(value, options = {}) {
8659
8660
  artifacts
8660
8661
  };
8661
8662
  }
8663
+ if (kind === "fabric-cli" || kind === "cli") {
8664
+ const cases = arrayOfRecords(evidence.cases).map((testCase, index) => ({
8665
+ id: String(testCase.id ?? `cli:${index}`),
8666
+ name: String(testCase.name ?? `CLI check ${index + 1}`),
8667
+ ...typeof testCase.uri === "string" ? { uri: testCase.uri } : {},
8668
+ status: normalizeCaseStatus(testCase.status),
8669
+ durationMs: nonnegativeNumber(testCase.durationMs),
8670
+ tags: Array.isArray(testCase.tags) ? testCase.tags.map(String) : [],
8671
+ ...typeof testCase.error === "string" ? { error: testCase.error } : {},
8672
+ ...typeof testCase.statementId === "string" ? { statementId: testCase.statementId } : {},
8673
+ ...typeof testCase.resourceUrl === "string" ? { resourceUrl: testCase.resourceUrl } : {},
8674
+ ...testCase.details && typeof testCase.details === "object" ? { details: testCase.details } : {}
8675
+ }));
8676
+ const summary = summarize(cases);
8677
+ const requestedStatus = String(evidence.status ?? "").toLowerCase();
8678
+ const status = ["running", "passed", "failed", "skipped", "canceled"].includes(requestedStatus) ? requestedStatus : evidence.success === false || summary.failed > 0 ? "failed" : summary.total > 0 && summary.total === summary.skipped ? "skipped" : "passed";
8679
+ return {
8680
+ ...externalId ? { externalId } : {},
8681
+ source: "cli",
8682
+ suite: options.suite ?? String(evidence.suite ?? "Fabric CLI checks"),
8683
+ status,
8684
+ startedAt: isoOrNull(evidence.startedAt),
8685
+ finishedAt: isoOrNull(evidence.finishedAt) ?? (/* @__PURE__ */ new Date()).toISOString(),
8686
+ durationMs: nonnegativeNumber(
8687
+ evidence.durationMs ?? cases.reduce((sum, item) => sum + item.durationMs, 0)
8688
+ ),
8689
+ summary,
8690
+ environment: {
8691
+ ...objectOf(evidence.environment),
8692
+ ...compact({ profile: env.DBX_TEST_PROFILE, workspace: env.DATABRICKS_HOST })
8693
+ },
8694
+ revision: { ...objectOf(evidence.revision), ...revision },
8695
+ cases,
8696
+ artifacts
8697
+ };
8698
+ }
8662
8699
  if (kind === "junit") {
8663
8700
  const cases = arrayOfRecords(evidence.cases).map((testCase, index) => ({
8664
8701
  id: String(testCase.id ?? `junit:${index}`),
@@ -8761,6 +8798,9 @@ function xmlText(value) {
8761
8798
  function compact(value) {
8762
8799
  return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0));
8763
8800
  }
8801
+ function objectOf(value) {
8802
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
8803
+ }
8764
8804
  function nonnegativeNumber(value) {
8765
8805
  const number = Number(value ?? 0);
8766
8806
  return Number.isFinite(number) && number >= 0 ? Math.round(number) : 0;
@@ -8788,7 +8828,7 @@ COMMANDS
8788
8828
  import-mojito <dir> Import a directory of Mojito waves into Fabric YAML.
8789
8829
  preview <experimentId> Mint a signed preview link for a variant. Requires --variant.
8790
8830
  test env <action> Create, destroy, list, or reap Databricks test environments.
8791
- test publish <file> Publish BDD/live evidence to Studio Quality.
8831
+ test publish <file> Publish BDD/live/JUnit/CLI evidence to Studio Quality.
8792
8832
  init databricks-tests Scaffold a Databricks BDD test project.
8793
8833
 
8794
8834
  GLOBAL FLAGS
@@ -8804,8 +8844,8 @@ GLOBAL FLAGS
8804
8844
  --remote-url <url> publish: post to a manifest-worker
8805
8845
  --admin-token <tok> publish: bearer token for --remote-url
8806
8846
  --static <dir> publish: write signed manifest + tag-loader bundle to <dir>
8807
- --api-url <url> push/preview: hosted API base URL
8808
- --api-key <key> push/preview: hosted API key
8847
+ --api-url <url> push/preview/test publish: hosted API base URL
8848
+ --api-key <key> push/preview/test publish: hosted API key
8809
8849
  --no-publish push: apply actions without publishing manifest
8810
8850
  --name <name> test env: environment name (for example pr-1234)
8811
8851
  --seed <dir> test env create: JSON fixture directory
@@ -8824,7 +8864,7 @@ GLOBAL FLAGS
8824
8864
  -h, --help print this help
8825
8865
  -v, --version print version
8826
8866
  `;
8827
- var VERSION2 = "0.6.4";
8867
+ var VERSION2 = "0.6.5";
8828
8868
  function parse2(argv) {
8829
8869
  const positional = [];
8830
8870
  const flags = {};
@@ -8966,7 +9006,7 @@ async function main() {
8966
9006
  case "test":
8967
9007
  if (args.positional[0] === "publish") {
8968
9008
  if (!args.positional[1]) {
8969
- process.stderr.write("Usage: fx test publish <evidence.json> [flags]\n");
9009
+ process.stderr.write("Usage: fx test publish <evidence.json|junit.xml> [flags]\n");
8970
9010
  return 1;
8971
9011
  }
8972
9012
  return cmdTestPublish(args.positional[1], {