Skip to content

Commit

Permalink
Follow symlinks in reading data file
Browse files Browse the repository at this point in the history
PatchUtilsTest.GatherDumpMetadata and PatchUtilsTest.GatherMetadata
failed when data file is under Bazel's runfile dir. Reading file
would fail if we don't follow symlink since the data file is a symlink
to the real file in $ANDROID_HOST_OUT dir.

See https://docs.bazel.build/versions/2.0.0/output_directories.html for
more information.

Bug: 211806329
Test: atest --bazel-mode fastdeploy_test_host
Test: atest fastdeploy_test
Change-Id: I3d4f6e08aa36bebc012a5970f55babc5d8d75e59
  • Loading branch information
weisu committed Dec 23, 2021
1 parent de7776a commit d1ffe2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastdeploy/deploypatchgenerator/patch_utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ TEST(PatchUtilsTest, GatherMetadata) {

std::string expectedMetadata;
android::base::ReadFileToString(GetTestFile("rotating_cube-metadata-release.data"),
&expectedMetadata);
&expectedMetadata, true);
APKMetaData expected;
EXPECT_TRUE(expected.ParseFromString(expectedMetadata));

Expand Down Expand Up @@ -123,7 +123,7 @@ TEST(PatchUtilsTest, GatherDumpMetadata) {

{
std::string cd;
android::base::ReadFileToString(GetTestFile("sample.cd"), &cd);
android::base::ReadFileToString(GetTestFile("sample.cd"), &cd, true);

APKDump dump;
dump.set_cd(std::move(cd));
Expand Down

0 comments on commit d1ffe2d

Please sign in to comment.