Skip to content

Commit de02eb2

Browse files
committed
repro better
1 parent 611f2ac commit de02eb2

File tree

7 files changed

+52
-8
lines changed

7 files changed

+52
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
steps:
6767
- uses: actions/checkout@v4
6868
- run: ./minimal_download_test.sh
69-
- run: bazel coverage //src/...
69+
- run: bazel coverage //...
7070
- uses: hrishikesh-kadam/setup-lcov@6c1aa0cc9e1c02f9f58f01ac599f1064ccc83470 # v1
7171
# The github-actions-report-lcov doesn't follow symlinks, so get an absolute path
7272
- run: echo "bazel_testlogs=$(bazel info bazel-testlogs)" >> $GITHUB_ENV

e2e/use_release/.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Don't instrument the //external folder
22
# See https://bazelbuild.slack.com/archives/C07HTMQFTBN/p1737600241213179?thread_ts=1736875351.548719&cid=C07HTMQFTBN
3-
coverage --instrumentation_filter=-//external
3+
coverage --instrumentation_filter=^//

e2e/use_release/BUILD.bazel

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1-
load("@rules_uv//uv:pip.bzl", "pip_compile")
1+
load("@aspect_rules_py//py:defs.bzl", "py_library", "py_pytest_main", "py_test")
22

3-
pip_compile(name = "pip_compile")
3+
py_library(
4+
name = "lib",
5+
srcs = ["__init__.py"],
6+
)
7+
8+
# TODO(alex): land https://github.com/aspect-build/rules_py/pull/401 and shorten this
9+
py_pytest_main(
10+
name = "__test__",
11+
deps = [
12+
"@pip//coverage",
13+
"@pip//pytest",
14+
],
15+
)
16+
17+
py_test(
18+
name = "test",
19+
srcs = [
20+
"my_test.py",
21+
":__test__",
22+
],
23+
main = ":__test__.py",
24+
deps = [
25+
":__test__",
26+
":lib",
27+
],
28+
)
29+
30+
# comment out because it produces an empty coverage.dat file and the GHA I'm using fails
31+
# pip_compile(name = "pip_compile")

e2e/use_release/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def welcome(name):
2+
return "hello %s" % name
3+
4+
5+
6+
7+
8+

e2e/use_release/my_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __init__ import welcome
2+
3+
def test_welcome():
4+
greeting = welcome("world")
5+
assert greeting == "hello world"
6+
7+
8+
9+

e2e/use_release/src/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
def welcome(name):
22
return "hello %s" % name
3+
4+
5+

e2e/use_release/src/__main__.py

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

0 commit comments

Comments
 (0)