Skip to content
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

Repository tests can are still cached by bazel if repository rules change but tests themselves do not #806

Closed
fishcakez opened this issue Aug 26, 2022 · 2 comments
Labels
Can Close? Will close in 30 days if there is no new activity

Comments

@fishcakez
Copy link
Contributor

🐞 bug report

Affected Rule

The issue is caused by the rule:

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Description

A clear and concise description of the problem...

Repository tests can are marked as cached by bazel if repository rules change but tests themselves do not.

🔬 Minimal Reproduction

Run a test e.g. bazel test //python/tests/toolchains:python_3_8_10_x86_64-apple-darwin_test
Add fail("oops") to a the rule,

diff --git a/python/repositories.bzl b/python/repositories.bzl
index d48e775..5baa0fe 100644
--- a/python/repositories.bzl
+++ b/python/repositories.bzl
@@ -38,6 +38,8 @@ def py_repositories():
 STANDALONE_INTERPRETER_FILENAME = "STANDALONE_INTERPRETER"

 def _python_repository_impl(rctx):
+    if rctx.attr.python_version == '3.8.10':
+        fail("oops")
     if rctx.attr.distutils and rctx.attr.distutils_content:
         fail("Only one of (distutils, distutils_content) should be set.")

Then run test again:

bazel test //python/tests/toolchains:python_3_8_10_x86_64-apple-darwin_test
...
//python/tests/toolchains:python_3_8_10_x86_64-apple-darwin_test (cached) PASSED in 93.4s

Retrying with cache tests results disabled:

bazel test //python/tests/toolchains:python_3_8_10_x86_64-apple-darwin_test --cache_test_results=no
...
//python/tests/toolchains:python_3_8_10_x86_64-apple-darwin_test         FAILED in 6.4s

🔥 Exception or Error




N/A

🌍 Your Environment

Operating System:

  
Any
  

Output of bazel version:

  
Any
  

Rules_python version:

  
Any
  

Anything else relevant?

This has bug has allowed the repo to introduce at least a couple of bugs, eg #803 #805

@fishcakez fishcakez changed the title Repository tests can are marked as cached by bazel if repository rules change but tests themselves do not Repository tests can are still cached by bazel if repository rules change but tests themselves do not Aug 26, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!

@github-actions github-actions bot added the Can Close? Will close in 30 days if there is no new activity label Feb 22, 2023
@github-actions
Copy link

This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? Will close in 30 days if there is no new activity
Projects
None yet
Development

No branches or pull requests

1 participant