Just: use bazel test with -as-test targets for dist building

This avoids reinstalling dists when nothing changed, by leveraging
bazel test's caching behavior with the existing -as-test target
variants.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paolo Tranquilli
2026-04-02 11:30:33 +02:00
parent 994e5510bd
commit fd97208960
2 changed files with 2 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ _build_dist LANGUAGE: _require_semmle_code (_maybe_build_dist LANGUAGE)
# Build the language-specific distribution if we are in an internal repository checkout
# Otherwise, do nothing
[no-exit-message]
_maybe_build_dist LANGUAGE: (_if_in_semmle_code ('cd "$SEMMLE_CODE"; tools/bazel run //language-packs:intree-' + LANGUAGE) '# using codeql from PATH, if any')
_maybe_build_dist LANGUAGE: (_if_in_semmle_code ('cd "$SEMMLE_CODE"; tools/bazel test //language-packs:intree-' + LANGUAGE + '-as-test --test_output=all') '# using codeql from PATH, if any')
# Call bazel. Uses our official bazel wrapper if we are in an internal repository checkout
[no-cd, no-exit-message]

View File

@@ -16,7 +16,7 @@ import "format.just"
# Run integration tests. Requires an internal repository checkout
[no-cd, no-exit-message]
_integration_test *ARGS: _require_semmle_code (_run "$SEMMLE_CODE/tools/pytest" ARGS)
_integration_test *ARGS: _require_semmle_code (_run "$SEMMLE_CODE/tools/pytest" "--codeql=build-as-test" ARGS)
# Generic run command recipe that can be used by other recipes, with nice rendering
[no-cd]