-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(packaging): include missing .bzl files into the tar distribution (#…
…36) I had previously missed some .bzl files when refactoring the packaging for BCR/etc. This adds a manual test script that can be later reworked into a bazel-in-bazel integration test
- Loading branch information
Showing
8 changed files
with
60 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
# | ||
# TODO: use bazel integration test framework and rewrite this to be run by `bazel test` | ||
set -euo pipefail | ||
|
||
TMPDIR="$(mktemp -d)" | ||
trap 'rm -rf -- "$TMPDIR"' EXIT | ||
|
||
_log() { | ||
echo "INFO: $*" | ||
} | ||
|
||
main() { | ||
# First change the directory to workspace root | ||
cd "$(dirname "$0")"/.. | ||
|
||
local -r version="${1:-0.0.0}" | ||
|
||
# Then build the release artifact | ||
local -r tarball=$( | ||
bazel run \ | ||
--stamp --embed_label "$version" \ | ||
//:release -- release | ||
) | ||
|
||
_log "Extracting the tarball into a temporary directory to run examples" | ||
tar -xvf "$tarball" -C "$TMPDIR" | ||
|
||
# Then run examples with the packaged artifacts | ||
examples=( | ||
check_glob | ||
optional_attributes | ||
) | ||
|
||
for example in "${examples[@]}"; do | ||
_log "Running an example with the generated archive" | ||
pushd "examples/$example" | ||
bazel \ | ||
test \ | ||
--override_module rules_shellcheck="$TMPDIR" \ | ||
... | ||
popd | ||
done | ||
_log "Success" | ||
} | ||
|
||
main "$@" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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