Skip to content

Commit 0b8c5ca

Browse files
ted-xiecgrindel
andauthored
Add rules_shell dep to rules_bazel_integration_test (#368)
native.{sh_test,sh_library} no longer exist in Bazel HEAD. --------- Co-authored-by: Chuck Grindel <chuck@revealtech.ai>
1 parent 6f02081 commit 0b8c5ca

File tree

13 files changed

+27
-1059
lines changed

13 files changed

+27
-1059
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Ignore Bazel symlinks
22
bazel-*
3-
3+
MODULE.bazel.lock
44

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ bazel_dep(name = "bazel_skylib", version = "1.4.1")
77
bazel_dep(name = "rules_python", version = "0.19.0")
88
bazel_dep(name = "platforms", version = "0.0.7")
99
bazel_dep(name = "cgrindel_bazel_starlib", version = "0.18.0")
10+
bazel_dep(name = "rules_shell", version = "0.2.0")
1011

1112
# not a direct dependency, but required here for bazel starlib's difftest macros to work
1213
bazel_dep(

MODULE.bazel.lock

Lines changed: 0 additions & 1055 deletions
This file was deleted.

WORKSPACE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,16 @@ http_file(
6262
sha256 = "0baf36f9c3ef9d8b4833833e1d633707965c9850f69f04dd96712672b9e75cc0",
6363
url = "https://raw.githubusercontent.com/bazel-contrib/rules_bazel_integration_test/v0.12.0/.bazelversion",
6464
)
65+
66+
http_archive(
67+
name = "rules_shell",
68+
sha256 = "410e8ff32e018b9efd2743507e7595c26e2628567c42224411ff533b57d27c28",
69+
strip_prefix = "rules_shell-0.2.0",
70+
url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.2.0/rules_shell-v0.2.0.tar.gz",
71+
)
72+
73+
load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_shell_toolchains")
74+
75+
rules_shell_dependencies()
76+
77+
rules_shell_toolchains()

bazel_integration_test/bzlmod/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("@bazel_binaries//:defs.bzl", "bazel_binaries")
22
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
33
load("@cgrindel_bazel_starlib//bzlformat:defs.bzl", "bzlformat_pkg")
4+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
45
load(
56
"//bazel_integration_test:defs.bzl",
67
"bazel_integration_test",

bazel_integration_test/private/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ bzl_library(
4141
":integration_test_utils",
4242
"@bazel_skylib//lib:paths",
4343
"@bazel_skylib//rules:select_file",
44+
"@rules_shell//shell:rules_bzl",
4445
],
4546
)
4647

bazel_integration_test/private/bazel_integration_test.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ an integration test.\
33
"""
44

55
load("@bazel_skylib//lib:paths.bzl", "paths")
6+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
67
load(":integration_test_utils.bzl", "integration_test_utils")
78

89
# This was lovingly inspired by
@@ -168,7 +169,7 @@ def bazel_integration_test(
168169

169170
env["BIT_STARTUP_OPTIONS"] = startup_options
170171

171-
native.sh_test(
172+
sh_test(
172173
name = name,
173174
srcs = [
174175
"@rules_bazel_integration_test//bazel_integration_test/private:integration_test_wrapper.sh",

bazel_integration_test/private/script_test.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"A facility for script tests that create workspaces and call Bazel."
22

3+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
34
load(
45
"//bazel_integration_test/private:bazel_integration_test.bzl",
56
"bazel_integration_test",
@@ -98,7 +99,7 @@ def script_test(
9899
)
99100

100101
# Create the test runner that sets up and calls the test.
101-
native.sh_binary(
102+
sh_binary(
102103
name = runner_target,
103104
testonly = True,
104105
srcs = [runner_script],

examples/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
load("@bazel_binaries//:defs.bzl", "bazel_binaries")
22
load("@cgrindel_bazel_starlib//bzlformat:defs.bzl", "bzlformat_pkg")
3+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
34
load(
45
"//bazel_integration_test:defs.bzl",
56
"bazel_integration_test",

release/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ load(
1111
"release_archive",
1212
"update_readme",
1313
)
14+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
1415
load(
1516
"//bazel_integration_test:defs.bzl",
1617
"bazel_integration_test",
@@ -75,7 +76,7 @@ sh_binary(
7576
name = "archive_test_runner",
7677
testonly = True,
7778
srcs = ["archive_test_runner.sh"],
78-
data = ["//release:archive"],
79+
data = [":archive"],
7980
deps = [
8081
"@bazel_tools//tools/bash/runfiles",
8182
"@cgrindel_bazel_starlib//shlib/lib:assertions",

tests/tools_tests/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@cgrindel_bazel_starlib//bzlformat:defs.bzl", "bzlformat_pkg")
2+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
23

34
bzlformat_pkg(name = "bzlformat")
45

tests/tools_tests/shared_fns_tests/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@cgrindel_bazel_starlib//bzlformat:defs.bzl", "bzlformat_pkg")
2+
load("@rules_shell//shell:sh_test.bzl", "sh_test")
23

34
bzlformat_pkg(name = "bzlformat")
45

tools/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
load("@cgrindel_bazel_starlib//bzlformat:defs.bzl", "bzlformat_pkg")
2+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
23

34
exports_files(["fake_bazel.sh"])
45

0 commit comments

Comments
 (0)