@@ -88,7 +88,7 @@ private void scratchFile(String file, String... lines) throws Exception {
88
88
public void testEmptyRunfiles () throws Exception {
89
89
RunfilesSupplier supplier = EmptyRunfilesSupplier .INSTANCE ;
90
90
FakeActionInputFileCache mockCache = new FakeActionInputFileCache ();
91
- expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER );
91
+ expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER , true );
92
92
assertThat (inputMappings ).isEmpty ();
93
93
}
94
94
@@ -103,7 +103,7 @@ public void testRunfilesSingleFile() throws Exception {
103
103
FakeActionInputFileCache mockCache = new FakeActionInputFileCache ();
104
104
mockCache .put (artifact , FileArtifactValue .createNormalFile (FAKE_DIGEST , 0 ));
105
105
106
- expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER );
106
+ expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER , true );
107
107
assertThat (inputMappings ).hasSize (1 );
108
108
assertThat (inputMappings )
109
109
.containsEntry (PathFragment .create ("runfiles/workspace/dir/file" ), artifact );
@@ -121,7 +121,7 @@ public void testRunfilesDirectoryStrict() {
121
121
mockCache .put (artifact , FileArtifactValue .createDirectory (-1 ));
122
122
123
123
try {
124
- expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER );
124
+ expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER , true );
125
125
fail ();
126
126
} catch (IOException expected ) {
127
127
assertThat (expected ).hasMessageThat ().isEqualTo ("Not a file: dir/file" );
@@ -140,7 +140,7 @@ public void testRunfilesDirectoryNonStrict() throws Exception {
140
140
mockCache .put (artifact , FileArtifactValue .createDirectory (-1 ));
141
141
142
142
expander = new SpawnInputExpander (execRoot , /*strict=*/ false );
143
- expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER );
143
+ expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER , true );
144
144
assertThat (inputMappings ).hasSize (1 );
145
145
assertThat (inputMappings )
146
146
.containsEntry (PathFragment .create ("runfiles/workspace/dir/file" ), artifact );
@@ -163,7 +163,7 @@ public void testRunfilesTwoFiles() throws Exception {
163
163
mockCache .put (artifact1 , FileArtifactValue .createNormalFile (FAKE_DIGEST , 1 ));
164
164
mockCache .put (artifact2 , FileArtifactValue .createNormalFile (FAKE_DIGEST , 2 ));
165
165
166
- expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER );
166
+ expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER , true );
167
167
assertThat (inputMappings ).hasSize (2 );
168
168
assertThat (inputMappings )
169
169
.containsEntry (PathFragment .create ("runfiles/workspace/dir/file" ), artifact1 );
@@ -185,7 +185,7 @@ public void testRunfilesSymlink() throws Exception {
185
185
FakeActionInputFileCache mockCache = new FakeActionInputFileCache ();
186
186
mockCache .put (artifact , FileArtifactValue .createNormalFile (FAKE_DIGEST , 1 ));
187
187
188
- expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER );
188
+ expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER , true );
189
189
assertThat (inputMappings ).hasSize (1 );
190
190
assertThat (inputMappings )
191
191
.containsEntry (PathFragment .create ("runfiles/workspace/symlink" ), artifact );
@@ -205,7 +205,7 @@ public void testRunfilesRootSymlink() throws Exception {
205
205
FakeActionInputFileCache mockCache = new FakeActionInputFileCache ();
206
206
mockCache .put (artifact , FileArtifactValue .createNormalFile (FAKE_DIGEST , 1 ));
207
207
208
- expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER );
208
+ expander .addRunfilesToInputs (inputMappings , supplier , mockCache , NO_ARTIFACT_EXPANDER , true );
209
209
assertThat (inputMappings ).hasSize (2 );
210
210
assertThat (inputMappings ).containsEntry (PathFragment .create ("runfiles/symlink" ), artifact );
211
211
// If there's no other entry, Runfiles adds an empty file in the workspace to make sure the
@@ -236,7 +236,7 @@ public void testRunfilesWithTreeArtifacts() throws Exception {
236
236
fakeCache .put (file1 , FileArtifactValue .create (file1 ));
237
237
fakeCache .put (file2 , FileArtifactValue .create (file2 ));
238
238
239
- expander .addRunfilesToInputs (inputMappings , supplier , fakeCache , artifactExpander );
239
+ expander .addRunfilesToInputs (inputMappings , supplier , fakeCache , artifactExpander , true );
240
240
assertThat (inputMappings ).hasSize (2 );
241
241
assertThat (inputMappings )
242
242
.containsEntry (PathFragment .create ("runfiles/workspace/treeArtifact/file1" ), file1 );
@@ -268,7 +268,7 @@ public void testRunfilesWithTreeArtifactsInSymlinks() throws Exception {
268
268
fakeCache .put (file1 , FileArtifactValue .create (file1 ));
269
269
fakeCache .put (file2 , FileArtifactValue .create (file2 ));
270
270
271
- expander .addRunfilesToInputs (inputMappings , supplier , fakeCache , artifactExpander );
271
+ expander .addRunfilesToInputs (inputMappings , supplier , fakeCache , artifactExpander , true );
272
272
assertThat (inputMappings ).hasSize (2 );
273
273
assertThat (inputMappings )
274
274
.containsEntry (PathFragment .create ("runfiles/workspace/symlink/file1" ), file1 );
@@ -296,7 +296,7 @@ public void testTreeArtifactsInInputs() throws Exception {
296
296
fakeCache .put (file2 , FileArtifactValue .create (file2 ));
297
297
298
298
Spawn spawn = new SpawnBuilder ("/bin/echo" , "Hello World" ).withInput (treeArtifact ).build ();
299
- inputMappings = expander .getInputMapping (spawn , artifactExpander , fakeCache );
299
+ inputMappings = expander .getInputMapping (spawn , artifactExpander , fakeCache , true );
300
300
assertThat (inputMappings ).hasSize (2 );
301
301
assertThat (inputMappings ).containsEntry (PathFragment .create ("treeArtifact/file1" ), file1 );
302
302
assertThat (inputMappings ).containsEntry (PathFragment .create ("treeArtifact/file2" ), file2 );
0 commit comments