diff --git a/launchable/commands/record/tests.py b/launchable/commands/record/tests.py index af77a83c1..8f75648de 100644 --- a/launchable/commands/record/tests.py +++ b/launchable/commands/record/tests.py @@ -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 = [] @@ -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( @@ -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) diff --git a/tests/data/ant/record_test_result.json b/tests/data/ant/record_test_result.json index 5bdee936c..fc12d05ae 100644 --- a/tests/data/ant/record_test_result.json +++ b/tests/data/ant/record_test_result.json @@ -57,5 +57,7 @@ ], "testRunner": "ant", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/bazel/record_test_result.json b/tests/data/bazel/record_test_result.json index e76352088..0d8345d6d 100644 --- a/tests/data/bazel/record_test_result.json +++ b/tests/data/bazel/record_test_result.json @@ -129,5 +129,7 @@ ], "testRunner": "bazel", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/bazel/record_test_with_build_event_json_result.json b/tests/data/bazel/record_test_with_build_event_json_result.json index d5aaf4eb6..1afb8e2bd 100644 --- a/tests/data/bazel/record_test_with_build_event_json_result.json +++ b/tests/data/bazel/record_test_with_build_event_json_result.json @@ -45,5 +45,7 @@ ], "testRunner": "bazel", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/bazel/record_test_with_multiple_build_event_json_result.json b/tests/data/bazel/record_test_with_multiple_build_event_json_result.json index a06b472f5..073f2b4ca 100644 --- a/tests/data/bazel/record_test_with_multiple_build_event_json_result.json +++ b/tests/data/bazel/record_test_with_multiple_build_event_json_result.json @@ -73,5 +73,7 @@ ], "testRunner": "bazel", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/behave/record_test_result.json b/tests/data/behave/record_test_result.json index edf37e321..d02739bff 100644 --- a/tests/data/behave/record_test_result.json +++ b/tests/data/behave/record_test_result.json @@ -25,5 +25,7 @@ ], "testRunner": "behave", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/ctest/record_test_result.json b/tests/data/ctest/record_test_result.json index 8356a9e4b..9de48e1b2 100644 --- a/tests/data/ctest/record_test_result.json +++ b/tests/data/ctest/record_test_result.json @@ -59,5 +59,7 @@ ], "testRunner": "ctest", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/cts/record_test_result.json b/tests/data/cts/record_test_result.json index f44535864..c64dbce28 100644 --- a/tests/data/cts/record_test_result.json +++ b/tests/data/cts/record_test_result.json @@ -245,5 +245,7 @@ ], "testRunner": "cts", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/cucumber/record_test_json_result.json b/tests/data/cucumber/record_test_json_result.json index 405322680..959df5c78 100644 --- a/tests/data/cucumber/record_test_json_result.json +++ b/tests/data/cucumber/record_test_json_result.json @@ -495,5 +495,7 @@ ], "testRunner": "cucumber", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/cucumber/record_test_result.json b/tests/data/cucumber/record_test_result.json index daaa8f152..6ccc9502b 100644 --- a/tests/data/cucumber/record_test_result.json +++ b/tests/data/cucumber/record_test_result.json @@ -289,5 +289,7 @@ ], "testRunner": "cucumber", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/cypress/record_test_result.json b/tests/data/cypress/record_test_result.json index c0af2757d..821f5a0ff 100644 --- a/tests/data/cypress/record_test_result.json +++ b/tests/data/cypress/record_test_result.json @@ -69,5 +69,7 @@ ], "testRunner": "cypress", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/dotnet/record_test_result.json b/tests/data/dotnet/record_test_result.json index f4781fcaa..90aa4df51 100644 --- a/tests/data/dotnet/record_test_result.json +++ b/tests/data/dotnet/record_test_result.json @@ -107,5 +107,7 @@ ], "testRunner": "dotnet", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/flutter/record_test_result.json b/tests/data/flutter/record_test_result.json index 28cab3ebc..63bcf3361 100644 --- a/tests/data/flutter/record_test_result.json +++ b/tests/data/flutter/record_test_result.json @@ -57,5 +57,7 @@ ], "testRunner": "flutter", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } \ No newline at end of file diff --git a/tests/data/go_test/record_test_result.json b/tests/data/go_test/record_test_result.json index d711c2a03..dfacaebcf 100644 --- a/tests/data/go_test/record_test_result.json +++ b/tests/data/go_test/record_test_result.json @@ -75,5 +75,7 @@ ], "testRunner": "go-test", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/googletest/fail/record_test_result.json b/tests/data/googletest/fail/record_test_result.json index 443a38c9e..7b9b528c8 100644 --- a/tests/data/googletest/fail/record_test_result.json +++ b/tests/data/googletest/fail/record_test_result.json @@ -57,5 +57,7 @@ ], "testRunner": "googletest", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/googletest/record_test_result.json b/tests/data/googletest/record_test_result.json index 26f8e9a04..2f2a1ffdf 100644 --- a/tests/data/googletest/record_test_result.json +++ b/tests/data/googletest/record_test_result.json @@ -111,5 +111,7 @@ ], "testRunner": "googletest", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/gradle/recursion/expected.json b/tests/data/gradle/recursion/expected.json index 76f4b5827..6798dba57 100644 --- a/tests/data/gradle/recursion/expected.json +++ b/tests/data/gradle/recursion/expected.json @@ -75,5 +75,7 @@ ], "testRunner": "gradle", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/jest/record_test_result.json b/tests/data/jest/record_test_result.json index 48be036e4..74444ce0a 100644 --- a/tests/data/jest/record_test_result.json +++ b/tests/data/jest/record_test_result.json @@ -149,5 +149,7 @@ ], "testRunner": "jest", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/maven/record_test_result.json b/tests/data/maven/record_test_result.json index 5a21dd5ec..280567e68 100644 --- a/tests/data/maven/record_test_result.json +++ b/tests/data/maven/record_test_result.json @@ -57,5 +57,7 @@ ], "testRunner": "maven", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/minitest/record_test_result.json b/tests/data/minitest/record_test_result.json index 421e1acbd..4c7132af2 100644 --- a/tests/data/minitest/record_test_result.json +++ b/tests/data/minitest/record_test_result.json @@ -146,5 +146,7 @@ ], "testRunner": "minitest", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/nunit/nunit-reporter-bug-with-nested-type.json b/tests/data/nunit/nunit-reporter-bug-with-nested-type.json index 7dc84b977..2a1c446e2 100644 --- a/tests/data/nunit/nunit-reporter-bug-with-nested-type.json +++ b/tests/data/nunit/nunit-reporter-bug-with-nested-type.json @@ -36,5 +36,7 @@ ], "testRunner": "nunit", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/nunit/record_test_result-linux.json b/tests/data/nunit/record_test_result-linux.json index 8007f91a4..3bd767984 100644 --- a/tests/data/nunit/record_test_result-linux.json +++ b/tests/data/nunit/record_test_result-linux.json @@ -106,5 +106,7 @@ ], "testRunner": "nunit", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/nunit/record_test_result-windows.json b/tests/data/nunit/record_test_result-windows.json index 71dbd0e2a..f27561db4 100644 --- a/tests/data/nunit/record_test_result-windows.json +++ b/tests/data/nunit/record_test_result-windows.json @@ -106,5 +106,7 @@ ], "testRunner": "nunit", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/playwright/record_test_result.json b/tests/data/playwright/record_test_result.json index 17a782c58..8f31f3037 100644 --- a/tests/data/playwright/record_test_result.json +++ b/tests/data/playwright/record_test_result.json @@ -1677,5 +1677,7 @@ ], "testRunner": "playwright", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } \ No newline at end of file diff --git a/tests/data/playwright/record_test_result_with_json.json b/tests/data/playwright/record_test_result_with_json.json index 3a8d7eb31..452b1573a 100644 --- a/tests/data/playwright/record_test_result_with_json.json +++ b/tests/data/playwright/record_test_result_with_json.json @@ -2403,5 +2403,7 @@ ], "testRunner": "playwright", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } \ No newline at end of file diff --git a/tests/data/prove/record_test_result.json b/tests/data/prove/record_test_result.json index 6a1f21d8f..286151e1e 100644 --- a/tests/data/prove/record_test_result.json +++ b/tests/data/prove/record_test_result.json @@ -129,5 +129,7 @@ ], "testRunner": "prove", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/pytest/record_test_result.json b/tests/data/pytest/record_test_result.json index 196582a1d..ba790eb71 100644 --- a/tests/data/pytest/record_test_result.json +++ b/tests/data/pytest/record_test_result.json @@ -227,5 +227,7 @@ ], "testRunner": "pytest", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/pytest/record_test_result_json.json b/tests/data/pytest/record_test_result_json.json index a4d0e4ad6..e87897ea9 100644 --- a/tests/data/pytest/record_test_result_json.json +++ b/tests/data/pytest/record_test_result_json.json @@ -157,5 +157,7 @@ ], "testRunner": "pytest", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/robot/record_test_executed_only_one_file_result.json b/tests/data/robot/record_test_executed_only_one_file_result.json index f530bd97a..2211ea60e 100644 --- a/tests/data/robot/record_test_executed_only_one_file_result.json +++ b/tests/data/robot/record_test_executed_only_one_file_result.json @@ -57,5 +57,7 @@ ], "testRunner": "robot", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/robot/record_test_result.json b/tests/data/robot/record_test_result.json index 16e63c1fb..e9a327c36 100644 --- a/tests/data/robot/record_test_result.json +++ b/tests/data/robot/record_test_result.json @@ -111,5 +111,7 @@ ], "testRunner": "robot", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/data/rspec/record_test_result.json b/tests/data/rspec/record_test_result.json index a55eb661b..76c1f380b 100644 --- a/tests/data/rspec/record_test_result.json +++ b/tests/data/rspec/record_test_result.json @@ -355,5 +355,7 @@ ], "testRunner": "rspec", "group": "", - "noBuild": false + "noBuild": false, + "flavors": [], + "testSuite": "" } diff --git a/tests/test_runners/test_raw.py b/tests/test_runners/test_raw.py index 694980e27..fdaf60c73 100644 --- a/tests/test_runners/test_raw.py +++ b/tests/test_runners/test_raw.py @@ -285,6 +285,8 @@ def test_record_tests(self): "testRunner": "raw", "group": "", "noBuild": False, + "flavors": [], + "testSuite": "", }) @responses.activate @@ -362,7 +364,9 @@ def test_record_tests_junit_xml(self): ], "testRunner": "raw", "group": "", - "noBuild": False + "noBuild": False, + "flavors": [], + "testSuite": "", }) @responses.activate