bodihex
bodihex

Reputation: 89

How to configure sh_test dependencies in bazel?

I have a test1 which is a sh_test and a test2 sh_test that depends on test1 but I can't seem to add test1 as a dependency to test2. Is there any way to only run test2 if test1 completes and is successful?

Upvotes: 0

Views: 504

Answers (1)

László
László

Reputation: 4281

Split test1 into two parts:

  • the "build" part: the build rules that produces the outputs that test2 needs to consume
  • the "assertion" part: whatever assertions the test is making

The test rules (test1 and test2) can depend on the genrule and test the correctness of the outputs.

Upvotes: 2

Related Questions