mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
84fccd7148
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 |
||
---|---|---|
.. | ||
test | ||
FakeBackingStore.cpp | ||
FakeBackingStore.h | ||
FakeClock.h | ||
FakeFuse.cpp | ||
FakeFuse.h | ||
FakeObjectStore.cpp | ||
FakeObjectStore.h | ||
FakePrivHelper.cpp | ||
FakePrivHelper.h | ||
FakeTreeBuilder.cpp | ||
FakeTreeBuilder.h | ||
HgRepo.cpp | ||
HgRepo.h | ||
InodeUnloader.h | ||
StoredObject.h | ||
TempFile.cpp | ||
TempFile.h | ||
TestChecks.h | ||
TestDispatcher.cpp | ||
TestDispatcher.h | ||
TestMount.cpp | ||
TestMount.h | ||
TestUtil.cpp | ||
TestUtil.h |