Use --experimental_split_coverage_postprocessing for bazel coverage

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Correctness
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This option splits test execution and the code coverage post-processing into their own actions. One benefit of disconnecting them is that it isolates the test timeout to just the test's execution time.

       

      Unfortunately, it doesn't just work with our current setup. Adding

      # in .bazelrc

      coverage --experimental_split_coverage_postprocessing
      coverage --experimental_fetch_all_coverage_outputs

      results in some internal error in bazel because it tries to symlink gcov to a directory the postprocessing action doesn't have permissions for.

       

      If I hack in the following

      # line 68 of bazel-mongo-bravo/external/bazel_tools/tools/test/collect_coverage.sh

      if [[ "$SPLIT_COVERAGE_POST_PROCESSING" == "1" && "$IS_COVERAGE_SPAWN" == "1" ]]; then
        COVERAGE_DIR="$(dirname COVERAGE_DIR)"
      fi

      It does what is expected, but I am sure this is not the right way to get things to work. Not sure at this point if this is a bazel bug or just an incompatibility in the options we use for coverage.

            Assignee:
            Sean Lyons
            Reporter:
            Sean Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: