-
Notifications
You must be signed in to change notification settings - Fork 284
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
test_run should be a sh_test #76
Comments
@johnynek seeing as test_run does |
You want to recreate a very simple repo inside the sandbox for the test. This would clean only that repo. You have to depends on the bazel binary though. |
here is the link: https://github.com/bazelbuild/bazel/tree/master/src/test/shell/bazel this seems like a good thing to do for a shell-master that would like to contribute. Maybe we can reuse some of the above. Honestly, my shell programming is so weak, this would take me a lot of time, and I am not sure I'll have time to do it soon. |
@damienmg @johnynek I'm gonna work on this task. I'm evaluating different options for implementation and will be happy to hear your thoughts Here are some of the challenges. Some of them were already mentioned above. (A) to run
|
Thank you for working on this! How are you building the inner workspace? Are you using the outer one as a local repository? I assume so. In the inner bazel, I think you could set the As far as splitting up the I don't have any ideas on issue 4 at the moment. Thanks again! |
The following tests assume that bazel build / test already ran before them:
When isolating the tests - they fail because there is no bazel run before them. I currently removed them but how do you suggest to attack it? Add those lines to existing tests or add another bazel run before executing those tests? |
The solution seems to be dependent on the ability to run Seems like there supposed to be another issue to enable doing that as simply as you can declare sources like @damienmg - Do you think I should open that issue in bazel repository or am I missing something here? While I could explore options for solutions for this other issue, it seems like I'd need to get into the depths of bazel and not necessarily come up with something everyone can agree on. Thanks! |
To run bazel inside sh_test you need to ship bazel and its depenendency (namely the JDK) to the test or it will fails with sandboxing. You need to find some way to ship bazel (the jdk you can depends on |
I understand. That's what I mean - I'm couldn't find that way :-) Defining "git_repostory"I defined
"Stilling" the local bazel executableWithout diving into the executable internals, I tried to copy bazel executable ( I created a dummy repository to test just that. I'll push those solutions to different branches so you can review it. Thanks! |
you can symlink it with an skylark remote repo, e.g.:
Of course this is an over simplification because bazel is probably not the bazel binary but the bazel wrapper... |
Thanks. Yes, it is a wrapper. I'll look into it after I'll feel more experienced with writing extensions. I'll keep you posted. |
This would allow to test it with
bazel test
To do so, shipping the source of the repository might be needed. See how it is done in bazel in src/test/shell/bazel/...
The text was updated successfully, but these errors were encountered: