I have tests made with Jest and Puppeteer under a Bazel configuration. I Have screenshots and html-pages and hopefully videos in the near future being saved to a file(s) during tests that have errors. I want to be able to access those files when I run tests automatically as I push things to github. Everything is set up except that bazel runs in a sandbox environment, so any new files I create from tests will be deleted after each test. I can access the correct file if I put a generic txt file in it before running the tests, but any new files can’t be accessed by github artifacts. I saw that you can use genrules() to generate ziped files that bazel can then output, but the saved place for that is normally outside of any code you might have for tests on your computer (AKA it saves those in your user cache). What is the path you would put in your .yml file to find the zip files you saved?
I was able to get the path to a file and write things to that file. But due to sandbox, artifacts can’t access the things I stored in those files because they get deleted.
I tried putting a genrule() in the BUILD.bazel file closest to my tests like so:
`genrule(
name = "test_help_name",
srcs = glob(["./sibling-directory/sub-directory/*.txt"]),
outs = ["text-files.tar"],
cmd = "tar cf $@ $(SRCS)",
)`
but as I said those files are saved in my user cache, not anywhere in my program repo.
Andrew Moss is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.