Skip to content

Commit

Permalink
Test external modules explicitly in CI (#8507)
Browse files Browse the repository at this point in the history
This setup is much simpler than calling Bazel from within Bazel
and making sure files and flags are set up correctly.

Co-authored-by: Derek Bailey <[email protected]>
  • Loading branch information
mering and dbaileychess authored Jan 23, 2025
1 parent 026c243 commit 50be3cf
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 149 deletions.
12 changes: 12 additions & 0 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ tasks:
- "//..."
test_targets:
- "//..."
test_module_cpp:
platform: ubuntu2204
bazel: ${{ bazel }}
working_directory: tests/bazel_repository_test_dir
build_targets:
- "//..."
test_module_ts:
platform: ubuntu2204
bazel: ${{ bazel }}
working_directory: tests/ts/bazel_repository_test_dir
test_targets:
- "//..."
verify_macos:
platform: macos
bazel: ${{ bazel }}
Expand Down
4 changes: 4 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
ts/node_modules

# Test workspaces
tests/bazel_repository_test_dir
tests/ts/bazel_repository_test_dir
14 changes: 0 additions & 14 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,3 @@ use_repo(node, "nodejs_linux_amd64")
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
rules_ts_ext.deps()
use_repo(rules_ts_ext, "npm_typescript")

bazel_dep(
name = "rules_bazel_integration_test",
version = "0.31.0",
dev_dependency = True,
)

bazel_binaries = use_extension(
"@rules_bazel_integration_test//:extensions.bzl",
"bazel_binaries",
dev_dependency = True,
)
bazel_binaries.download(version = "6.5.0")
use_repo(bazel_binaries, "bazel_binaries", "bazel_binaries_bazelisk", "build_bazel_bazel_6_5_0")
20 changes: 0 additions & 20 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,3 @@ esbuild_register_toolchains(
name = "esbuild",
esbuild_version = LATEST_ESBUILD_VERSION,
)

http_archive(
name = "rules_bazel_integration_test",
sha256 = "3e24bc0fba88177cd0ae87c1e37bf7de5d5af8e812f00817a58498b1a8368fca",
urls = [
"https://github.com/bazel-contrib/rules_bazel_integration_test/releases/download/v0.31.0/rules_bazel_integration_test.v0.31.0.tar.gz",
],
)

load("@rules_bazel_integration_test//bazel_integration_test:deps.bzl", "bazel_integration_test_rules_dependencies")

bazel_integration_test_rules_dependencies()

load("@cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies")

bazel_starlib_dependencies()

load("@rules_bazel_integration_test//bazel_integration_test:defs.bzl", "bazel_binaries")

bazel_binaries(versions = ["6.5.0"])
6 changes: 0 additions & 6 deletions tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("//:build_defs.bzl", "DEFAULT_FLATC_ARGS", "flatbuffer_cc_library")
load(":defs.bzl", "flatbuffers_as_external_repo_test")

package(default_visibility = ["//visibility:private"])

Expand Down Expand Up @@ -269,8 +268,3 @@ flatbuffer_cc_library(
name = "alignment_test_cc_fbs",
srcs = ["alignment_test.fbs"],
)

flatbuffers_as_external_repo_test(
name = "bazel_repository_test",
directory = "bazel_repository_test_dir",
)
29 changes: 0 additions & 29 deletions tests/bazel_repository_test_template.sh

This file was deleted.

74 changes: 0 additions & 74 deletions tests/defs.bzl

This file was deleted.

6 changes: 0 additions & 6 deletions tests/ts/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@aspect_rules_js//js:defs.bzl", "js_test")
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
load("//:typescript.bzl", "flatbuffer_ts_library")
load("//tests:defs.bzl", "flatbuffers_as_external_repo_test")

package(default_visibility = ["//visibility:private"])

Expand Down Expand Up @@ -61,8 +60,3 @@ TEST_COMPLEX_ARRAYS_DATA = glob([
#("JavaScriptFlexBuffersTest", TBD_DATA)
("JavaScriptComplexArraysTest", TEST_COMPLEX_ARRAYS_DATA),
)]

flatbuffers_as_external_repo_test(
name = "bazel_repository_test",
directory = "bazel_repository_test_dir",
)

0 comments on commit 50be3cf

Please sign in to comment.