[trainer] Return Test Plan Configuration in JUnit output #20016
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validMotivation and Context
We've started looking at using
Test Plan
configurations so that we can run our whole UI test suite against different dynamic font sizes. However, there is an issue when usingfastlane
+trainer
to generateJUnit
: There's no way to determine which Test Plan configuration the failure originated from - you just get duplicated<testsuite>
s. We'd like to be able to raise the configuration that failed, and the information simply isn't there right now. For reference, this is how it appears within Xcode when you open the xcresult:And how it appears in the
JUnit
file after this change:Description
The
Test Plan
configuration name is already available to us (viaActionTestableSummary
), it's just not being used anywhere yet. This PR makes a couple of changes:ActionTestableSummary
, and set it on the returned test resultsrow
asconfiguration_name
.JUnit
spec, there's obviously nothing particularly specific to this case, so I settled on using aproperty
on thetestsuite
, as defined in the spec calledConfiguration
.Testing Steps
The new field is now available on the
xcresult
based tests intest_parser_spec
, so I have updated those, and I've added a new test withinjunit_generator_spec
that verifies the output (also some extra coverage as currently there are no tests forxcresult
->junit
).