Skip to content

Commit 075d311

Browse files
committed
chore: make gazelle bcr tests compatible with bcr presubmit environment
1 parent 46167f5 commit 075d311

File tree

26 files changed

+29
-23
lines changed

26 files changed

+29
-23
lines changed

.bazelci/presubmit.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -329,41 +329,41 @@ tasks:
329329
<<: *minimum_supported_version
330330
<<: *reusable_build_test_all
331331
<<: *coverage_targets_example_bzlmod_build_file_generation
332-
name: "examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
333-
working_directory: examples/bzlmod_build_file_generation
332+
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, minimum Bazel"
333+
working_directory: gazelle/examples/bzlmod_build_file_generation
334334
platform: ubuntu2204
335335
bazel: 7.x
336336
integration_test_bzlmod_generation_build_files_ubuntu:
337337
<<: *reusable_build_test_all
338338
<<: *coverage_targets_example_bzlmod_build_file_generation
339-
name: "examples/bzlmod_build_file_generation: Ubuntu"
340-
working_directory: examples/bzlmod_build_file_generation
339+
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu"
340+
working_directory: gazelle/examples/bzlmod_build_file_generation
341341
platform: ubuntu2204
342342
integration_test_bzlmod_generation_build_files_ubuntu_run:
343343
<<: *reusable_build_test_all
344-
name: "examples/bzlmod_build_file_generation: Ubuntu, Gazelle and pip"
345-
working_directory: examples/bzlmod_build_file_generation
344+
name: "gazelle/examples/bzlmod_build_file_generation: Ubuntu, Gazelle and pip"
345+
working_directory: gazelle/examples/bzlmod_build_file_generation
346346
platform: ubuntu2204
347347
shell_commands:
348348
- "bazel run //:gazelle_python_manifest.update"
349349
- "bazel run //:gazelle -- update"
350350
integration_test_bzlmod_build_file_generation_debian:
351351
<<: *reusable_build_test_all
352352
<<: *coverage_targets_example_bzlmod_build_file_generation
353-
name: "examples/bzlmod_build_file_generation: Debian"
354-
working_directory: examples/bzlmod_build_file_generation
353+
name: "gazelle/examples/bzlmod_build_file_generation: Debian"
354+
working_directory: gazelle/examples/bzlmod_build_file_generation
355355
platform: debian11
356356
integration_test_bzlmod_build_file_generation_macos:
357357
<<: *reusable_build_test_all
358358
<<: *coverage_targets_example_bzlmod_build_file_generation
359-
name: "examples/bzlmod_build_file_generation: MacOS"
360-
working_directory: examples/bzlmod_build_file_generation
359+
name: "gazelle/examples/bzlmod_build_file_generation: MacOS"
360+
working_directory: gazelle/examples/bzlmod_build_file_generation
361361
platform: macos
362362
integration_test_bzlmod_build_file_generation_windows:
363363
<<: *reusable_build_test_all
364364
# coverage is not supported on Windows
365-
name: "examples/bzlmod_build_file_generation: Windows"
366-
working_directory: examples/bzlmod_build_file_generation
365+
name: "gazelle/examples/bzlmod_build_file_generation: Windows"
366+
working_directory: gazelle/examples/bzlmod_build_file_generation
367367
platform: windows
368368

369369
integration_test_multi_python_versions_ubuntu_workspace:

.bcr/gazelle/presubmit.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
bcr_test_module:
16-
module_path: "../examples/bzlmod_build_file_generation"
16+
module_path: "examples/bzlmod_build_file_generation"
1717
matrix:
1818
platform: ["debian11", "macos", "ubuntu2004", "windows"]
1919
# last_rc is to get latest 8.x release. Replace with 8.x when available.
@@ -23,6 +23,8 @@ bcr_test_module:
2323
name: "Run test module"
2424
platform: ${{ platform }}
2525
bazel: ${{ bazel }}
26+
shell_commands:
27+
- "echo 'common --override_module=rules_python=' >> .bazelrc"
2628
build_targets:
2729
- "//..."
2830
- ":modules_map"

examples/bzlmod_build_file_generation/other_module/MODULE.bazel

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

examples/bzlmod_build_file_generation/MODULE.bazel renamed to gazelle/examples/bzlmod_build_file_generation/MODULE.bazel

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,28 @@ module(
1313
# For typical setups you set the version.
1414
# See the releases page for available versions.
1515
# https://github.com/bazel-contrib/rules_python/releases
16-
bazel_dep(name = "rules_python", version = "0.0.0")
16+
bazel_dep(name = "rules_python", version = "1.0.0")
1717

18+
# NOTE: This override is removed for BCR presubmits and the version
19+
# specified by bazel_dep() is used instead.
1820
# The following loads rules_python from the file system.
1921
# For usual setups you should remove this local_path_override block.
2022
local_path_override(
2123
module_name = "rules_python",
22-
path = "../..",
24+
path = "../../..",
2325
)
2426

2527
# The following stanza defines the dependency rules_python_gazelle_plugin.
2628
# For typical setups you set the version.
2729
# See the releases page for available versions.
2830
# https://github.com/bazel-contrib/rules_python/releases
29-
bazel_dep(name = "rules_python_gazelle_plugin", version = "0.0.0")
31+
bazel_dep(name = "rules_python_gazelle_plugin", version = "1.5.0")
3032

3133
# The following starlark loads the gazelle plugin from the file system.
3234
# For usual setups you should remove this local_path_override block.
3335
local_path_override(
3436
module_name = "rules_python_gazelle_plugin",
35-
path = "../../gazelle",
37+
path = "../..",
3638
)
3739

3840
# The following stanza defines the dependency for gazelle
@@ -84,7 +86,7 @@ use_repo(pip, "pip")
8486

8587
# This project includes a different module that is on the local file system.
8688
# Add the module to this parent project.
87-
bazel_dep(name = "other_module", version = "", repo_name = "our_other_module")
89+
bazel_dep(name = "other_module", version = "0.0.0", repo_name = "our_other_module")
8890
local_path_override(
8991
module_name = "other_module",
9092
path = "other_module",
File renamed without changes.

0 commit comments

Comments
 (0)