@@ -118,6 +118,7 @@ public class TestRunnerAction extends AbstractAction
118
118
private final BuildConfigurationValue configuration ;
119
119
private final TestConfiguration testConfiguration ;
120
120
private final Artifact testLog ;
121
+ private final Artifact testXml ;
121
122
private final Artifact cacheStatus ;
122
123
private final PathFragment testWarningsPath ;
123
124
private final PathFragment unusedRunfilesLogPath ;
@@ -128,7 +129,6 @@ public class TestRunnerAction extends AbstractAction
128
129
private final PathFragment undeclaredOutputsManifestPath ;
129
130
private final PathFragment undeclaredOutputsAnnotationsPath ;
130
131
private final PathFragment undeclaredOutputsAnnotationsPbPath ;
131
- private final PathFragment xmlOutputPath ;
132
132
@ Nullable private final PathFragment testShard ;
133
133
private final PathFragment testExitSafe ;
134
134
private final PathFragment testStderr ;
@@ -198,6 +198,7 @@ private static ImmutableSet<Artifact> nonNullAsSet(Artifact... artifacts) {
198
198
Artifact testXmlGeneratorScript , // Must be in inputs
199
199
@ Nullable Artifact collectCoverageScript , // Must be in inputs, if not null
200
200
Artifact testLog ,
201
+ Artifact testXml ,
201
202
Artifact cacheStatus ,
202
203
Artifact coverageArtifact ,
203
204
@ Nullable Artifact coverageDirectory ,
@@ -219,7 +220,12 @@ private static ImmutableSet<Artifact> nonNullAsSet(Artifact... artifacts) {
219
220
owner ,
220
221
inputs ,
221
222
nonNullAsSet (
222
- testLog , cacheStatus , coverageArtifact , coverageDirectory , undeclaredOutputsDir ));
223
+ testLog ,
224
+ testXml ,
225
+ cacheStatus ,
226
+ coverageArtifact ,
227
+ coverageDirectory ,
228
+ undeclaredOutputsDir ));
223
229
Preconditions .checkState ((collectCoverageScript == null ) == (coverageArtifact == null ));
224
230
this .runfilesTree = runfilesTree ;
225
231
this .testSetupScript = testSetupScript ;
@@ -228,6 +234,7 @@ private static ImmutableSet<Artifact> nonNullAsSet(Artifact... artifacts) {
228
234
this .configuration = checkNotNull (configuration );
229
235
this .testConfiguration = checkNotNull (configuration .getFragment (TestConfiguration .class ));
230
236
this .testLog = testLog ;
237
+ this .testXml = testXml ;
231
238
this .cacheStatus = cacheStatus ;
232
239
this .coverageData = coverageArtifact ;
233
240
this .coverageDirectory = coverageDirectory ;
@@ -246,7 +253,6 @@ private static ImmutableSet<Artifact> nonNullAsSet(Artifact... artifacts) {
246
253
this .testExitSafe = baseDir .getChild ("test.exited_prematurely" );
247
254
// testShard Path should be set only if sharding is enabled.
248
255
this .testShard = totalShards > 1 ? baseDir .getChild ("test.shard" ) : null ;
249
- this .xmlOutputPath = baseDir .getChild ("test.xml" );
250
256
this .testWarningsPath = baseDir .getChild ("test.warnings" );
251
257
this .unusedRunfilesLogPath = baseDir .getChild ("test.unused_runfiles_log" );
252
258
this .testStderr = baseDir .getChild ("test.err" );
@@ -283,7 +289,6 @@ private static ImmutableSet<Artifact> nonNullAsSet(Artifact... artifacts) {
283
289
ImmutableSet .Builder <PathFragment > filesToDeleteBuilder =
284
290
ImmutableSet .<PathFragment >builder ()
285
291
.add (
286
- xmlOutputPath ,
287
292
testWarningsPath ,
288
293
unusedRunfilesLogPath ,
289
294
testStderr ,
@@ -366,7 +371,6 @@ public boolean checkShardingSupport() {
366
371
367
372
public List <ActionInput > getSpawnOutputs () {
368
373
final List <ActionInput > outputs = new ArrayList <>();
369
- outputs .add (ActionInputHelper .fromPath (getXmlOutputPath ()));
370
374
outputs .add (ActionInputHelper .fromPath (getExitSafeFile ()));
371
375
if (isSharded ()) {
372
376
outputs .add (ActionInputHelper .fromPath (getTestShard ()));
@@ -773,7 +777,7 @@ public void setupEnvVariables(Map<String, String> env) {
773
777
env .put ("TEST_TOTAL_SHARDS" , Integer .toString (getExecutionSettings ().getTotalShards ()));
774
778
env .put ("TEST_SHARD_STATUS_FILE" , getTestShard ().getPathString ());
775
779
}
776
- env .put ("XML_OUTPUT_FILE" , getXmlOutputPath (). getPathString ());
780
+ env .put ("XML_OUTPUT_FILE" , testXml . getExecPathString ());
777
781
778
782
if (!configuration .runfilesEnabled ()) {
779
783
// If runfiles are disabled, tell remote-runtest.sh/local-runtest.sh about that.
@@ -832,6 +836,10 @@ public Artifact getTestLog() {
832
836
return testLog ;
833
837
}
834
838
839
+ public Artifact getTestXml () {
840
+ return testXml ;
841
+ }
842
+
835
843
/** Returns all environment variables which must be set in order to run this test. */
836
844
public ActionEnvironment getExtraTestEnv () {
837
845
return extraTestEnv ;
@@ -906,11 +914,6 @@ public PathFragment getInfrastructureFailureFile() {
906
914
return testInfrastructureFailure ;
907
915
}
908
916
909
- /** Returns path to the optionally created XML output file created by the test. */
910
- public PathFragment getXmlOutputPath () {
911
- return xmlOutputPath ;
912
- }
913
-
914
917
/** Returns coverage data artifact or null if code coverage was not requested. */
915
918
@ Nullable
916
919
public Artifact getCoverageData () {
@@ -1183,7 +1186,7 @@ public Path getInfrastructureFailureFile() {
1183
1186
1184
1187
/** Returns path to the optionally created XML output file created by the test. */
1185
1188
public Path getXmlOutputPath () {
1186
- return getPath (xmlOutputPath );
1189
+ return getPath (testXml . getExecPath () );
1187
1190
}
1188
1191
1189
1192
public Path getCoverageDirectory () {
0 commit comments