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