Per Westling
Per Westling

Reputation: 23

What tests should be run in preparation for making contributions to Bazel?

I am preparing for making a minor bug fix to bazel java code. Am working on a Linux distribution.

Following the instructions in https://bazel.build/contributing.html but I encounter problems with two of the test instructions:

  1. In the section about "Compiling bazel" the third parapgraph state: "In addition to the Bazel binary, you might want to build the various tools Bazel uses. They are located in //src/java_tools/..., //src/objc_tools/... and //src/tools/... and their directories contain README files describing their respective utility." If I follow this the //src/tools/... fail because there is no xcrun command in the Linux environment I am using. I suppose this is MacOS platform specific tests?
  2. The next paragraph instructs you to build a distribution package, that you then unpack in a new directory, and then do: "bazel test //src/... //third_party/ijar/...". I now get an error that windows.h is missing, which I suppose is Windows platform specific tests.

Some questions:

Upvotes: 0

Views: 35

Answers (1)

Jin
Jin

Reputation: 13533

Thanks for your interest in contributing to Bazel! The bazel-dev mailing list is a better avenue for these questions.

The tests that you want to run largely depend on the changes you make, but when you make a pull request, the Bazel CI will run all of Bazel's tests to make sure that nothing breaks.

So is there an easy way to run tests only for the current platform?

It depends, and this is still a work in progress where we want to make Bazel more aware of platforms and toolchains without specifying additional flags.

In general, you don't need to modify or worry about the //src/*_tools packages unless you're making direct changes to them.

Is the instructions good enough?

The instructions will never be perfect, and we're always looking for ways to make it clearer and more concise.

If the instructions should be updated, what is the best way to notify the ones managing that documentation page?

Please file an issue on the GitHub repository or email the bazel-dev mailing list for further discussion.

Upvotes: 0

Related Questions