Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Upgraded to rules_bazel_integration_test 0.5.0. (#111)
Browse files Browse the repository at this point in the history
Use a custom Bazel build for macos_build to fix issues with osx_archs.bzl.
  • Loading branch information
cgrindel authored Jan 21, 2022
1 parent b869e4d commit 911b0af
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ jobs:

macos_build:
runs-on: macos-11.0
# GH112: Remove the use of a custom Bazel when Keith's patch is merged and
# released.
env:
USE_BAZEL_VERSION: cgrindel/6.0.0-keith_patch
steps:
- uses: actions/checkout@v2
- uses: cgrindel/gha_set_up_bazel@v1
Expand Down
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load(
)
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(
"@cgrindel_rules_bazel_integration_test//bazel_integration_test:bazel_integration_test.bzl",
"@cgrindel_rules_bazel_integration_test//bazel_integration_test:defs.bzl",
"integration_test_utils",
)

Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ load("@cgrindel_rules_bazel_integration_test//bazel_integration_test:deps.bzl",
bazel_integration_test_rules_dependencies()

load("//:bazel_versions.bzl", "SUPPORTED_BAZEL_VERSIONS")
load("@build_bazel_integration_testing//tools:repositories.bzl", "bazel_binaries")
load("@cgrindel_rules_bazel_integration_test//bazel_integration_test:defs.bzl", "bazel_binaries")

bazel_binaries(versions = SUPPORTED_BAZEL_VERSIONS)
4 changes: 3 additions & 1 deletion examples/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@cgrindel_bazel_starlib//bzlformat:defs.bzl", "bzlformat_pkg")
load(
"@cgrindel_rules_bazel_integration_test//bazel_integration_test:bazel_integration_test.bzl",
"@cgrindel_rules_bazel_integration_test//bazel_integration_test:defs.bzl",
"bazel_integration_test",
"bazel_integration_tests",
"default_test_runner",
Expand Down Expand Up @@ -97,6 +97,7 @@ default_test_runner(
test_runner = ":default_test_runner",
workspace_files = integration_test_utils.glob_workspace_files(example) +
ADDITIONAL_WORKSPACE_FILES,
workspace_path = example,
)
for example in ALL_OS_TEST_EXAMPLES
]
Expand All @@ -111,6 +112,7 @@ default_test_runner(
test_runner = ":default_test_runner",
workspace_files = integration_test_utils.glob_workspace_files(example) +
ADDITIONAL_WORKSPACE_FILES,
workspace_path = example,
)
for example in MACOS_TEST_EXAMPLES
]
Expand Down
11 changes: 4 additions & 7 deletions examples/incompatible_xcode_use_dev_dir_attr_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ do_sudo() {

starting_dir="$(pwd)"
bazel_cmds=()
bazel="${BIT_BAZEL_BINARY:-}"
workspace_dir="${BIT_WORKSPACE_DIR:-}"

# Process args
while (("$#")); do
Expand All @@ -58,14 +60,9 @@ while (("$#")); do
done


[[ -n "${bazel_rel_path:-}" ]] || exit_on_error "Must specify the location of the Bazel binary."
[[ -n "${workspace_path:-}" ]] || exit_on_error "Must specify the location of the workspace file."
[[ -n "${bazel:-}" ]] || exit_on_error "Must specify the location of the Bazel binary."
[[ -n "${workspace_dir:-}" ]] || exit_on_error "Must specify the location of the workspace directory."

starting_path="$(pwd)"
starting_path="${starting_path%%*( )}"
bazel="$(normalize_path "${bazel_rel_path}")"

workspace_dir="$(dirname "${workspace_path}")"
cd "${workspace_dir}"

# BEGIN Custom test logic
Expand Down
11 changes: 4 additions & 7 deletions examples/incompatible_xcode_use_dev_dir_env_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ do_sudo() {

starting_dir="$(pwd)"
bazel_cmds=()
bazel="${BIT_BAZEL_BINARY:-}"
workspace_dir="${BIT_WORKSPACE_DIR:-}"

# Process args
while (("$#")); do
Expand All @@ -58,14 +60,9 @@ while (("$#")); do
done


[[ -n "${bazel_rel_path:-}" ]] || exit_on_error "Must specify the location of the Bazel binary."
[[ -n "${workspace_path:-}" ]] || exit_on_error "Must specify the location of the workspace file."
[[ -n "${bazel:-}" ]] || exit_on_error "Must specify the location of the Bazel binary."
[[ -n "${workspace_dir:-}" ]] || exit_on_error "Must specify the location of the workspace directory."

starting_path="$(pwd)"
starting_path="${starting_path%%*( )}"
bazel="$(normalize_path "${bazel_rel_path}")"

workspace_dir="$(dirname "${workspace_path}")"
cd "${workspace_dir}"

# BEGIN Custom test logic
Expand Down
8 changes: 5 additions & 3 deletions spm/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def spm_rules_dependencies():
maybe(
http_archive,
name = "cgrindel_rules_bazel_integration_test",
sha256 = "50b808269ee09373c099256103c40629db8a66fd884030d7a36cf9a2e8675b75",
strip_prefix = "rules_bazel_integration_test-0.3.1",
urls = ["https://github.com/cgrindel/rules_bazel_integration_test/archive/v0.3.1.tar.gz"],
sha256 = "39071d2ec8e3be74c8c4a6c395247182b987cdb78d3a3955b39e343ece624982",
strip_prefix = "rules_bazel_integration_test-0.5.0",
urls = [
"http://github.com/cgrindel/rules_bazel_integration_test/archive/v0.5.0.tar.gz",
],
)

0 comments on commit 911b0af

Please sign in to comment.