@convesoft/nx-rust 0.0.0-stage → 1.0.0-rc.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/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/README.md +48 -2
- package/executors.json +35 -0
- package/generators.json +19 -0
- package/package.json +26 -4
- package/src/cargo/build-settings.d.ts +54 -0
- package/src/cargo/build-settings.js +93 -0
- package/src/cargo/build-settings.js.map +1 -0
- package/src/cargo/configured-runner.d.ts +36 -0
- package/src/cargo/configured-runner.js +99 -0
- package/src/cargo/configured-runner.js.map +1 -0
- package/src/cargo/configured-tools.d.ts +35 -0
- package/src/cargo/configured-tools.js +46 -0
- package/src/cargo/configured-tools.js.map +1 -0
- package/src/cargo/dep-info-basedir.d.ts +18 -0
- package/src/cargo/dep-info-basedir.js +38 -0
- package/src/cargo/dep-info-basedir.js.map +1 -0
- package/src/cargo/directories.d.ts +40 -0
- package/src/cargo/directories.js +89 -0
- package/src/cargo/directories.js.map +1 -0
- package/src/cargo/host-triple.d.ts +7 -0
- package/src/cargo/host-triple.js +21 -0
- package/src/cargo/host-triple.js.map +1 -0
- package/src/cargo/lockfile.d.ts +63 -0
- package/src/cargo/lockfile.js +157 -0
- package/src/cargo/lockfile.js.map +1 -0
- package/src/cargo/metadata.d.ts +112 -0
- package/src/cargo/metadata.js +37 -0
- package/src/cargo/metadata.js.map +1 -0
- package/src/cargo/package-specs.d.ts +54 -0
- package/src/cargo/package-specs.js +109 -0
- package/src/cargo/package-specs.js.map +1 -0
- package/src/cargo/paths-crates.d.ts +27 -0
- package/src/cargo/paths-crates.js +69 -0
- package/src/cargo/paths-crates.js.map +1 -0
- package/src/cargo/print-artifact-folders.d.ts +1 -0
- package/src/cargo/print-artifact-folders.js +58 -0
- package/src/cargo/print-artifact-folders.js.map +1 -0
- package/src/cargo/redirections.d.ts +87 -0
- package/src/cargo/redirections.js +195 -0
- package/src/cargo/redirections.js.map +1 -0
- package/src/cargo/run-cargo.d.ts +31 -0
- package/src/cargo/run-cargo.js +75 -0
- package/src/cargo/run-cargo.js.map +1 -0
- package/src/cargo/target-triples.d.ts +98 -0
- package/src/cargo/target-triples.js +265 -0
- package/src/cargo/target-triples.js.map +1 -0
- package/src/cargo/version-req.d.ts +12 -0
- package/src/cargo/version-req.js +122 -0
- package/src/cargo/version-req.js.map +1 -0
- package/src/compatibility/cargo-version.d.ts +43 -0
- package/src/compatibility/cargo-version.js +83 -0
- package/src/compatibility/cargo-version.js.map +1 -0
- package/src/compatibility/nx-bridge.d.ts +312 -0
- package/src/compatibility/nx-bridge.js +407 -0
- package/src/compatibility/nx-bridge.js.map +1 -0
- package/src/compatibility/nx-version.d.ts +104 -0
- package/src/compatibility/nx-version.js +272 -0
- package/src/compatibility/nx-version.js.map +1 -0
- package/src/executors/affected-inputs.d.ts +29 -0
- package/src/executors/affected-inputs.js +259 -0
- package/src/executors/affected-inputs.js.map +1 -0
- package/src/executors/affected-run.d.ts +54 -0
- package/src/executors/affected-run.js +394 -0
- package/src/executors/affected-run.js.map +1 -0
- package/src/executors/affected.d.ts +239 -0
- package/src/executors/affected.js +589 -0
- package/src/executors/affected.js.map +1 -0
- package/src/executors/baseline-context.d.ts +85 -0
- package/src/executors/baseline-context.js +227 -0
- package/src/executors/baseline-context.js.map +1 -0
- package/src/executors/baseline.d.ts +123 -0
- package/src/executors/baseline.js +356 -0
- package/src/executors/baseline.js.map +1 -0
- package/src/executors/batch.d.ts +75 -0
- package/src/executors/batch.js +434 -0
- package/src/executors/batch.js.map +1 -0
- package/src/executors/build-records.d.ts +110 -0
- package/src/executors/build-records.js +267 -0
- package/src/executors/build-records.js.map +1 -0
- package/src/executors/cargo/executor.d.ts +28 -0
- package/src/executors/cargo/executor.js +58 -0
- package/src/executors/cargo/executor.js.map +1 -0
- package/src/executors/cargo/schema.json +54 -0
- package/src/executors/cargo-invocation.d.ts +81 -0
- package/src/executors/cargo-invocation.js +109 -0
- package/src/executors/cargo-invocation.js.map +1 -0
- package/src/executors/cargo-output.d.ts +212 -0
- package/src/executors/cargo-output.js +646 -0
- package/src/executors/cargo-output.js.map +1 -0
- package/src/executors/command.d.ts +318 -0
- package/src/executors/command.js +517 -0
- package/src/executors/command.js.map +1 -0
- package/src/executors/coverage-baseline.d.ts +23 -0
- package/src/executors/coverage-baseline.js +284 -0
- package/src/executors/coverage-baseline.js.map +1 -0
- package/src/executors/declared-options.d.ts +21 -0
- package/src/executors/declared-options.js +58 -0
- package/src/executors/declared-options.js.map +1 -0
- package/src/executors/digests.d.ts +94 -0
- package/src/executors/digests.js +190 -0
- package/src/executors/digests.js.map +1 -0
- package/src/executors/dotenv-check.d.ts +79 -0
- package/src/executors/dotenv-check.js +553 -0
- package/src/executors/dotenv-check.js.map +1 -0
- package/src/executors/group-invocations.d.ts +80 -0
- package/src/executors/group-invocations.js +253 -0
- package/src/executors/group-invocations.js.map +1 -0
- package/src/executors/group-run.d.ts +114 -0
- package/src/executors/group-run.js +591 -0
- package/src/executors/group-run.js.map +1 -0
- package/src/executors/groups.d.ts +113 -0
- package/src/executors/groups.js +285 -0
- package/src/executors/groups.js.map +1 -0
- package/src/executors/input-check.d.ts +52 -0
- package/src/executors/input-check.js +271 -0
- package/src/executors/input-check.js.map +1 -0
- package/src/executors/kept-files.d.ts +98 -0
- package/src/executors/kept-files.js +341 -0
- package/src/executors/kept-files.js.map +1 -0
- package/src/executors/lockfile/executor.d.ts +16 -0
- package/src/executors/lockfile/executor.js +37 -0
- package/src/executors/lockfile/executor.js.map +1 -0
- package/src/executors/lockfile/schema.json +50 -0
- package/src/executors/napi-build.d.ts +73 -0
- package/src/executors/napi-build.js +420 -0
- package/src/executors/napi-build.js.map +1 -0
- package/src/executors/nextest.d.ts +185 -0
- package/src/executors/nextest.js +498 -0
- package/src/executors/nextest.js.map +1 -0
- package/src/executors/nx-command.d.ts +95 -0
- package/src/executors/nx-command.js +205 -0
- package/src/executors/nx-command.js.map +1 -0
- package/src/executors/nx-task-files.d.ts +82 -0
- package/src/executors/nx-task-files.js +156 -0
- package/src/executors/nx-task-files.js.map +1 -0
- package/src/executors/print-test-mode.d.ts +1 -0
- package/src/executors/print-test-mode.js +25 -0
- package/src/executors/print-test-mode.js.map +1 -0
- package/src/executors/release-publish/executor.d.ts +24 -0
- package/src/executors/release-publish/executor.js +165 -0
- package/src/executors/release-publish/executor.js.map +1 -0
- package/src/executors/release-publish/schema.json +30 -0
- package/src/executors/run/executor.d.ts +12 -0
- package/src/executors/run/executor.js +27 -0
- package/src/executors/run/executor.js.map +1 -0
- package/src/executors/run/schema.json +45 -0
- package/src/executors/runner-script.d.ts +12 -0
- package/src/executors/runner-script.js +22 -0
- package/src/executors/runner-script.js.map +1 -0
- package/src/executors/runtime-input-check.d.ts +24 -0
- package/src/executors/runtime-input-check.js +87 -0
- package/src/executors/runtime-input-check.js.map +1 -0
- package/src/executors/shared-artifacts.d.ts +44 -0
- package/src/executors/shared-artifacts.js +132 -0
- package/src/executors/shared-artifacts.js.map +1 -0
- package/src/executors/split-words.d.ts +24 -0
- package/src/executors/split-words.js +111 -0
- package/src/executors/split-words.js.map +1 -0
- package/src/executors/stage.d.ts +163 -0
- package/src/executors/stage.js +526 -0
- package/src/executors/stage.js.map +1 -0
- package/src/executors/staged-run.d.ts +24 -0
- package/src/executors/staged-run.js +110 -0
- package/src/executors/staged-run.js.map +1 -0
- package/src/executors/task-env.d.ts +271 -0
- package/src/executors/task-env.js +494 -0
- package/src/executors/task-env.js.map +1 -0
- package/src/executors/task-execution.d.ts +61 -0
- package/src/executors/task-execution.js +122 -0
- package/src/executors/task-execution.js.map +1 -0
- package/src/executors/task-guards.d.ts +112 -0
- package/src/executors/task-guards.js +430 -0
- package/src/executors/task-guards.js.map +1 -0
- package/src/executors/task-options.d.ts +114 -0
- package/src/executors/task-options.js +258 -0
- package/src/executors/task-options.js.map +1 -0
- package/src/executors/task.d.ts +166 -0
- package/src/executors/task.js +520 -0
- package/src/executors/task.js.map +1 -0
- package/src/executors/test-mode.d.ts +182 -0
- package/src/executors/test-mode.js +391 -0
- package/src/executors/test-mode.js.map +1 -0
- package/src/executors/test-runner.d.ts +44 -0
- package/src/executors/test-runner.js +159 -0
- package/src/executors/test-runner.js.map +1 -0
- package/src/executors/test-steps.d.ts +109 -0
- package/src/executors/test-steps.js +535 -0
- package/src/executors/test-steps.js.map +1 -0
- package/src/executors/wasm-build.d.ts +56 -0
- package/src/executors/wasm-build.js +216 -0
- package/src/executors/wasm-build.js.map +1 -0
- package/src/generators/crate/binary.schema.json +28 -0
- package/src/generators/crate/crate.d.ts +24 -0
- package/src/generators/crate/crate.js +108 -0
- package/src/generators/crate/crate.js.map +1 -0
- package/src/generators/crate/enclosing-workspace.d.ts +25 -0
- package/src/generators/crate/enclosing-workspace.js +58 -0
- package/src/generators/crate/enclosing-workspace.js.map +1 -0
- package/src/generators/crate/library.schema.json +28 -0
- package/src/generators/init/graph-check.d.ts +81 -0
- package/src/generators/init/graph-check.js +299 -0
- package/src/generators/init/graph-check.js.map +1 -0
- package/src/generators/init/init.d.ts +23 -0
- package/src/generators/init/init.js +113 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/report.d.ts +19 -0
- package/src/generators/init/report.js +93 -0
- package/src/generators/init/report.js.map +1 -0
- package/src/generators/init/schema.json +9 -0
- package/src/graph/artifact-kinds.d.ts +29 -0
- package/src/graph/artifact-kinds.js +50 -0
- package/src/graph/artifact-kinds.js.map +1 -0
- package/src/graph/artifact-names.d.ts +97 -0
- package/src/graph/artifact-names.js +276 -0
- package/src/graph/artifact-names.js.map +1 -0
- package/src/graph/build-records.d.ts +74 -0
- package/src/graph/build-records.js +104 -0
- package/src/graph/build-records.js.map +1 -0
- package/src/graph/caching.d.ts +148 -0
- package/src/graph/caching.js +676 -0
- package/src/graph/caching.js.map +1 -0
- package/src/graph/collisions.d.ts +106 -0
- package/src/graph/collisions.js +156 -0
- package/src/graph/collisions.js.map +1 -0
- package/src/graph/computation-reports.d.ts +89 -0
- package/src/graph/computation-reports.js +216 -0
- package/src/graph/computation-reports.js.map +1 -0
- package/src/graph/declared-files.d.ts +190 -0
- package/src/graph/declared-files.js +600 -0
- package/src/graph/declared-files.js.map +1 -0
- package/src/graph/discovery.d.ts +175 -0
- package/src/graph/discovery.js +656 -0
- package/src/graph/discovery.js.map +1 -0
- package/src/graph/edges.d.ts +25 -0
- package/src/graph/edges.js +94 -0
- package/src/graph/edges.js.map +1 -0
- package/src/graph/entries.d.ts +83 -0
- package/src/graph/entries.js +259 -0
- package/src/graph/entries.js.map +1 -0
- package/src/graph/inputs.d.ts +420 -0
- package/src/graph/inputs.js +746 -0
- package/src/graph/inputs.js.map +1 -0
- package/src/graph/lockfile-task.d.ts +74 -0
- package/src/graph/lockfile-task.js +105 -0
- package/src/graph/lockfile-task.js.map +1 -0
- package/src/graph/names.d.ts +41 -0
- package/src/graph/names.js +34 -0
- package/src/graph/names.js.map +1 -0
- package/src/graph/napi.d.ts +107 -0
- package/src/graph/napi.js +206 -0
- package/src/graph/napi.js.map +1 -0
- package/src/graph/nx-glob.d.ts +36 -0
- package/src/graph/nx-glob.js +152 -0
- package/src/graph/nx-glob.js.map +1 -0
- package/src/graph/nx-internals.d.ts +57 -0
- package/src/graph/nx-internals.js +128 -0
- package/src/graph/nx-internals.js.map +1 -0
- package/src/graph/options.d.ts +32 -0
- package/src/graph/options.js +80 -0
- package/src/graph/options.js.map +1 -0
- package/src/graph/outputs.d.ts +75 -0
- package/src/graph/outputs.js +140 -0
- package/src/graph/outputs.js.map +1 -0
- package/src/graph/path-dependencies.d.ts +122 -0
- package/src/graph/path-dependencies.js +459 -0
- package/src/graph/path-dependencies.js.map +1 -0
- package/src/graph/plugin-package.d.ts +36 -0
- package/src/graph/plugin-package.js +132 -0
- package/src/graph/plugin-package.js.map +1 -0
- package/src/graph/plugin-version.d.ts +20 -0
- package/src/graph/plugin-version.js +153 -0
- package/src/graph/plugin-version.js.map +1 -0
- package/src/graph/projects.d.ts +141 -0
- package/src/graph/projects.js +182 -0
- package/src/graph/projects.js.map +1 -0
- package/src/graph/reached-projects.d.ts +46 -0
- package/src/graph/reached-projects.js +102 -0
- package/src/graph/reached-projects.js.map +1 -0
- package/src/graph/real-path.d.ts +47 -0
- package/src/graph/real-path.js +113 -0
- package/src/graph/real-path.js.map +1 -0
- package/src/graph/redirected-uses.d.ts +98 -0
- package/src/graph/redirected-uses.js +434 -0
- package/src/graph/redirected-uses.js.map +1 -0
- package/src/graph/registration.d.ts +121 -0
- package/src/graph/registration.js +233 -0
- package/src/graph/registration.js.map +1 -0
- package/src/graph/script-input.d.ts +46 -0
- package/src/graph/script-input.js +65 -0
- package/src/graph/script-input.js.map +1 -0
- package/src/graph/settings.d.ts +178 -0
- package/src/graph/settings.js +479 -0
- package/src/graph/settings.js.map +1 -0
- package/src/graph/target-defaults-causes.d.ts +33 -0
- package/src/graph/target-defaults-causes.js +202 -0
- package/src/graph/target-defaults-causes.js.map +1 -0
- package/src/graph/target-defaults-layers.d.ts +186 -0
- package/src/graph/target-defaults-layers.js +420 -0
- package/src/graph/target-defaults-layers.js.map +1 -0
- package/src/graph/target-defaults-meaning.d.ts +95 -0
- package/src/graph/target-defaults-meaning.js +292 -0
- package/src/graph/target-defaults-meaning.js.map +1 -0
- package/src/graph/target-defaults-report.d.ts +77 -0
- package/src/graph/target-defaults-report.js +242 -0
- package/src/graph/target-defaults-report.js.map +1 -0
- package/src/graph/target-defaults.d.ts +79 -0
- package/src/graph/target-defaults.js +425 -0
- package/src/graph/target-defaults.js.map +1 -0
- package/src/graph/target-fields.d.ts +16 -0
- package/src/graph/target-fields.js +134 -0
- package/src/graph/target-fields.js.map +1 -0
- package/src/graph/target-tables.d.ts +45 -0
- package/src/graph/target-tables.js +299 -0
- package/src/graph/target-tables.js.map +1 -0
- package/src/graph/targets.d.ts +367 -0
- package/src/graph/targets.js +404 -0
- package/src/graph/targets.js.map +1 -0
- package/src/graph/unification.d.ts +141 -0
- package/src/graph/unification.js +459 -0
- package/src/graph/unification.js.map +1 -0
- package/src/graph/unignored-directories.d.ts +25 -0
- package/src/graph/unignored-directories.js +89 -0
- package/src/graph/unignored-directories.js.map +1 -0
- package/src/graph/visibility.d.ts +17 -0
- package/src/graph/visibility.js +67 -0
- package/src/graph/visibility.js.map +1 -0
- package/src/graph/warnings.d.ts +38 -0
- package/src/graph/warnings.js +77 -0
- package/src/graph/warnings.js.map +1 -0
- package/src/graph/wasm.d.ts +56 -0
- package/src/graph/wasm.js +77 -0
- package/src/graph/wasm.js.map +1 -0
- package/src/index.d.ts +68 -0
- package/src/index.js +109 -0
- package/src/index.js.map +1 -0
- package/src/release/manifests.d.ts +95 -0
- package/src/release/manifests.js +164 -0
- package/src/release/manifests.js.map +1 -0
- package/src/release/places.d.ts +127 -0
- package/src/release/places.js +368 -0
- package/src/release/places.js.map +1 -0
- package/src/release/publish-cargo.d.ts +177 -0
- package/src/release/publish-cargo.js +351 -0
- package/src/release/publish-cargo.js.map +1 -0
- package/src/release/publish-crates.d.ts +124 -0
- package/src/release/publish-crates.js +242 -0
- package/src/release/publish-crates.js.map +1 -0
- package/src/release/publish-environments.d.ts +50 -0
- package/src/release/publish-environments.js +284 -0
- package/src/release/publish-environments.js.map +1 -0
- package/src/release/publish-messages.d.ts +66 -0
- package/src/release/publish-messages.js +273 -0
- package/src/release/publish-messages.js.map +1 -0
- package/src/release/publish-registry.d.ts +27 -0
- package/src/release/publish-registry.js +135 -0
- package/src/release/publish-registry.js.map +1 -0
- package/src/release/publish-settings.d.ts +26 -0
- package/src/release/publish-settings.js +56 -0
- package/src/release/publish-settings.js.map +1 -0
- package/src/release/publish.d.ts +59 -0
- package/src/release/publish.js +620 -0
- package/src/release/publish.js.map +1 -0
- package/src/release/repository.d.ts +73 -0
- package/src/release/repository.js +219 -0
- package/src/release/repository.js.map +1 -0
- package/src/release/requirements.d.ts +34 -0
- package/src/release/requirements.js +30 -0
- package/src/release/requirements.js.map +1 -0
- package/src/release/toml-edit.d.ts +67 -0
- package/src/release/toml-edit.js +453 -0
- package/src/release/toml-edit.js.map +1 -0
- package/src/release/version-actions.d.ts +133 -0
- package/src/release/version-actions.js +474 -0
- package/src/release/version-actions.js.map +1 -0
- package/src/release/version-checks.d.ts +21 -0
- package/src/release/version-checks.js +151 -0
- package/src/release/version-checks.js.map +1 -0
- package/src/release/version-lockfiles.d.ts +61 -0
- package/src/release/version-lockfiles.js +222 -0
- package/src/release/version-lockfiles.js.map +1 -0
- package/src/tools/napi-cli.d.ts +70 -0
- package/src/tools/napi-cli.js +63 -0
- package/src/tools/napi-cli.js.map +1 -0
- package/src/tools/optional-tools.d.ts +121 -0
- package/src/tools/optional-tools.js +303 -0
- package/src/tools/optional-tools.js.map +1 -0
- package/src/tools/print-napi-cli.d.ts +1 -0
- package/src/tools/print-napi-cli.js +24 -0
- package/src/tools/print-napi-cli.js.map +1 -0
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupScriptFailedStatus = exports.buildFailedStatus = exports.testRunFailedStatus = void 0;
|
|
4
|
+
exports.nextestEnd = nextestEnd;
|
|
5
|
+
exports.writeToolConfiguration = writeToolConfiguration;
|
|
6
|
+
exports.removeToolConfiguration = removeToolConfiguration;
|
|
7
|
+
exports.readJunitReport = readJunitReport;
|
|
8
|
+
exports.parseJunit = parseJunit;
|
|
9
|
+
exports.binaryPackage = binaryPackage;
|
|
10
|
+
exports.suiteKind = suiteKind;
|
|
11
|
+
exports.parseNextestList = parseNextestList;
|
|
12
|
+
exports.readNextestStep = readNextestStep;
|
|
13
|
+
const node_fs_1 = require("node:fs");
|
|
14
|
+
const node_os_1 = require("node:os");
|
|
15
|
+
const node_path_1 = require("node:path");
|
|
16
|
+
const cargo_output_1 = require("./cargo-output");
|
|
17
|
+
const test_steps_1 = require("./test-steps");
|
|
18
|
+
/** The status with which nextest ends where a test failed or the run ended early. */
|
|
19
|
+
exports.testRunFailedStatus = 100;
|
|
20
|
+
/** The status with which nextest ends where the build of the test binaries failed. */
|
|
21
|
+
exports.buildFailedStatus = 101;
|
|
22
|
+
/** The status with which nextest ends where a setup script failed. */
|
|
23
|
+
exports.setupScriptFailedStatus = 105;
|
|
24
|
+
// What other statuses of nextest mean, for messages.
|
|
25
|
+
const otherStatuses = {
|
|
26
|
+
4: "which nextest gives where no test is to run",
|
|
27
|
+
92: "which nextest gives where its version does not meet the repository's nextest-version requirement",
|
|
28
|
+
96: "which nextest gives where it cannot set up the run, as for a configuration that it cannot read",
|
|
29
|
+
104: "which nextest gives where it cannot list the tests of a test binary, as where the binary cannot be loaded",
|
|
30
|
+
};
|
|
31
|
+
/** How a nextest step ended ({@link NextestEnd}), from its exit status and signal, or why it did not start. */
|
|
32
|
+
function nextestEnd(code, signal, failure) {
|
|
33
|
+
var _a;
|
|
34
|
+
if (failure !== undefined) {
|
|
35
|
+
return { kind: "unexplained", reason: failure };
|
|
36
|
+
}
|
|
37
|
+
if (signal !== null) {
|
|
38
|
+
return { kind: "unexplained", reason: `cargo nextest run was stopped by ${signal}` };
|
|
39
|
+
}
|
|
40
|
+
if (code === 0) {
|
|
41
|
+
return { kind: "succeeded" };
|
|
42
|
+
}
|
|
43
|
+
if (code === exports.testRunFailedStatus) {
|
|
44
|
+
return { kind: "tests-failed" };
|
|
45
|
+
}
|
|
46
|
+
if (code === exports.buildFailedStatus) {
|
|
47
|
+
return { kind: "build-failed" };
|
|
48
|
+
}
|
|
49
|
+
if (code === exports.setupScriptFailedStatus) {
|
|
50
|
+
return { kind: "setup-failed" };
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
kind: "unexplained",
|
|
54
|
+
reason: `cargo nextest run exited with status ${code}, ${(_a = otherStatuses[code !== null && code !== void 0 ? code : -1]) !== null && _a !== void 0 ? _a : `which is none of success, a failed test or a run that ended early (${exports.testRunFailedStatus}), a failed build (${exports.buildFailedStatus}) and a failed setup script (${exports.setupScriptFailedStatus})`}`,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Writes the plugin's tool configuration for one nextest step into a new
|
|
59
|
+
* folder under the system's temporary folder (`DES-TEST-RUN`, "nextest's
|
|
60
|
+
* configuration"): it sets only `junit.path` of the `default` profile, to an
|
|
61
|
+
* absolute path in that folder, which every profile inherits unless it sets
|
|
62
|
+
* its own. nextest gives the repository's configuration precedence over a
|
|
63
|
+
* tool configuration, so that the file adds the report and changes no test
|
|
64
|
+
* that runs (`EVD-TEST-STREAM-AND-NEXTEST`). No other task's files are
|
|
65
|
+
* written: the folder is the step's own.
|
|
66
|
+
*/
|
|
67
|
+
// @mara implements DES-TEST-RUN
|
|
68
|
+
function writeToolConfiguration() {
|
|
69
|
+
const folder = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "nx-rust-nextest-"));
|
|
70
|
+
const file = (0, node_path_1.join)(folder, "nextest.toml");
|
|
71
|
+
const report = (0, node_path_1.join)(folder, "junit.xml");
|
|
72
|
+
(0, node_fs_1.writeFileSync)(file, [
|
|
73
|
+
"# Written by @convesoft/nx-rust for one cargo nextest run, which reads its results from this report.",
|
|
74
|
+
"[profile.default.junit]",
|
|
75
|
+
`path = ${JSON.stringify(report)}`,
|
|
76
|
+
"",
|
|
77
|
+
].join("\n"));
|
|
78
|
+
return { folder, file, report };
|
|
79
|
+
}
|
|
80
|
+
/** Removes the folder of a tool configuration and the report in it. */
|
|
81
|
+
function removeToolConfiguration(configuration) {
|
|
82
|
+
(0, node_fs_1.rmSync)(configuration.folder, { recursive: true, force: true });
|
|
83
|
+
}
|
|
84
|
+
/** Reads nextest's JUnit report at `file` ({@link JunitReport}). */
|
|
85
|
+
function readJunitReport(file) {
|
|
86
|
+
let text;
|
|
87
|
+
try {
|
|
88
|
+
text = (0, node_fs_1.readFileSync)(file, "utf8");
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
if (error.code === "ENOENT") {
|
|
92
|
+
return { missing: file };
|
|
93
|
+
}
|
|
94
|
+
return { unreadable: error instanceof Error ? error.message : String(error), file };
|
|
95
|
+
}
|
|
96
|
+
const cases = parseJunit(text);
|
|
97
|
+
return typeof cases === "string" ? { unreadable: cases, file } : { cases };
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The tests of a JUnit report as nextest writes it: `testsuites`, one
|
|
101
|
+
* `testsuite` per test binary named by its binary ID, and in it one
|
|
102
|
+
* `testcase` per test that ran, which failed where it has a `failure` or
|
|
103
|
+
* `error` element; `flakyFailure` and `rerunFailure` record tries.
|
|
104
|
+
*
|
|
105
|
+
* The reading checks the nesting of every element and fails on anything it
|
|
106
|
+
* does not understand, so that a report cut short or of another shape is
|
|
107
|
+
* not read as one without failures. Text, where a test's output goes, holds
|
|
108
|
+
* no markup: XML escapes it.
|
|
109
|
+
*
|
|
110
|
+
* @returns The tests, or why the report cannot be read.
|
|
111
|
+
*/
|
|
112
|
+
function parseJunit(text) {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
const cases = [];
|
|
115
|
+
const stack = [];
|
|
116
|
+
const tag = /<(\/?)([A-Za-z_][\w.:-]*)((?:\s+[\w.:-]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>/y;
|
|
117
|
+
let current;
|
|
118
|
+
let suites = 0;
|
|
119
|
+
let at = text.indexOf("<");
|
|
120
|
+
while (at !== -1) {
|
|
121
|
+
const skip = [
|
|
122
|
+
["<?", "?>"],
|
|
123
|
+
["<!--", "-->"],
|
|
124
|
+
["<![CDATA[", "]]>"],
|
|
125
|
+
["<!", ">"],
|
|
126
|
+
].find(([open]) => text.startsWith(open, at));
|
|
127
|
+
if (skip !== undefined) {
|
|
128
|
+
const end = text.indexOf(skip[1], at + skip[0].length);
|
|
129
|
+
if (end === -1) {
|
|
130
|
+
return "it ends inside a declaration, a comment or a CDATA section";
|
|
131
|
+
}
|
|
132
|
+
at = text.indexOf("<", end + skip[1].length);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
tag.lastIndex = at;
|
|
136
|
+
const match = tag.exec(text);
|
|
137
|
+
if (match === null) {
|
|
138
|
+
return `it holds markup that is no element at character ${at}`;
|
|
139
|
+
}
|
|
140
|
+
const [, closing, name, attributeText, selfClosing] = match;
|
|
141
|
+
if (closing === "/") {
|
|
142
|
+
const open = stack.pop();
|
|
143
|
+
if (open === undefined || open.name !== name) {
|
|
144
|
+
return `the element ${name} closes where ${open === undefined ? "none" : open.name} is open`;
|
|
145
|
+
}
|
|
146
|
+
if (name === "testcase") {
|
|
147
|
+
current = undefined;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
const attributes = parseAttributes(attributeText);
|
|
152
|
+
const parent = (_a = stack.at(-1)) === null || _a === void 0 ? void 0 : _a.name;
|
|
153
|
+
if (name === "testsuites" && parent !== undefined) {
|
|
154
|
+
return "testsuites is not the root element";
|
|
155
|
+
}
|
|
156
|
+
if (name === "testsuite") {
|
|
157
|
+
if (parent !== "testsuites" && parent !== undefined) {
|
|
158
|
+
return `a testsuite lies inside ${parent}`;
|
|
159
|
+
}
|
|
160
|
+
if (attributes.name === undefined) {
|
|
161
|
+
return "a testsuite has no name";
|
|
162
|
+
}
|
|
163
|
+
suites += 1;
|
|
164
|
+
}
|
|
165
|
+
if (name === "testcase") {
|
|
166
|
+
if (parent !== "testsuite") {
|
|
167
|
+
return `a testcase lies inside ${parent !== null && parent !== void 0 ? parent : "no testsuite"}`;
|
|
168
|
+
}
|
|
169
|
+
const suite = (_b = stack.at(-1)) === null || _b === void 0 ? void 0 : _b.attributes.name;
|
|
170
|
+
if (attributes.name === undefined) {
|
|
171
|
+
return `a testcase of ${suite} has no name`;
|
|
172
|
+
}
|
|
173
|
+
current = { binary: suite, name: attributes.name, failed: false, skipped: false };
|
|
174
|
+
cases.push(current);
|
|
175
|
+
}
|
|
176
|
+
if ((name === "failure" || name === "error") && parent === "testcase") {
|
|
177
|
+
if (current === undefined) {
|
|
178
|
+
return "a failure lies outside a testcase";
|
|
179
|
+
}
|
|
180
|
+
current.failed = true;
|
|
181
|
+
}
|
|
182
|
+
if (name === "skipped" && parent === "testcase" && current !== undefined) {
|
|
183
|
+
current.skipped = true;
|
|
184
|
+
}
|
|
185
|
+
if (selfClosing !== "/") {
|
|
186
|
+
stack.push({ name, attributes });
|
|
187
|
+
}
|
|
188
|
+
else if (name === "testcase") {
|
|
189
|
+
current = undefined;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
at = text.indexOf("<", tag.lastIndex);
|
|
193
|
+
}
|
|
194
|
+
if (stack.length > 0) {
|
|
195
|
+
return `it ends while ${stack.map((entry) => entry.name).join(" > ")} is open`;
|
|
196
|
+
}
|
|
197
|
+
if (suites === 0 && cases.length === 0 && !/<testsuites\b/.test(text)) {
|
|
198
|
+
return "it holds no testsuites element";
|
|
199
|
+
}
|
|
200
|
+
return cases;
|
|
201
|
+
}
|
|
202
|
+
// The attributes of a start tag, with the five entities and character
|
|
203
|
+
// references decoded.
|
|
204
|
+
function parseAttributes(text) {
|
|
205
|
+
var _a, _b;
|
|
206
|
+
const attributes = {};
|
|
207
|
+
for (const match of text.matchAll(/([\w.:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g)) {
|
|
208
|
+
attributes[match[1]] = decodeEntities((_b = (_a = match[2]) !== null && _a !== void 0 ? _a : match[3]) !== null && _b !== void 0 ? _b : "");
|
|
209
|
+
}
|
|
210
|
+
return attributes;
|
|
211
|
+
}
|
|
212
|
+
function decodeEntities(value) {
|
|
213
|
+
return value.replace(/&(#x[0-9a-fA-F]+|#\d+|amp|lt|gt|quot|apos);/g, (_, entity) => {
|
|
214
|
+
switch (entity) {
|
|
215
|
+
case "amp":
|
|
216
|
+
return "&";
|
|
217
|
+
case "lt":
|
|
218
|
+
return "<";
|
|
219
|
+
case "gt":
|
|
220
|
+
return ">";
|
|
221
|
+
case "quot":
|
|
222
|
+
return '"';
|
|
223
|
+
case "apos":
|
|
224
|
+
return "'";
|
|
225
|
+
default:
|
|
226
|
+
return String.fromCodePoint(entity.startsWith("#x") ? parseInt(entity.slice(2), 16) : parseInt(entity.slice(1), 10));
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* The package of a test binary: the part of its binary ID before the first
|
|
232
|
+
* `::`, which was the package name of every binary in nextest's reports
|
|
233
|
+
* (`EVD-CARGO-AFFECTED-REPORT`, "Tests to crates").
|
|
234
|
+
*/
|
|
235
|
+
function binaryPackage(binary) {
|
|
236
|
+
const at = binary.indexOf("::");
|
|
237
|
+
return at === -1 ? binary : binary.slice(0, at);
|
|
238
|
+
}
|
|
239
|
+
/** The kind of the suite of nextest's JUnit report named `name` ({@link SuiteKind}). */
|
|
240
|
+
function suiteKind(name) {
|
|
241
|
+
const bare = name.replace(/@stress-\d+$/, "");
|
|
242
|
+
const script = /^@setup-script:(.+)$/.exec(bare);
|
|
243
|
+
if (script !== null) {
|
|
244
|
+
return { kind: "setup-script", script: script[1] };
|
|
245
|
+
}
|
|
246
|
+
if (bare === "" || bare.includes("@")) {
|
|
247
|
+
return { kind: "unknown", name };
|
|
248
|
+
}
|
|
249
|
+
return { kind: "binary", binary: bare, package: binaryPackage(bare) };
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* The tests whose `filter-match` is `matches` in the output of `cargo
|
|
253
|
+
* nextest list --message-format json`, whose format nextest keeps stable:
|
|
254
|
+
* `rust-suites` by binary ID, each with its `package-name` and its
|
|
255
|
+
* `testcases`, each of which matches the run's filters or not, with the
|
|
256
|
+
* reason (`EVD-NEXTEST-RUNNER-STEPS`). An output of another shape cannot be
|
|
257
|
+
* read.
|
|
258
|
+
*/
|
|
259
|
+
function parseNextestList(stdout) {
|
|
260
|
+
var _a;
|
|
261
|
+
let data;
|
|
262
|
+
try {
|
|
263
|
+
data = JSON.parse(stdout);
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
return {
|
|
267
|
+
unreadable: `its output is no JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const suites = data === null || data === void 0 ? void 0 : data["rust-suites"];
|
|
271
|
+
if (typeof suites !== "object" || suites === null) {
|
|
272
|
+
return { unreadable: "its output holds no rust-suites" };
|
|
273
|
+
}
|
|
274
|
+
const tests = [];
|
|
275
|
+
for (const [binary, entry] of Object.entries(suites)) {
|
|
276
|
+
const suite = entry;
|
|
277
|
+
const pkg = suite === null || suite === void 0 ? void 0 : suite["package-name"];
|
|
278
|
+
const testcases = suite === null || suite === void 0 ? void 0 : suite.testcases;
|
|
279
|
+
if (typeof pkg !== "string" || typeof testcases !== "object" || testcases === null) {
|
|
280
|
+
return { unreadable: `its suite ${binary} has no package-name or no testcases` };
|
|
281
|
+
}
|
|
282
|
+
for (const [name, test] of Object.entries(testcases)) {
|
|
283
|
+
const status = (_a = test === null || test === void 0 ? void 0 : test["filter-match"]) === null || _a === void 0 ? void 0 : _a.status;
|
|
284
|
+
if (status !== "matches" && status !== "mismatch") {
|
|
285
|
+
return { unreadable: `the test ${binary} ${name} has no filter-match that it knows` };
|
|
286
|
+
}
|
|
287
|
+
if (status === "matches") {
|
|
288
|
+
tests.push({ package: pkg, binary, name });
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return { tests };
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Reads the step `cargo nextest run` of a group of several crates or of the
|
|
296
|
+
* whole workspace (`DES-TEST-RUN`, steps 3 and 4, "nextest's
|
|
297
|
+
* configuration"), from nextest's exit status, its JUnit report and, where
|
|
298
|
+
* it exits with 100, its list of the tests that the run was to run, never
|
|
299
|
+
* from a line that nextest or cargo writes for people:
|
|
300
|
+
*
|
|
301
|
+
* - with 0, which nextest gives only where every test that the run was to
|
|
302
|
+
* run finished and passed, every task passes; a report that holds a failed
|
|
303
|
+
* test then fails every task, since it contradicts the status;
|
|
304
|
+
* - with 100, which nextest gives where a test failed and where it ended the
|
|
305
|
+
* run early, as on a global timeout, a signal or an interrupt, a task
|
|
306
|
+
* passes only where the report holds no failed test of its package and
|
|
307
|
+
* every test of its package that the list names ran and passed; every task
|
|
308
|
+
* fails where the report is missing, as where the repository's profile
|
|
309
|
+
* sets its own `junit.path`, or cannot be read, and every task without a
|
|
310
|
+
* failed test of its own where the list cannot be read;
|
|
311
|
+
* - with 101, the build of the test binaries failed, which stops the step
|
|
312
|
+
* before any test runs, and every task fails with the crates that did not
|
|
313
|
+
* compile (`DES-BATCH`, "Test runs");
|
|
314
|
+
* - with 105, a setup script failed, and every task fails with the scripts
|
|
315
|
+
* that the report names;
|
|
316
|
+
* - with any other status, by a signal or without a start, every task fails.
|
|
317
|
+
*
|
|
318
|
+
* A report that holds a failed setup script, a suite that is neither a test
|
|
319
|
+
* binary nor a setup script ({@link suiteKind}) or a test of a package
|
|
320
|
+
* outside the group fails every task, whatever the status; a setup script
|
|
321
|
+
* that passed decides nothing.
|
|
322
|
+
*
|
|
323
|
+
* Each task's output holds the compiler's messages about its crate, the
|
|
324
|
+
* lines of nextest that name one of its test binaries with the output under
|
|
325
|
+
* them, and every line that names no crate of the group, such as nextest's
|
|
326
|
+
* `Starting` line, with the tests that the configuration skipped, and its
|
|
327
|
+
* summary; and the task's message gives the number of its crate's tests in
|
|
328
|
+
* the report, so that a crate whose tests the configuration skips shows 0.
|
|
329
|
+
*
|
|
330
|
+
* @param selection Whether the step runs a selection of affected tests
|
|
331
|
+
* (`DES-TEST-RUN`, step 3), which the count's wording then names.
|
|
332
|
+
*/
|
|
333
|
+
// @mara implements DES-TEST-RUN
|
|
334
|
+
// @mara implements DES-DIAGNOSTICS
|
|
335
|
+
// @mara implements REQ-TEST-RUNNER
|
|
336
|
+
function readNextestStep(output, end, crates, scope, report, listed, selection = false) {
|
|
337
|
+
const lines = (0, test_steps_1.splitLines)(output);
|
|
338
|
+
const texts = attributeNextest(lines, crates, scope).map((part) => part.join("\n"));
|
|
339
|
+
if (end.kind === "unexplained") {
|
|
340
|
+
return (0, cargo_output_1.failEvery)(crates, texts, end.reason);
|
|
341
|
+
}
|
|
342
|
+
if (end.kind === "build-failed") {
|
|
343
|
+
return (0, test_steps_1.failStopped)(crates, texts, (0, test_steps_1.notCompiled)(lines), (0, cargo_output_1.outsideMembers)(crates, scope).names, "cargo nextest run");
|
|
344
|
+
}
|
|
345
|
+
const names = new Set(crates.map((crate) => crate.name));
|
|
346
|
+
const kinds = "cases" in report ? report.cases.map((test) => suiteKind(test.binary)) : [];
|
|
347
|
+
const unknown = [
|
|
348
|
+
...new Set(kinds.flatMap((kind) => (kind.kind === "unknown" ? [kind.name] : []))),
|
|
349
|
+
];
|
|
350
|
+
if (unknown.length > 0) {
|
|
351
|
+
return (0, cargo_output_1.failEvery)(crates, texts, `nextest's JUnit report holds the ${unknown.length === 1 ? "suite" : "suites"} ${(0, cargo_output_1.describeList)(unknown.map((name) => `\`${name}\``))}, which @convesoft/nx-rust does not recognise as a test binary or a setup script`);
|
|
352
|
+
}
|
|
353
|
+
const strangers = [
|
|
354
|
+
...new Set(kinds.flatMap((kind) => kind.kind === "binary" && !names.has(kind.package) ? [kind.package] : [])),
|
|
355
|
+
];
|
|
356
|
+
if (strangers.length > 0) {
|
|
357
|
+
return (0, cargo_output_1.failEvery)(crates, texts, `nextest's JUnit report holds tests of ${(0, cargo_output_1.describeList)(strangers.map((name) => `\`${name}\``))}, which ${strangers.length === 1 ? "is" : "are"} no crate of this run, while the command let only the tests of its crates run`);
|
|
358
|
+
}
|
|
359
|
+
const failedScripts = "cases" in report
|
|
360
|
+
? [
|
|
361
|
+
...new Set(report.cases.flatMap((test, index) => {
|
|
362
|
+
const kind = kinds[index];
|
|
363
|
+
return kind.kind === "setup-script" && test.failed ? [kind.script] : [];
|
|
364
|
+
})),
|
|
365
|
+
]
|
|
366
|
+
: [];
|
|
367
|
+
if (failedScripts.length > 0 || end.kind === "setup-failed") {
|
|
368
|
+
return crates.map((crate, index) => ({
|
|
369
|
+
passed: false,
|
|
370
|
+
output: texts[index],
|
|
371
|
+
message: failedScripts.length > 0
|
|
372
|
+
? `${crate.task}: the setup ${failedScripts.length === 1 ? "script" : "scripts"} ${(0, cargo_output_1.describeList)(failedScripts.map((script) => `\`${script}\``))} of the repository's nextest configuration failed, so nextest did not run every test of this run, and every task of the group fails. nextest's output above shows the script's.`
|
|
373
|
+
: `${crate.task}: nextest exited with status ${exports.setupScriptFailedStatus}, which it gives where a setup script failed, so it did not run every test of this run, and every task of the group fails.`,
|
|
374
|
+
}));
|
|
375
|
+
}
|
|
376
|
+
// The report's tests of test binaries, each with the package of its binary.
|
|
377
|
+
const tests = "cases" in report
|
|
378
|
+
? report.cases.flatMap((test, index) => {
|
|
379
|
+
const kind = kinds[index];
|
|
380
|
+
return kind.kind === "binary"
|
|
381
|
+
? [Object.assign(Object.assign({}, test), { binary: kind.binary, package: kind.package })]
|
|
382
|
+
: [];
|
|
383
|
+
})
|
|
384
|
+
: [];
|
|
385
|
+
if (end.kind === "succeeded") {
|
|
386
|
+
if (tests.some((test) => test.failed)) {
|
|
387
|
+
return (0, cargo_output_1.failEvery)(crates, texts, "cargo nextest run exited with status 0, while its JUnit report holds a failed test");
|
|
388
|
+
}
|
|
389
|
+
return crates.map((crate, index) => ({
|
|
390
|
+
passed: true,
|
|
391
|
+
output: texts[index],
|
|
392
|
+
message: countLine(crate, report, tests, selection),
|
|
393
|
+
}));
|
|
394
|
+
}
|
|
395
|
+
// nextest exited with 100: a test failed, or the run ended early.
|
|
396
|
+
if ("missing" in report) {
|
|
397
|
+
return crates.map((crate, index) => ({
|
|
398
|
+
passed: false,
|
|
399
|
+
output: texts[index],
|
|
400
|
+
message: `${crate.task}: nextest exited with status ${exports.testRunFailedStatus}, which it gives where a test failed or the run ended early, and wrote no JUnit report to ${report.missing}, the file that @convesoft/nx-rust's tool configuration names. nextest writes the report elsewhere where the repository's nextest profile sets its own junit.path, which takes precedence over a tool configuration. Without the report, @convesoft/nx-rust cannot tell which crate's test failed, so every task of this cargo nextest run fails. Remove junit.path from the profile that the run uses in .config/nextest.toml (the default profile, or the one that NEXTEST_PROFILE chooses), or run the task with --batch=false, where its crate's tests run alone.`,
|
|
401
|
+
}));
|
|
402
|
+
}
|
|
403
|
+
if ("unreadable" in report) {
|
|
404
|
+
return (0, cargo_output_1.failEvery)(crates, texts, `nextest exited with status ${exports.testRunFailedStatus}, which it gives where a test failed or the run ended early, and its JUnit report ${report.file} cannot be read: ${report.unreadable}`);
|
|
405
|
+
}
|
|
406
|
+
return crates.map((crate, index) => {
|
|
407
|
+
const own = tests.filter((test) => test.package === crate.name);
|
|
408
|
+
const failed = own.filter((test) => test.failed);
|
|
409
|
+
if (failed.length > 0) {
|
|
410
|
+
return {
|
|
411
|
+
passed: false,
|
|
412
|
+
output: texts[index],
|
|
413
|
+
message: [
|
|
414
|
+
countLine(crate, report, tests, selection),
|
|
415
|
+
`${crate.task}: ${failed.length === 1 ? "a test" : `${failed.length} tests`} of ${crate.name} failed: ${failed.map((test) => `${test.binary} ${test.name}`).join(", ")}.`,
|
|
416
|
+
].join("\n"),
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
if (listed === undefined || "unreadable" in listed) {
|
|
420
|
+
return {
|
|
421
|
+
passed: false,
|
|
422
|
+
output: texts[index],
|
|
423
|
+
message: `${crate.task}: nextest exited with status ${exports.testRunFailedStatus}, which it gives where a test failed or the run ended early, and @convesoft/nx-rust could not learn from cargo nextest list which tests of ${crate.name} the run was to run${listed === undefined || !("unreadable" in listed) ? "" : `: ${listed.unreadable}`}. It cannot show that every test of ${crate.name} ran, so the task fails.`,
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
const ran = new Set(own.filter((test) => !test.skipped).map((test) => `${test.binary}\0${test.name}`));
|
|
427
|
+
const expected = listed.tests.filter((test) => test.package === crate.name);
|
|
428
|
+
const missing = expected.filter((test) => !ran.has(`${test.binary}\0${test.name}`));
|
|
429
|
+
if (missing.length === 0) {
|
|
430
|
+
return {
|
|
431
|
+
passed: true,
|
|
432
|
+
output: texts[index],
|
|
433
|
+
message: countLine(crate, report, tests, selection),
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
return {
|
|
437
|
+
passed: false,
|
|
438
|
+
output: texts[index],
|
|
439
|
+
message: [
|
|
440
|
+
countLine(crate, report, tests, selection),
|
|
441
|
+
`${crate.task}: the run was not complete: nextest did not run ${missing.length} of the ${expected.length} ${expected.length === 1 ? "test" : "tests"} of ${crate.name} that it was to run, such as ${missing
|
|
442
|
+
.slice(0, 3)
|
|
443
|
+
.map((test) => `${test.binary} ${test.name}`)
|
|
444
|
+
.join(", ")}. nextest ends a run early on a global timeout, a signal or an interrupt, and its output above says why. Tests that did not run cannot show that ${crate.name} passes, so the task fails.`,
|
|
445
|
+
].join("\n"),
|
|
446
|
+
};
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
// The line that gives the number of the crate's tests in the report that ran.
|
|
450
|
+
function countLine(crate, report, tests, selection) {
|
|
451
|
+
if (!("cases" in report)) {
|
|
452
|
+
return `${crate.task}: nextest wrote no JUnit report to the file that @convesoft/nx-rust's tool configuration names, as where the repository's nextest profile sets its own junit.path, so the number of tests that ran for ${crate.name} is not shown. nextest exited with status 0: every test that the run was to run passed.`;
|
|
453
|
+
}
|
|
454
|
+
const count = tests.filter((test) => test.package === crate.name && !test.skipped).length;
|
|
455
|
+
return count === 0
|
|
456
|
+
? selection
|
|
457
|
+
? `${crate.task}: nextest ran no test of ${crate.name}: none of its tests was selected, or the repository's nextest configuration skips those that were.`
|
|
458
|
+
: `${crate.task}: nextest ran no test of ${crate.name}: the crate has none, or the repository's nextest configuration skips them.`
|
|
459
|
+
: `${crate.task}: nextest ran ${count} ${count === 1 ? "test" : "tests"} of ${crate.name}, as its JUnit report shows.`;
|
|
460
|
+
}
|
|
461
|
+
// A line of nextest's that names a test: a status in capitals, such as
|
|
462
|
+
// `PASS`, `FAIL`, `TRY 2 FAIL` or `SLOW`, a time in brackets, a counter on
|
|
463
|
+
// newer versions, the binary ID and the test's name.
|
|
464
|
+
const statusLine = /^\s*[A-Z][A-Z0-9]*(?: [A-Z0-9]+)*\s+\[[^\]]*\]\s+(?:\(\s*\d+\/\d+\)\s+)?(\S+)\s+\S/;
|
|
465
|
+
// A line of nextest's about the whole run, which ends the block of a test.
|
|
466
|
+
const runHeader = /^\s*(?:Starting|Summary|Cancell?ing|Nextest run|Interrupted|Aborting)\b/;
|
|
467
|
+
/**
|
|
468
|
+
* The output of a nextest step, per crate: the lines before nextest's
|
|
469
|
+
* `Starting` line as compiler output ({@link attributeText}); after it, each
|
|
470
|
+
* line that names a test binary of a crate of the group, with the indented
|
|
471
|
+
* lines under it, such as the test's output, to that crate, and every other
|
|
472
|
+
* line to every crate.
|
|
473
|
+
*/
|
|
474
|
+
function attributeNextest(lines, crates, scope) {
|
|
475
|
+
const start = lines.findIndex((line) => /^\s*Starting \d+ tests? across /.test((0, cargo_output_1.plainLine)(line)));
|
|
476
|
+
const parts = (0, test_steps_1.attributeText)(start === -1 ? lines : lines.slice(0, start), crates, scope);
|
|
477
|
+
if (start === -1) {
|
|
478
|
+
return parts;
|
|
479
|
+
}
|
|
480
|
+
const every = crates.map((_, index) => index);
|
|
481
|
+
let target = every;
|
|
482
|
+
for (const line of lines.slice(start)) {
|
|
483
|
+
const plain = (0, cargo_output_1.plainLine)(line);
|
|
484
|
+
const status = statusLine.exec(plain);
|
|
485
|
+
if (status !== null) {
|
|
486
|
+
const index = crates.findIndex((crate) => crate.name === binaryPackage(status[1]));
|
|
487
|
+
target = index === -1 ? every : [index];
|
|
488
|
+
}
|
|
489
|
+
else if ((plain.trim() !== "" && !/^\s/.test(plain)) || runHeader.test(plain)) {
|
|
490
|
+
target = every;
|
|
491
|
+
}
|
|
492
|
+
for (const index of target) {
|
|
493
|
+
parts[index].push(line);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return parts;
|
|
497
|
+
}
|
|
498
|
+
//# sourceMappingURL=nextest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextest.js","sourceRoot":"","sources":["../../../../nx-rust/src/executors/nextest.ts"],"names":[],"mappings":";;;AA+CA,gCA2BC;AAuBD,wDAcC;AAGD,0DAEC;AA4BD,0CAYC;AAeD,gCAwFC;AAsCD,sCAGC;AAcD,8BAUC;AAuBD,4CAiCC;AA4CD,0CA2JC;AAnkBD,qCAA2E;AAC3E,qCAAiC;AACjC,yCAAiC;AACjC,iDAQwB;AACxB,6CAAmF;AAmBnF,qFAAqF;AACxE,QAAA,mBAAmB,GAAG,GAAG,CAAC;AACvC,sFAAsF;AACzE,QAAA,iBAAiB,GAAG,GAAG,CAAC;AACrC,sEAAsE;AACzD,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAE3C,qDAAqD;AACrD,MAAM,aAAa,GAAqC;IACtD,CAAC,EAAE,6CAA6C;IAChD,EAAE,EAAE,kGAAkG;IACtG,EAAE,EAAE,gGAAgG;IACpG,GAAG,EAAE,2GAA2G;CACjH,CAAC;AAEF,+GAA+G;AAC/G,SAAgB,UAAU,CACxB,IAAmB,EACnB,MAAqB,EACrB,OAAgB;;IAEhB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,oCAAoC,MAAM,EAAE,EAAE,CAAC;IACvF,CAAC;IACD,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACf,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,IAAI,KAAK,2BAAmB,EAAE,CAAC;QACjC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IAClC,CAAC;IACD,IAAI,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
+
import type { PostTasksExecutionContext, PreTasksExecutionContext } from "@nx/devkit";
|
|
2
|
+
/**
|
|
3
|
+
* The variable in which the plugin's `preTasksExecution` hook records the
|
|
4
|
+
* arguments of the `nx` command for the command's tasks, as a JSON list of
|
|
5
|
+
* strings (`DES-UNKNOWN-OPTIONS`, paragraph "Record").
|
|
6
|
+
*/
|
|
7
|
+
export declare const nxCommandVariable = "NX_RUST_NX_COMMAND";
|
|
8
|
+
/**
|
|
9
|
+
* The longest record, in bytes. Linux refuses to start a process with an
|
|
10
|
+
* environment variable longer than 128 KiB, so a longer record would fail
|
|
11
|
+
* every task of the command; it is left empty instead, which counts as no
|
|
12
|
+
* record.
|
|
13
|
+
*/
|
|
14
|
+
export declare const maxRecordBytes: number;
|
|
15
|
+
/**
|
|
16
|
+
* The variables that the hook sets for the tasks of a command, each computed
|
|
17
|
+
* from the command's arguments as Nx gives them to the hook: `process.argv`
|
|
18
|
+
* of the `nx` process, `--` included.
|
|
19
|
+
*
|
|
20
|
+
* Every variable here is set on every command, so that a value left in the
|
|
21
|
+
* environment by an earlier command, such as in the Nx daemon, which runs the
|
|
22
|
+
* hook in its own process, never reaches a task:
|
|
23
|
+
*
|
|
24
|
+
* - `NX_RUST_NX_COMMAND`, the arguments as a JSON list (`DES-UNKNOWN-OPTIONS`);
|
|
25
|
+
* - `NX_RUST_RUN_ID`, a value that no other run has when the command excludes
|
|
26
|
+
* task dependencies, and the empty string otherwise
|
|
27
|
+
* (`DES-LOCKFILE-HASHING`, "Excluded dependencies"). Every cached target
|
|
28
|
+
* that depends on the lockfile task hashes it, so that such a run, which
|
|
29
|
+
* runs no lockfile task, runs those tasks and stores nothing that is
|
|
30
|
+
* restored again, while a normal run keeps its keys;
|
|
31
|
+
* - `NX_RUST_COMMAND_ID`, an id of the command's own, under which its
|
|
32
|
+
* lockfile tasks keep a private copy of their digests for the check after
|
|
33
|
+
* cargo's call (`DES-LOCKFILE-HASHING`, "Post-check"). It starts with the
|
|
34
|
+
* id that Nx gives the command's hooks, so that
|
|
35
|
+
* {@link postTasksExecution} finds the copies, and ends with a random
|
|
36
|
+
* value, because Nx makes that id from the arguments and the millisecond.
|
|
37
|
+
* No target names it as an input.
|
|
38
|
+
*
|
|
39
|
+
* @param commandId The `id` that Nx gives the command's hooks.
|
|
40
|
+
*/
|
|
41
|
+
export declare function commandRecords(argv: readonly string[], commandId?: string, workspaceRoot?: string): Record<string, string>;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the arguments of an `nx` command exclude task dependencies, as
|
|
44
|
+
* Nx reads its boolean option `excludeTaskDependencies`: with the
|
|
45
|
+
* `yargs-parser` of the installed `nx` package, which takes
|
|
46
|
+
* `--exclude-task-dependencies`, `--excludeTaskDependencies`, `=true`,
|
|
47
|
+
* `=false` and `--no-exclude-task-dependencies` as Nx does. Words after
|
|
48
|
+
* `--` go to the tasks and do not count.
|
|
49
|
+
*/
|
|
50
|
+
export declare function excludesTaskDependencies(argv: readonly string[], workspaceRoot?: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The plugin's `preTasksExecution` hook, which Nx calls once per entry of the
|
|
53
|
+
* plugin before a command such as `nx run`, `nx run-many` or `nx affected`
|
|
54
|
+
* runs its tasks.
|
|
55
|
+
*
|
|
56
|
+
* It assigns each of {@link commandRecords} to `process.env`. Nx carries
|
|
57
|
+
* such an assignment to the `nx` process, whose tasks inherit it, also when
|
|
58
|
+
* the hook runs in the daemon or in a plugin worker, where Nx records the
|
|
59
|
+
* assignment and applies it to the `nx` process; a deletion would not be
|
|
60
|
+
* carried (`EVD-NX-OPTION-VALIDATION`). The command's record enters no
|
|
61
|
+
* task's cache key; `NX_RUST_RUN_ID` enters the keys of the targets that
|
|
62
|
+
* depend on the lockfile task. Every task of a command gets the same values.
|
|
63
|
+
*/
|
|
64
|
+
export declare function preTasksExecution(_options: unknown, context: PreTasksExecutionContext): void;
|
|
65
|
+
/**
|
|
66
|
+
* The plugin's `postTasksExecution` hook, which Nx calls once per entry of
|
|
67
|
+
* the plugin after a command has run its tasks, with the `id` that the
|
|
68
|
+
* command's `preTasksExecution` got. It removes the private copies of the
|
|
69
|
+
* digests that the command's lockfile tasks wrote (`DES-LOCKFILE-HASHING`),
|
|
70
|
+
* and the command's record of test modes with those that stopped commands
|
|
71
|
+
* left more than a day ago (`DES-TEST-MODE`). It removes what it can and
|
|
72
|
+
* never fails the command.
|
|
73
|
+
* A command that does not get here, because it was stopped, leaves its
|
|
74
|
+
* copies to the next lockfile task of the workspace, which removes those
|
|
75
|
+
* older than a day.
|
|
76
|
+
*/
|
|
77
|
+
export declare function postTasksExecution(_options: unknown, context: PostTasksExecutionContext): void;
|
|
78
|
+
/**
|
|
79
|
+
* The arguments of the `nx` command that started the task, as the hook
|
|
80
|
+
* recorded them in `env`, or `undefined` when there is no record, when it is
|
|
81
|
+
* empty, or when it is not a JSON list of strings.
|
|
82
|
+
*/
|
|
83
|
+
export declare function recordedNxCommand(env?: NodeJS.ProcessEnv): string[] | undefined;
|
|
84
|
+
/** The options that Nx parses from arguments it hands a task, keyed as Nx keys them. */
|
|
85
|
+
export type ParsedOverrides = Record<string, unknown> & {
|
|
86
|
+
_?: unknown[];
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The options that Nx parses from `args` when it hands them to a task as
|
|
90
|
+
* overrides: with the `yargs-parser` that the installed `nx` package uses,
|
|
91
|
+
* configured as Nx configures it there (`createOverrides` in
|
|
92
|
+
* `utils/command-line-utils.js` of `nx` 24), and without `_` when no
|
|
93
|
+
* positional word is left.
|
|
94
|
+
*/
|
|
95
|
+
export declare function parseAsNx(args: readonly string[], workspaceRoot?: string): ParsedOverrides;
|