sapling/eden
Matt Glazar 84fccd7148 Fix code coverage causing test failures
Summary:
Sandcastle's [1] code coverage builds compile EdenFS and Hg with Clang's -fprofile-generate flag (or a related flag). By default, running a program with with that flag creates a `default.profraw` file in the current directory. This causes some tests to fail, such as HgBackingStoreTest.getTreeForCommit_reimports_tree_if_it_was_deleted_after_import, because `default.profraw` is unintentionally committed to the test repo:

```
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from HgBackingStoreTest
[ RUN      ] HgBackingStoreTest.getTreeForCommit_reimports_tree_if_it_was_deleted_after_import
eden/fs/store/hg/test/HgBackingStoreTest.cpp:64: Failure
Value of: tree1->getEntryNames()
Expected: has 2 elements where
element #0 is equal to foo,
element #1 is equal to src
  Actual: { default.profraw, foo, src }, which has 3 elements
[  FAILED  ] HgBackingStoreTest.getTreeForCommit_reimports_tree_if_it_was_deleted_after_import (1563 ms)
[----------] 1 test from HgBackingStoreTest (1563 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (1563 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] HgBackingStoreTest.getTreeForCommit_reimports_tree_if_it_was_deleted_after_import
```

When Sandcastle runs the tests, it sets the `LLVM_PROFILE_FILE` environment variable, which configures the path to `default.profraw`. EdenFS' HgRepo class is stripping this variable when invoking hg, so hg uses the default path and not the configured path.

Make HgRepo pass `LLVM_PROFILE_FILE` through to hg. This fixes some of EdenFS' tests when run by Sandcastle for code coverage purposes. (This does *not* fix running the tests manually (without setting `LLVM_PROFILE_FILE`), though.)

[1] Sandcastle is Facebook's continuous integration system.

Reviewed By: simpkins

Differential Revision: D15104832

fbshipit-source-id: 3929b9b0ab0904f2552ace7d8e4e4f4a4221192c
2019-04-26 14:11:36 -07:00
..
benchmarks Cut most of the remaining Thrift SASL integration 2018-11-19 22:40:44 -08:00
cli bypass cache when checking stale mounts 2019-04-18 14:58:37 -07:00
docs Document how globs work 2019-03-07 14:20:57 -08:00
fs Fix code coverage causing test failures 2019-04-26 14:11:36 -07:00
integration refactor some of the argument parsing and config setup logic 2019-04-16 21:17:10 -07:00
locale add a custom translation for ENOTCONN 2019-03-07 12:55:04 -08:00
py eden: add a script to build the eden client executable for oss builds 2019-01-15 14:14:32 -08:00
scripts set executable bit on force-unmount-all.sh 2019-03-28 14:45:57 -07:00
test_support Allow systemd opt-in via config 2018-12-10 16:30:06 -08:00
test-data generate a new version of the "basic" snapshot 2019-03-18 11:36:42 -07:00
third-party add osxfuse kernel header 2019-03-19 10:26:24 -07:00
win add a new EdenStateDir class 2019-04-16 21:17:10 -07:00
.gitignore eden: wire up mac contbuild 2019-02-05 21:52:30 -08:00
Eden.project.toml Eden.project.toml file for Nuclide 2018-04-26 11:05:23 -07:00