Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions launchable/commands/record/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,11 @@ def testcases(reports: List[str]) -> Generator[CaseEventType, None, None]:
raise Exception(exceptions)

# generator that creates the payload incrementally
def payload(cases: Generator[TestCase, None, None],
test_runner, group: str) -> Tuple[Dict[str, Union[str, List, dict, bool]], List[Exception]]:
def payload(
cases: Generator[TestCase, None, None],
test_runner, group: str,
test_suite_name: str,
flavors: Dict[str, str]) -> Tuple[Dict[str, Union[str, List, dict, bool]], List[Exception]]:
nonlocal count
cs = []
exs = []
Expand All @@ -463,8 +466,17 @@ def payload(cases: Generator[TestCase, None, None],
exs.append(ex)

count += len(cs)
return {"events": cs, "testRunner": test_runner, "group": group,
"noBuild": self.is_no_build, "metadata": get_env_values(client)}, exs
return {
"events": cs,
"testRunner": test_runner,
"group": group,
"metadata": get_env_values(client),
"noBuild": self.is_no_build,
# NOTE:
# testSuite and flavors are applied only when the no-build option is enabled
"testSuite": test_suite_name,
"flavors": flavors,
}, exs

def send(payload: Dict[str, Union[str, List]]) -> None:
res = client.request(
Expand Down Expand Up @@ -533,7 +545,13 @@ def recorded_result() -> Tuple[int, int, int, float]:

exceptions = []
for chunk in ichunked(tc, post_chunk):
p, es = payload(chunk, test_runner, group)
p, es = payload(
cases=chunk,
test_runner=test_runner,
group=group,
test_suite_name=test_suite if test_suite else "",
flavors=dict(flavor),
)

send(p)
exceptions.extend(es)
Expand Down
4 changes: 3 additions & 1 deletion tests/data/ant/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@
],
"testRunner": "ant",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/bazel/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,7 @@
],
"testRunner": "bazel",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
],
"testRunner": "bazel",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@
],
"testRunner": "bazel",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/behave/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@
],
"testRunner": "behave",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/ctest/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,7 @@
],
"testRunner": "ctest",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/cts/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,5 +245,7 @@
],
"testRunner": "cts",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/cucumber/record_test_json_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,5 +495,7 @@
],
"testRunner": "cucumber",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/cucumber/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,5 +289,7 @@
],
"testRunner": "cucumber",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/cypress/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,7 @@
],
"testRunner": "cypress",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/dotnet/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,7 @@
],
"testRunner": "dotnet",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/flutter/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@
],
"testRunner": "flutter",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/go_test/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,7 @@
],
"testRunner": "go-test",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/googletest/fail/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@
],
"testRunner": "googletest",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/googletest/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,7 @@
],
"testRunner": "googletest",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/gradle/recursion/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,7 @@
],
"testRunner": "gradle",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/jest/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,7 @@
],
"testRunner": "jest",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/maven/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@
],
"testRunner": "maven",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/minitest/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,7 @@
],
"testRunner": "minitest",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/nunit/nunit-reporter-bug-with-nested-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@
],
"testRunner": "nunit",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/nunit/record_test_result-linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,7 @@
],
"testRunner": "nunit",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/nunit/record_test_result-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,7 @@
],
"testRunner": "nunit",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/playwright/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -1677,5 +1677,7 @@
],
"testRunner": "playwright",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/playwright/record_test_result_with_json.json
Original file line number Diff line number Diff line change
Expand Up @@ -2403,5 +2403,7 @@
],
"testRunner": "playwright",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/prove/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,7 @@
],
"testRunner": "prove",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/pytest/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,7 @@
],
"testRunner": "pytest",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/pytest/record_test_result_json.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,7 @@
],
"testRunner": "pytest",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@
],
"testRunner": "robot",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/robot/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,7 @@
],
"testRunner": "robot",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
4 changes: 3 additions & 1 deletion tests/data/rspec/record_test_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,5 +355,7 @@
],
"testRunner": "rspec",
"group": "",
"noBuild": false
"noBuild": false,
"flavors": [],
"testSuite": ""
}
6 changes: 5 additions & 1 deletion tests/test_runners/test_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ def test_record_tests(self):
"testRunner": "raw",
"group": "",
"noBuild": False,
"flavors": [],
"testSuite": "",
})

@responses.activate
Expand Down Expand Up @@ -362,7 +364,9 @@ def test_record_tests_junit_xml(self):
],
"testRunner": "raw",
"group": "",
"noBuild": False
"noBuild": False,
"flavors": [],
"testSuite": "",
})

@responses.activate
Expand Down