Skip to content

Commit 15828ca

Browse files
committed
Add more tests
1 parent cd63699 commit 15828ca

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

src/test/java/com/google/devtools/build/lib/remote/RemoteActionFileSystemTest.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,7 @@ public void createSymbolicLink_localFileArtifact() throws Exception {
10461046
// assert
10471047
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
10481048
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1049-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1050-
.isEqualTo(targetPath);
1051-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1052-
.isEqualTo(targetPath);
1049+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
10531050
}
10541051

10551052
@Test
@@ -1070,11 +1067,8 @@ public void createSymbolicLink_remoteFileArtifact() throws Exception {
10701067
// assert
10711068
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
10721069
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1073-
assertThat(outputArtifact.getPath().readSymbolicLink()).isEqualTo(targetPath);
1074-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1075-
.isEqualTo(targetPath);
1076-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1077-
.isEqualTo(targetPath);
1070+
assertThat(outputArtifact.getPath().exists(Symlinks.NOFOLLOW)).isFalse();
1071+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
10781072
}
10791073

10801074
@Test
@@ -1098,10 +1092,7 @@ public void createSymbolicLink_localTreeArtifact() throws Exception {
10981092
// assert
10991093
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
11001094
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1101-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1102-
.isEqualTo(targetPath);
1103-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1104-
.isEqualTo(targetPath);
1095+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
11051096
}
11061097

11071098
@Test
@@ -1125,10 +1116,7 @@ public void createSymbolicLink_remoteTreeArtifact() throws Exception {
11251116
// assert
11261117
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
11271118
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1128-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1129-
.isEqualTo(targetPath);
1130-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1131-
.isEqualTo(targetPath);
1119+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
11321120
}
11331121

11341122
@Test
@@ -1149,10 +1137,7 @@ public void createSymbolicLink_unresolvedSymlink() throws Exception {
11491137
// assert
11501138
assertThat(symlinkActionFs.getFileSystem()).isSameInstanceAs(actionFs);
11511139
assertThat(symlinkActionFs.readSymbolicLink()).isEqualTo(targetPath);
1152-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1153-
.isEqualTo(targetPath);
1154-
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).readSymbolicLink())
1155-
.isEqualTo(targetPath);
1140+
assertThat(getLocalFileSystem(actionFs).getPath(linkPath).exists(Symlinks.NOFOLLOW)).isFalse();
11561141
}
11571142

11581143
@Test

src/test/shell/bazel/remote/build_without_the_bytes_test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,14 +1580,14 @@ EOF
15801580
--remote_download_minimal \
15811581
//a:test0 >& $TEST_log || fail "Failed to test"
15821582
# 2 remote spawns: 1 for executing the test, 1 for generating the test.xml
1583-
expect_log "\d processes:.* 2 remote"
1583+
expect_log ".* processes:.* 2 remote"
15841584

15851585
bazel test \
15861586
--remote_executor=grpc://localhost:${worker_port} \
15871587
--remote_download_minimal \
15881588
//a:test1 >& $TEST_log || fail "Failed to test"
15891589
# only 1 remote spawn: test.xml is generated by junit
1590-
expect_log "\d processes:.* 1 remote"
1590+
expect_log ".* processes:.* 1 remote"
15911591
}
15921592

15931593
function test_output_file_permission() {

0 commit comments

Comments
 (0)