Skip to content

Commit

Permalink
Repro for #461
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Dec 4, 2024
1 parent f22eff9 commit 68a0995
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
34 changes: 34 additions & 0 deletions examples/pytest/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
load("@aspect_rules_py//py:defs.bzl", "py_pytest_main", "py_test")
load("@rules_python//python:defs.bzl", upstream_py_test = "py_test")
load(":foo.bzl", "lol_test")

py_pytest_main(
name = "__test__",
Expand All @@ -11,6 +13,9 @@ py_test(
"foo_test.py",
":__test__",
],
exec_properties = {
"test.someThing": "bar",
},
imports = ["../.."],
main = ":__test__.py",
package_collisions = "warning",
Expand All @@ -21,3 +26,32 @@ py_test(
"@pypi_pytest//:pkg",
],
)

upstream_py_test(
name = "upstream_pytest_test",
srcs = [
"foo_test.py",
":__test__",
],
env_inherit = [
"FOO",
],
exec_properties = {
"test.dockerNet": "bar",
},
imports = ["../.."],
main = ":__test__.py",
deps = [
":__test__",
"@pypi_ftfy//:pkg",
"@pypi_neptune//:pkg",
"@pypi_pytest//:pkg",
],
)

lol_test(
name = "a",
exec_properties = {
"test.dockerNet": "a",
},
)
11 changes: 11 additions & 0 deletions examples/pytest/foo.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def _impl(ctx):
e = ctx.actions.declare_file(ctx.label.name)
ctx.actions.write(e, content = "exit 0")
return DefaultInfo(
executable = e,
)

lol_test = rule(
implementation = _impl,
test = True,
)

0 comments on commit 68a0995

Please sign in to comment.