[build-tools] Add eas/report_maestro_test_results build function#3388
[build-tools] Add eas/report_maestro_test_results build function#3388
Conversation
|
Size Change: +3.48 kB (0%) Total Size: 72.7 MB
|
2e32515 to
3201ab1
Compare
51c142a to
cc45900
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3388 +/- ##
==========================================
+ Coverage 52.32% 52.81% +0.49%
==========================================
Files 807 809 +2
Lines 33868 34032 +164
Branches 7033 7071 +38
==========================================
+ Hits 17719 17970 +251
+ Misses 14750 14669 -81
+ Partials 1399 1393 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cc45900 to
f171e9e
Compare
|
Subscribed to pull request
Generated by CodeMention |
packages/build-tools/src/steps/functions/reportMaestroTestResults.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/maestroResultParser.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/maestroResultParser.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/maestroResultParser.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/maestroResultParser.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/maestroResultParser.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/reportMaestroTestResults.ts
Outdated
Show resolved
Hide resolved
275434c to
7fb1035
Compare
|
The |
packages/build-tools/src/steps/functions/reportMaestroTestResults.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/reportMaestroTestResults.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/reportMaestroTestResults.ts
Outdated
Show resolved
Hide resolved
packages/build-tools/src/steps/functions/reportMaestroTestResults.ts
Outdated
Show resolved
Hide resolved
198a91d to
1476a49
Compare
| flowFilePath: string; | ||
| } | ||
|
|
||
| export interface MaestroFlowResult { |
There was a problem hiding this comment.
should this be a zod schema we would validate against? same for FlowMetadata?
There was a problem hiding this comment.
FlowMetadata will be switched to z.output as part of the next comment.
For MaestroFlowResult — this is an internal type we construct ourselves in parseMaestroResults(), not something parsed from external input. TypeScript already guarantees correctness at compile time here, so adding Zod runtime validation wouldn't provide additional safety. Happy to change if you feel strongly though.
packages/build-tools/src/steps/functions/maestroResultParser.ts
Outdated
Show resolved
Hide resolved
| * Reads tags from a Maestro flow YAML file's config section. | ||
| * Flow files are structured as: config (object) + `---` + commands (array). | ||
| */ | ||
| export async function parseFlowTags(flowFilePath: string): Promise<string[]> { |
There was a problem hiding this comment.
Maestro 2.2.0 supposedly added tags and properties to XML. Maybe we can rely on that? I think that might simplify code a lot?
There was a problem hiding this comment.
Ah, I see you're leaning towards parsing JSON… hmm
One peculiarity about commands is that it may contain multiple FAILED steps. I have such commands.json where a subflow is marked as FAILED and a single command is marked as failed. Not sure if we want to need to remember and handle these cases… But maybe we do and we just pick the last (by timestamp) FAILED step as the one that triggered the failure…
There was a problem hiding this comment.
I'll let you decide what to do. Maybe we can submit a PR to Maestro to get millisecond precision on durations… https://github.com/mobile-dev-inc/Maestro/blob/e47ba45faf8318d411717ff7a03cc1b5d764fb72/maestro-cli/src/main/java/maestro/cli/report/JUnitTestSuiteReporter.kt#L55
There was a problem hiding this comment.
Let's stick with JUnit as the primary source for now. Maestro seems to be investing more in JUnit support, so aligning with that direction should be a good bet.
I checked the Maestro source — as of 2.2.0, tags are included in JUnit XML as <property name="tags" value="smoke, critical, auth"/> (comma-separated). Custom properties were added in 2.1.0. I'll update parseJUnitTestCases() to extract tags from properties directly, and drop parseFlowTags().
For older Maestro versions that don't emit tags/properties, these will gracefully degrade to empty values ([] / {}), so no breakage.
We still need ai-*.json for flow_file_path (to compute relative paths) and retry counting (via timestamp directory occurrences).
packages/build-tools/src/steps/functions/reportMaestroTestResults.ts
Outdated
Show resolved
Hide resolved
238fd51 to
7a2c0cc
Compare
Signed-off-by: Ash Wu <hsatac@gmail.com>
7a2c0cc to
1b474a6
Compare
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
Why
Maestro test jobs produce per-flow results on the build worker (pass/fail, duration, error messages, retries), but this data is lost after the job finishes.
We want to persist these as
WorkflowDeviceTestCaseResultrecords to surface test outcomes in the dashboard.How
Add a new
eas/report_maestro_test_resultsbuild function that:junit_report_directory(primary data source)ai-*.jsondebug output intests_directorycreateWorkflowDeviceTestCaseResultsGraphQL mutation viagql.tada+graphqlClientKey details:
ai-*.jsononly used forflow_file_pathmapping and retry countjunit_report_directoryadded as output oneas/__maestro_test(set whenoutput_format=junit) and as optional input oneas/report_maestro_test_resultsreuse_devices: trueandfalsepatterns)fs.realpathto handle symlinks (/tmp→/private/tmpon macOS)graphqlClientexposed onCustomBuildContextfor step functions to useTest Plan