Skip to content

AIENG-379: send raw <testsuite time> as junitSuiteTime - #1422

Merged
ItIsUday merged 2 commits into
v1from
AIENG-379/suite-time-capture-v1
Nov 10, 2026
Merged

ItIsUday merged 2 commits into
v1from
AIENG-379/suite-time-capture-v1

Conversation

@ItIsUday

@ItIsUday ItIsUday commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Why

Companion to mothership PR. test_sessions.duration sums case durations, which over-reports when a suite runs its cases in parallel. The server can compute a true wall-clock span if it knows each suite's <testsuite time> — but the CLI was discarding that attribute.

What

Send the raw <testsuite time> as junitSuiteTime alongside the existing junitSuiteTimestamp, on the generic JUnit record path (maven/gradle/ant/go-test/etc.).

  • Sent from the raw XML attribute, not junitparser's suite.time, which coerces an absent attribute to 0.0 — that would make the server read a zero-length suite instead of falling back to the sum of case durations.
  • Bespoke runner plugins (pytest, playwright, flutter, …) are unchanged for now; they fall back to the case-duration sum server-side. Forwarding junitSuiteTime from those is a follow-up.

Tests

  • New CaseEvent.create cases for the field (present / absent).
  • Updated raw-runner and minitest golden fixtures for the new key.
  • Full suite: 274 tests pass (pre-existing test_scan_test_compile_lst maven failure is unrelated).

🤖 Generated with Claude Code

Lets the server compute a wall-clock session span instead of summing
case durations. Sent from the raw XML attribute, not junitparser's
suite.time, which coerces an absent attribute to 0.0.
'stdout': '',
'stderr': '',
'junitSuiteTimestamp': str(timestamp2),
'junitSuiteTime': '12.345',

@ono-max ono-max Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add junitSuiteTime fields to the following JSON schema?

## Example JSON document
{
"testCases": [
{
"testPath": "file=a.py#class=classA",
"duration": 42,
"status": "TEST_PASSED",
"stdout": "This is stdout",
"stderr": "This is stderr",
"createdAt": "2021-10-05T12:34:00"
}
]
}
## JSON schema
{
"$id": "https://launchableinc.com/schema/RecordTestInput",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "RecordTestInput",
"description": "The input to record test",
"type": "object",
"properties": {
"testCases": {
"description": "Result of test cases",
"type": "array",
"items": {
"type": "object",
"properties": {
"testPath": {
"description": "TestPath for the test",
"type": "string"
},
"testPathComponents": {
"description": "TestPath for the test",
"type": "array",
"items": {
"type": "object"
}
},
"duration": {
"description": "Time taken to finish the test in seconds. If unspecified, assume 0 sec.",
"type": "number",
"minimum": 0
},
"status": {
"description": "Test result",
"type": "string",
"enum": [
"TEST_PASSED",
"TEST_FAILED",
"TEST_SKIPPED"
]
},
"stdout": {
"description": "Standard output of the test. If unspecified, assume empty.",
"type": "string"
},
"stderr": {
"description": "Standard error of the test. If unspecified, assume empty",
"type": "string"
},
"createdAt": {
"description": "The timestamp that the test started at. If unspecified, assume the current timestamp
that the CLI is invoked.",
"type": "string",
"format": "date-time"
},
"data": {
"description": "Metadata of the test, e.g. line number.",
"type": "object",
"properties": {
"lineNumber": {
"description": "Line number of the test (1-based).",
"type": "number"
}
}
}
},
"required": [
"status"
],
"oneOf": [
{
"required": [
"testPath"
]
},
{
"required": [
"testPathComponents"
]
}
]
}
}
},
"required": [
"testCases"
]
}
## JUnit XML TestPath mapping
If the file path ends with '.xml', the command parses the file as a JUnit XML file. When this mode is used the subset input
TestPath should look like 'class={classname}#testcase={testcase}'.
"""

@ItIsUday ItIsUday Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added junitSuiteTime to the raw record-test JSON schema and wired parse_json to forward it (with a test case).

Document it in the raw record-test JSON schema and wire parse_json to
forward it, so raw-JSON users can supply the suite wall time too.
@ItIsUday
ItIsUday requested a review from ono-max November 10, 2026 11:10
@ItIsUday
ItIsUday merged commit c47bee0 into v1 Nov 10, 2026
15 checks passed
@ItIsUday
ItIsUday deleted the AIENG-379/suite-time-capture-v1 branch November 10, 2026 11:13
@github-actions github-actions Bot mentioned this pull request Nov 10, 2026
@github-actions github-actions Bot mentioned this pull request Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants