Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ filegroup(
"version.bzl",
"//python:distribution",
"//tools:distribution",
"@rules_python_gazelle_plugin//:distribution",
],
visibility = [
"//:__subpackages__",
Expand Down
9 changes: 0 additions & 9 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ bazel_dep(name = "another_module", version = "0", dev_dependency = True)
# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.40.0", dev_dependency = True, repo_name = "bazel_gazelle")

internal_dev_deps = use_extension(
"//python/private:internal_dev_deps.bzl",
Expand Down Expand Up @@ -258,13 +256,6 @@ dev_rules_python_config.add_transition_setting(
setting = "//tests/multi_pypi:external_deps_name",
)

# Add gazelle plugin so that we can run the gazelle example as an e2e integration
# test and include the distribution files.
local_path_override(
module_name = "rules_python_gazelle_plugin",
path = "gazelle",
)

local_path_override(
module_name = "other",
path = "tests/modules/other",
Expand Down
28 changes: 0 additions & 28 deletions tests/integration/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ _WORKSPACE_FLAGS = [
"--enable_workspace",
]

_WORKSPACE_GAZELLE_PLUGIN_FLAGS = [
"--override_repository=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin",
]

_GAZELLE_PLUGIN_FLAGS = [
"--override_module=rules_python_gazelle_plugin=../../../rules_python_gazelle_plugin",
]

default_test_runner(
name = "workspace_test_runner",
bazel_cmds = [
Expand All @@ -40,31 +32,11 @@ default_test_runner(
visibility = ["//visibility:public"],
)

default_test_runner(
name = "workspace_test_runner_gazelle_plugin",
bazel_cmds = [
"info {}".format(" ".join(_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)),
"test {} //...".format(" ".join(_WORKSPACE_FLAGS + _WORKSPACE_GAZELLE_PLUGIN_FLAGS)),
],
visibility = ["//visibility:public"],
)

default_test_runner(
name = "test_runner",
visibility = ["//visibility:public"],
)

default_test_runner(
name = "test_runner_gazelle_plugin",
bazel_cmds = [
"info {}".format(" ".join(_GAZELLE_PLUGIN_FLAGS)),
"test {} //...".format(" ".join(_GAZELLE_PLUGIN_FLAGS)),
],
visibility = ["//visibility:public"],
)

# TODO: add compile_pip_requirements_test_from_external_repo

rules_python_integration_test(
name = "compile_pip_requirements_test",
)
Expand Down
11 changes: 2 additions & 9 deletions tests/integration/integration_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ load(
)
load("//python:py_test.bzl", "py_test")

def _test_runner(*, name, bazel_version, py_main, bzlmod, gazelle_plugin):
def _test_runner(*, name, bazel_version, py_main, bzlmod):
if py_main:
test_runner = "{}_bazel_{}_py_runner".format(name, bazel_version)
py_test(
Expand All @@ -35,20 +35,15 @@ def _test_runner(*, name, bazel_version, py_main, bzlmod, gazelle_plugin):
)
return test_runner

if bzlmod and gazelle_plugin:
return "//tests/integration:test_runner_gazelle_plugin"
elif bzlmod:
if bzlmod:
return "//tests/integration:test_runner"
elif gazelle_plugin:
return "//tests/integration:workspace_test_runner_gazelle_plugin"
else:
return "//tests/integration:workspace_test_runner"

def rules_python_integration_test(
name,
workspace_path = None,
bzlmod = True,
gazelle_plugin = False,
tags = None,
py_main = None,
bazel_versions = None,
Expand All @@ -61,7 +56,6 @@ def rules_python_integration_test(
`_test` suffix.
bzlmod: bool, default True. If true, run with bzlmod enabled, otherwise
disable bzlmod.
gazelle_plugin: Whether the test uses the gazelle plugin.
tags: Test tags.
py_main: Optional `.py` file to run tests using. When specified, a
python based test runner is used, and this source file is the main
Expand Down Expand Up @@ -98,7 +92,6 @@ def rules_python_integration_test(
bazel_version = bazel_version,
py_main = py_main,
bzlmod = bzlmod,
gazelle_plugin = gazelle_plugin,
)
bazel_integration_test(
name = "{}_bazel_{}".format(name, bazel_version),
Expand Down