sapling/eden/fs/testharness
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
..
test Future::onError replaced with Future::thenError 2019-01-30 09:56:15 -08:00
FakeBackingStore.cpp convert BlobAccess tests to use FakeBackingStore 2019-01-10 16:28:05 -08:00
FakeBackingStore.h convert BlobAccess tests to use FakeBackingStore 2019-01-10 16:28:05 -08:00
FakeClock.h make Clock::getRealtime() const 2018-02-01 11:19:15 -08:00
FakeFuse.cpp eden: pull in osxfuse kernel headers 2018-12-17 20:16:19 -08:00
FakeFuse.h eden: apple/clang compiler portability fixes 2019-04-18 10:37:57 -07:00
FakeObjectStore.cpp add kEmptySha1 hash constant 2018-11-28 16:16:16 -08:00
FakeObjectStore.h add a BlobAccess API for stateless blob reading 2018-11-26 10:46:51 -08:00
FakePrivHelper.cpp Synchronize mount+unmount 0/4: Add features to MountDelegate test helpers 2019-03-21 13:51:15 -07:00
FakePrivHelper.h Synchronize mount+unmount 0/4: Add features to MountDelegate test helpers 2019-03-21 13:51:15 -07:00
FakeTreeBuilder.cpp fix FileInode::isSameAs() to correctly wait on Future completion 2018-06-13 01:20:39 -07:00
FakeTreeBuilder.h fix FileInode::isSameAs() to correctly wait on Future completion 2018-06-13 01:20:39 -07:00
HgRepo.cpp Fix code coverage causing test failures 2019-04-26 14:11:36 -07:00
HgRepo.h fix UnicodeEncodeErrors thrown from eden prefetch code 2018-06-13 19:37:04 -07:00
InodeUnloader.h fix TreeInode::unloadChildrenNow so it unloads trees 2018-09-12 14:37:24 -07:00
StoredObject.h fix FileInode::isSameAs() to correctly wait on Future completion 2018-06-13 01:20:39 -07:00
TempFile.cpp add new helper functions for creating temporary files/dirs in tests 2018-11-09 14:29:17 -08:00
TempFile.h add new helper functions for creating temporary files/dirs in tests 2018-11-09 14:29:17 -08:00
TestChecks.h minor prefactoring split out from later diffs 2018-04-24 18:53:19 -07:00
TestDispatcher.cpp move folly/experimental/logging to folly/logging/ 2018-04-30 21:29:29 -07:00
TestDispatcher.h remove the fusell namespace 2018-03-19 17:01:52 -07:00
TestMount.cpp build testharness on mac 2019-04-18 19:36:19 -07:00
TestMount.h Isolate low-level overlay logic into FsOverlay 2019-03-11 17:30:21 -07:00
TestUtil.cpp run clang-format across all C++ files 2017-11-03 16:02:03 -07:00
TestUtil.h run clang-format across all C++ files 2017-11-03 16:02:03 -07:00