BUILD and WORKSPACE files not captured by data
See original GitHub issueDescription of the problem:
I want to write some tests for the bazel-to-cmake project, and for that i need to grab some BUILD and WORKSPACE files as input testdata. I guess for obvious reasons, some special filenames are excluded, because usually no one needs them. But in this case i do, and not even naming them helps:
py_test(
name = "test1",
srcs = ["test1.py"],
data = glob([
"input/BUILD",
"input/WORKSPACE",
"expected/*",
]),
)
everything within the expected directory is caught and visible in *.runfiles.
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
git clone git@github.com:blackliner/bazel-to-cmake.git
cd bazel-to-cmake
git reset --hard 8bfb4ced3e599f578f8c6e0a8c29966f8c6e5a9f
bazel test ... --test_output=all
see error message: FileNotFoundError: [Errno 2] No such file or directory: 'input/'
What operating system are you running Bazel on?
Ubuntu 18.04@WSL2 on Windows10
What’s the output of bazel info release
?
release 1.2.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to open a workspace that was not exported?
If it doesn't help, try to find workspace files in the folder specified in "Workspace files location" setting (Home | Preferences). Each ...
Read more >Using Workspaces to Share Data between Jobs - CircleCI
This document describes how to use workspaces to share data to downstream jobs in your workflows.
Read more >Why is Jenkins suddenly unable to delete a workspace
Someone has logged into Jenkins and is accessing the files from the workspace directly using the file system but not via Jenkins. The...
Read more >Passing data between build steps | Cloud Build Documentation
To pass data between build steps, store the assets produced by the build step in /workspace and these assets will be available to...
Read more >Capture Google Drive for desktop logs for support
If you contact Google Workspace support about a Google Drive for desktop issue, ... Capture log files when the application is not available....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @blackliner, I took a look at your fork and the test you’re trying to write. Here’s what I found was not exactly correct in your BUILD files.
glob()
shouldn’t include theBUILD
andWORKSPACE
files because in this case they are targets, not regular files.input/BUILD
file must exportWORKSPACE
and have the proper package visibility so it can be read from//test/test1
Here’s how I rewrote them:
//test/test1/BUILD
//test/test1/input/BUILD
The test still fails because you’re trying to access
test/test1/input/test
which doesn’t exist, in the sense that it’s not a declared dependency on your test. How is this file created? Can you check it in and declare it as a data dependency which gets rewritten for every test?That was what i wanted to find out: how to de-specialize those two files. If that is not possible, workarounds are always a thing of course.
Thanks, can be kept closed.