Skip to content

Commit b194653

Browse files
michajlocopybara-github
authored andcommitted
Enable EditDuringBuildTest
Input had to be made writable by the sandbox. This makes the assumption that the input path the rule sees and as staged by the test are the same thing (aka we're not copying inputs into the environment), which seems to hold for now. PiperOrigin-RevId: 428832842
1 parent 34f20a1 commit b194653

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/test/java/com/google/devtools/build/lib/buildtool/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ java_test(
206206
name = "EditDuringBuildTest",
207207
srcs = ["EditDuringBuildTest.java"],
208208
tags = [
209-
"manual",
210209
"no_windows",
211210
],
212211
deps = [
@@ -609,7 +608,6 @@ build_test(
609608
":ContextProviderInitializationTest",
610609
":CorruptedActionCacheTest",
611610
":DanglingSymlinkTest",
612-
":EditDuringBuildTest",
613611
":EnvironmentRestrictedBuildTest",
614612
":IncludeValidationTest",
615613
":LabelCrossesPackageBoundaryTest",

src/test/java/com/google/devtools/build/lib/buildtool/EditDuringBuildTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ public class EditDuringBuildTest extends BuildIntegrationTestCase {
4141

4242
@Test
4343
public void testEditDuringBuild() throws Exception {
44+
Path in = write("edit/in", "line1");
45+
in.setLastModifiedTime(123456789);
46+
47+
// Make in writable from sandbox (in case sandbox strategy is used).
48+
String absoluteInPath = in.getPathString();
49+
addOptions("--sandbox_writable_path=" + absoluteInPath);
50+
4451
// The "echo" effects editing of the source file during the build:
4552
write("edit/BUILD",
4653
"genrule(name = 'edit',",
@@ -49,9 +56,6 @@ public void testEditDuringBuild() throws Exception {
4956
" cmd = '/bin/cp $(location in) $(location out) && "
5057
+ "echo line2 >>$(location in)')");
5158

52-
Path in = write("edit/in", "line1");
53-
in.setLastModifiedTime(123456789);
54-
5559
// Edit during build => undefined result (in fact, "line1")
5660
String out = buildAndReadOutputFile();
5761
assertThat(out).isEqualTo("line1\n");

0 commit comments

Comments
 (0)