Skip to content

chore: reproduce problem with external getting instrumented #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: ./minimal_download_test.sh
- run: bazel coverage //src/...
- run: bazel coverage //...
- uses: hrishikesh-kadam/setup-lcov@6c1aa0cc9e1c02f9f58f01ac599f1064ccc83470 # v1
# The github-actions-report-lcov doesn't follow symlinks, so get an absolute path
- run: echo "bazel_testlogs=$(bazel info bazel-testlogs)" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions e2e/use_release/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Don't instrument the root folder, since that walks into the //external folder too
# Don't instrument the //external folder
# See https://bazelbuild.slack.com/archives/C07HTMQFTBN/p1737600241213179?thread_ts=1736875351.548719&cid=C07HTMQFTBN
coverage --instrumentation_filter=//src
coverage --instrumentation_filter=^//
32 changes: 30 additions & 2 deletions e2e/use_release/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
load("@rules_uv//uv:pip.bzl", "pip_compile")
load("@aspect_rules_py//py:defs.bzl", "py_library", "py_pytest_main", "py_test")

pip_compile(name = "pip_compile")
py_library(
name = "lib",
srcs = ["__init__.py"],
)

# TODO(alex): land https://github.com/aspect-build/rules_py/pull/401 and shorten this
py_pytest_main(
name = "__test__",
deps = [
"@pip//coverage",
"@pip//pytest",
],
)

py_test(
name = "test",
srcs = [
"my_test.py",
":__test__",
],
main = ":__test__.py",
deps = [
":__test__",
":lib",
],
)

# comment out because it produces an empty coverage.dat file and the GHA I'm using fails
# pip_compile(name = "pip_compile")
8 changes: 8 additions & 0 deletions e2e/use_release/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def welcome(name):
return "hello %s" % name






9 changes: 9 additions & 0 deletions e2e/use_release/my_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from __init__ import welcome

def test_welcome():
greeting = welcome("world")
assert greeting == "hello world"




Loading