-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Bazel integration tests get default repos from the actual WORKSPACE file. #8986
Comments
I believe rules_apple uses this on purpose to avoid downloading all WORKSPACE dependencies every time we run bazel tests. so as things start migrating into different repos, it might be worthwhile to rethink how shell tests work in order to avoid these extra downloads on each run, or risk tests being flaky on network calls |
Yes. I did not intend that we use the entire WORKSPACE. What we require is a scheme where the repos used in WORKSPACE can be marked in a particular way so that any test may do something like
And then the tests should be respoonsible for saying what they really need, rather than relying on the "default" WORKSPACE, which happens to have rules_cc in it today. |
Straw man proposal for external repositories we depend on by reference. Example with rules_pkg
Extended proposal:
|
This is not rules server. It is a 'how do we build bazel problem'. Switching to ProductExcellence for now. |
I think I understand the problem, but maybe not enough to give advice here. The proposal seems rather complex to me, but maybe I'm lacking context here. Why is it a problem if the integration tests just use the global WORKSPACE file? Bazel shouldn't download anything that's not used, even when it's present in the WORKSPACE, so why do we want to minimize the things in each test's WORKSPACE file? Assigning to Florian to think about it a bit. |
That is an important question. Our current tests do not. They carefully craft just what they need. But I didn't write any of them and they all predate me, so I don't know why we got here. I do know there are several Java integration tests which create a WORKSPACE and BUILD. They could just as easily copy the top level WORKSPACE. It would get rid of a bunch of test scaffolding. |
I finally fixed the blackbox tests which lead to this issue. There are a bunch of tests that
But I am not sure if the tests actually need that complexity. They are underdocumented w.r.t. to intent. |
rules_cc update bites another user. |
Unfortunately the link is dead. Is this still a problem, given the planned revamp of the whole external deps mechanism? |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
I did a quick look and there are a few places left where tests hard code their own version of a repository.
|
We reference some repositories in WORKSPACE then we replace the reference in test harnesses. This is brittle and can lead to tests which do not match the repo version we actually use. Below is the case for rules_cc and shell test. The problem exists for Java and Python tests too. This will get worse as we move more code out of native and //tools and into external repos.
In WORKSPACE:
bazel/src/test/shell/testenv.sh
Line 452 in 64239e0
It is more than just one file.
The text was updated successfully, but these errors were encountered: