From 15959c695d8e5d41fd7b7d85dc41f8cb78c41e9e Mon Sep 17 00:00:00 2001 From: Martin Kuntz Jacobsen Date: Mon, 9 Nov 2026 12:10:03 +0100 Subject: [PATCH] tests: fix typescript isolation, japicmp, cloudflare and oci verify tests on Linux (closes #9751) - typescript hostile fixture: the tsconfig control writes its html into its own declared directory, so it no longer shadows the rule's output - maven japicmp test: find bin/java in the runtime files, since test env on the forwarder does not expand toolchain make variables - cloudflare verify: an empty token is refused by the live gate - oci demos: scan = "off" so the verify tests need no trivy Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Xut2hwESun1HL2eSVd1d5B --- deploy/rules/BUILD.bazel | 5 +++-- deploy/rules/src/maven.rs | 6 +++++- deploy/rules/verify_test.rs | 2 +- tools/docs/typescript/BUILD.bazel | 4 ++-- tools/docs/typescript/fixture/hostile/BUILD.bazel | 3 ++- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/deploy/rules/BUILD.bazel b/deploy/rules/BUILD.bazel index afc6493b6e..3cd9b922ff 100644 --- a/deploy/rules/BUILD.bazel +++ b/deploy/rules/BUILD.bazel @@ -304,7 +304,7 @@ rust_test( "DX_TEST_RUSTC": "$(rlocationpath @rules_rust//rust/toolchain:current_rustc_files)", "DX_TEST_RUSTDOC": "$(rlocationpath @rules_rust//rust/toolchain:current_rustdoc_files)", "JAPICMP_JAR": "$(rlocationpath //deploy/rules/pins:japicmp)", - "MAVEN_API_JAVA": "$(JAVA_ROOTPATH)", + "MAVEN_API_JAVA": "$(rlocationpaths @rules_java//toolchains:current_java_runtime)", "MAVEN_API_NEW_JAR": "$(rlocationpath :maven_api_new_lib)", "MAVEN_API_OLD_JAR": "$(rlocationpath :maven_api_old_lib)", "MAVEN_DEMO_JAR": "$(rlocationpath :maven_demo_lib)", @@ -313,7 +313,6 @@ rust_test( "MAVEN_GNUPG_PUBKEY": "$(rlocationpath testdata/maven/gnupg/pubkey.asc)", "MAVEN_GNUPG_SIGNATURE": "$(rlocationpath testdata/maven/gnupg/payload.txt.asc)", }, - toolchains = ["@rules_java//toolchains:current_java_runtime"], deps = all_crate_deps( package_name = "deploy/dx_deploy_tools", normal = True, @@ -1981,6 +1980,7 @@ oci_deploy( name = "oci_demo", image_tar = ":oci_demo_tar", platform = "//deploy/rules/platforms:linux_amd64", + scan = "off", ) image_unit_tests(name = "image_unit") @@ -2005,6 +2005,7 @@ oci_deploy( name = "oci_demo_layout", image_tar = ":oci_demo_layout_dir", platform = "//deploy/rules/platforms:linux_amd64", + scan = "off", ) deploy_analysis_test( diff --git a/deploy/rules/src/maven.rs b/deploy/rules/src/maven.rs index 69692fb3df..e1ef13229a 100644 --- a/deploy/rules/src/maven.rs +++ b/deploy/rules/src/maven.rs @@ -1661,7 +1661,11 @@ pub(crate) mod tests { let rloc = std::env::var(name).expect(name); resolve_runfile(&rloc).expect(name) }; - let java = resolve_runfile(java.trim_start_matches("../")).expect("java"); + let java = java + .split_whitespace() + .find(|path| path.ends_with("/bin/java")) + .expect("the runtime lists bin/java"); + let java = resolve_runfile(java).expect("java"); let japicmp = resolve("JAPICMP_JAR"); let old_jar = std::fs::read(resolve("MAVEN_API_OLD_JAR")).expect("old jar"); let new_jar = resolve("MAVEN_API_NEW_JAR"); diff --git a/deploy/rules/verify_test.rs b/deploy/rules/verify_test.rs index 1627d2f43e..44225a1964 100644 --- a/deploy/rules/verify_test.rs +++ b/deploy/rules/verify_test.rs @@ -245,7 +245,7 @@ fn cloudflare_case() { .expect("missing token run must execute"); assert!(!missing.status.success()); assert!( - missing.stderr.contains("CLOUDFLARE_API_TOKEN is not set"), + missing.stderr.contains("live upload needs CLOUDFLARE_API_TOKEN"), "{}", missing.stderr ); diff --git a/tools/docs/typescript/BUILD.bazel b/tools/docs/typescript/BUILD.bazel index 63268da081..d287085284 100644 --- a/tools/docs/typescript/BUILD.bazel +++ b/tools/docs/typescript/BUILD.bazel @@ -40,14 +40,14 @@ rust_test( data = [ "//tools/docs/typescript/fixture/hostile:hostile_control_base", "//tools/docs/typescript/fixture/hostile:hostile_control_package", - "//tools/docs/typescript/fixture/hostile:hostile_control_tsconfig", + "//tools/docs/typescript/fixture/hostile:hostile_control_tsconfig.typedoc.json", "//tools/docs/typescript/fixture/hostile:hostile_docs", "//tools/docs/typescript/fixture/hostile:hostile_docs.typedoc.json", ], env = { "DX_HOSTILE_CONTROL_BASE": "$(rootpath //tools/docs/typescript/fixture/hostile:hostile_control_base)", "DX_HOSTILE_CONTROL_PACKAGE": "$(rootpath //tools/docs/typescript/fixture/hostile:hostile_control_package)", - "DX_HOSTILE_CONTROL_TSCONFIG": "$(rootpath //tools/docs/typescript/fixture/hostile:hostile_control_tsconfig)", + "DX_HOSTILE_CONTROL_TSCONFIG": "$(rootpath //tools/docs/typescript/fixture/hostile:hostile_control_tsconfig.typedoc.json)", "DX_HOSTILE_SHARD": "$(rootpath //tools/docs/typescript/fixture/hostile:hostile_docs)", "DX_HOSTILE_TYPEDOC": "$(rootpath //tools/docs/typescript/fixture/hostile:hostile_docs.typedoc.json)", }, diff --git a/tools/docs/typescript/fixture/hostile/BUILD.bazel b/tools/docs/typescript/fixture/hostile/BUILD.bazel index 2603e53a83..189408e439 100644 --- a/tools/docs/typescript/fixture/hostile/BUILD.bazel +++ b/tools/docs/typescript/fixture/hostile/BUILD.bazel @@ -31,6 +31,7 @@ typescript_doc_shard( srcs = _SRCS + [ "tsconfig.json", ], + out_dirs = ["hostile_control_html"] if marker == "tsconfig" else [], outs = ["hostile_control_" + marker + ".typedoc.json"], args = [ "--tsconfig", @@ -41,7 +42,7 @@ typescript_doc_shard( "src/index.ts", "--json", "hostile_control_" + marker + ".typedoc.json", - ], + ] + (["--out", "hostile_control_html"] if marker == "tsconfig" else []), chdir = package_name(), mnemonic = "DxTypedocControl", tool = "//quality/tools/javascript/bin:typedoc_stock",