Repository navigation
fix: run every busted test file and find main repo modules outside bazel run - #6
Merged
Merged
Conversation
Resolves each test file with its own rlocation call, because rlocation looks up only its first argument and busted dropped every file after the first. - Quote "$@" so arguments with spaces reach busted intact. - Add a second spec to //lua/busted_test:test_maths and an sh_test that checks busted reports both.
Changes binary_wrapper.lua to resolve main repo modules from the runfiles manifest, and from $RUNFILES_DIR/_main with a runfiles tree, instead of only from paths relative to the working directory. - Start every launcher with a bash shebang, so a launcher run by a program other than bash no longer falls back to /bin/sh and exits 1 silently. - Quote "$@" in the lua_binary, fennel_binary and luaunit launchers. - Add a fennel_binary example and an sh_test that runs it outside the runfiles tree, with a runfiles tree and with only a manifest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes busted_test running only its first file, and lua_binary/fennel_binary failing to find their own modules when run directly from bazel-bin.
Click for implementation details
rlocationcall;rlocationlooks up only its first argument.binary_wrapper.luafrom the runfiles manifest when there is no runfiles tree, which is what a plainbazel buildproduces on Linux with Bazel 9. With a runfiles tree, add$RUNFILES_DIR/_main/?.luaand?/init.luaso the working directory does not matter.BASH_RLOCATION_FUNCTIONwith#!/usr/bin/env bash. The launchers had no shebang, so a launcher started by a program other than bash (e.g.env) ran under/bin/shand exited 1 with no message. A#!line later in a script is a comment, so external users of the exported constant are unaffected."$@"in all four launchers.rules_shell0.8.0 toexamples/MODULE.bazel(already in the resolved graph) for two regression tests://lua/busted_test:test_maths_runs_all_fileschecks busted's TAP output reports both spec files.//fennel/basic:main_outside_runfiles_testruns afennel_binaryfrom outside the runfiles tree, once with a runfiles tree and once with only a manifest. The test sandbox has no manifest, so the test builds one from the runfiles tree.1..1, andmodule 'fennel.basic.example' not found)._main, as the wrapper'srlocationalready does.