-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: introduce an e2e test asserting that bzlmod works
- Loading branch information
Showing
10 changed files
with
88 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"aspect-build/bazel-lib" | ||
|
||
module( | ||
name = "aspect_bazel_lib", | ||
version = "0.0.0", | ||
compatibility_level = 1, | ||
toolchains_to_register = [ | ||
"@jq_toolchains//:all", | ||
"@yq_toolchains//:all", | ||
], | ||
) | ||
|
||
bazel_dep(name = "bazel_skylib", version = "1.1.1") | ||
bazel_dep(name = "platforms", version = "0.0.4") | ||
|
||
ext = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "ext") | ||
use_repo(ext, "jq_toolchains") | ||
use_repo(ext, "yq_toolchains") |
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,2 @@ | ||
common --experimental_enable_bzlmod | ||
common --registry=https://raw.githubusercontent.com/aspect-build/bazel-central-registry/main/ |
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,15 @@ | ||
load("@aspect_bazel_lib//lib:jq.bzl", "jq") | ||
load("@bazel_skylib//rules:diff_test.bzl", "diff_test") | ||
|
||
# No sources produces null (equivalent to --null-input) | ||
jq( | ||
name = "case_no_sources", | ||
srcs = [], | ||
filter = ".", | ||
) | ||
|
||
diff_test( | ||
name = "test", | ||
file1 = "case_no_sources", | ||
file2 = "expected", | ||
) |
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,13 @@ | ||
module( | ||
name = "e2e_bzlmod", | ||
version = "0.0.0", | ||
compatibility_level = 1, | ||
) | ||
|
||
bazel_dep(name = "aspect_bazel_lib", version = "0.9.8") | ||
bazel_dep(name = "bazel_skylib", version = "1.1.1") | ||
|
||
local_path_override( | ||
module_name = "aspect_bazel_lib", | ||
path = "../..", | ||
) |
Empty file.
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 @@ | ||
null |
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,16 @@ | ||
"Module extensions for use with bzlmod" | ||
|
||
load( | ||
"@aspect_bazel_lib//lib:repositories.bzl", | ||
"register_jq_toolchains", | ||
"register_yq_toolchains", | ||
) | ||
|
||
def _toolchain_extension(_): | ||
register_yq_toolchains(register = False) | ||
register_jq_toolchains(register = False) | ||
|
||
# TODO: some way for users to control repo name/version of the tools installed | ||
ext = module_extension( | ||
implementation = _toolchain_extension, | ||
) |
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