Skip to content

Commit

Permalink
Updated to latest rules_bazel_integration_test. (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrindel authored Dec 3, 2021
1 parent b4ccceb commit b02aafd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Execute Integration Tests
shell: bash
run: |
bazelisk test //examples:all_integration_tests
bazelisk test //:all_integration_tests
- name: Test Simple Example with Poorly Formatted Code Change
shell: bash
Expand Down
15 changes: 15 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ load(
"@cgrindel_rules_updatesrc//updatesrc:updatesrc.bzl",
"updatesrc_update_all",
)
load(
"@cgrindel_rules_bazel_integration_test//bazel_integration_test:bazel_integration_test.bzl",
"integration_test_utils",
)

bzlformat_pkg(name = "bzlformat")

Expand All @@ -14,6 +18,8 @@ updatesrc_update_all(
],
)

# MARK: - Related to Integration Tests

bzl_library(
name = "bazel_versions",
srcs = ["bazel_versions.bzl"],
Expand All @@ -40,3 +46,12 @@ filegroup(
],
visibility = ["//:__subpackages__"],
)

test_suite(
name = "all_integration_tests",
tags = integration_test_utils.DEFAULT_INTEGRATION_TEST_TAGS,
tests = [
"//examples:integration_tests",
],
visibility = ["//:__subpackages__"],
)
9 changes: 8 additions & 1 deletion examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load(
"@cgrindel_rules_bazel_integration_test//bazel_integration_test:bazel_integration_test.bzl",
"bazel_integration_test",
"bazel_integration_tests",
"default_test_runner",
"integration_test_utils",
)
load("//:bazel_versions.bzl", "CURRENT_BAZEL_VERSION", "OTHER_BAZEL_VERSIONS")
Expand All @@ -29,11 +30,16 @@ _EXAMPLE_NAMES = [
"rules_swift_helpers",
]

default_test_runner(
name = "default_test_runner",
)

# Integration tests executed against current version of Bazel
[
bazel_integration_test(
name = example + "_test",
bazel_version = CURRENT_BAZEL_VERSION,
test_runner = ":default_test_runner",
workspace_files = integration_test_utils.glob_workspace_files(example) +
ADDITIONAL_WORKSPACE_FILES,
)
Expand All @@ -55,14 +61,15 @@ _EXAMPLE_NAMES = [
bazel_integration_tests(
name = "simple_test",
bazel_versions = OTHER_BAZEL_VERSIONS,
test_runner = ":default_test_runner",
workspace_files = integration_test_utils.glob_workspace_files("simple") +
ADDITIONAL_WORKSPACE_FILES,
)

# MARK: - Test Suites

test_suite(
name = "all_integration_tests",
name = "integration_tests",
tags = integration_test_utils.DEFAULT_INTEGRATION_TEST_TAGS,
tests = [
# GH030: Enable this test once it is implemented.
Expand Down
6 changes: 3 additions & 3 deletions swiftformat/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def swiftformat_rules_dependencies():
maybe(
http_archive,
name = "cgrindel_rules_bazel_integration_test",
sha256 = "4fa679d98318df3e280e9c8b7f445cd06de7954aa0454702a62ebab8c820ce7e",
strip_prefix = "rules_bazel_integration_test-0.1.0",
urls = ["https://github.com/cgrindel/rules_bazel_integration_test/archive/v0.1.0.tar.gz"],
sha256 = "ef6cf463a269d969bdb3b31eed53c50d3667f02e004abc9ce7a3a2413eadca6a",
strip_prefix = "rules_bazel_integration_test-0.3.0",
urls = ["https://github.com/cgrindel/rules_bazel_integration_test/archive/v0.3.0.tar.gz"],
)

0 comments on commit b02aafd

Please sign in to comment.