From 738029ae0e130834d5b18a1a4f48ca2a1b679230 Mon Sep 17 00:00:00 2001 From: Ryosuke Yabuki Date: Thu, 5 Dec 2024 13:19:38 +0900 Subject: [PATCH 1/5] support flavors and test-suite options when no-build options is enabled --- launchable/commands/record/tests.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/launchable/commands/record/tests.py b/launchable/commands/record/tests.py index af77a83c1..f47b0f2ef 100644 --- a/launchable/commands/record/tests.py +++ b/launchable/commands/record/tests.py @@ -463,8 +463,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, + "flavors": flavor, + }, exs def send(payload: Dict[str, Union[str, List]]) -> None: res = client.request( From d10d774542b0bad14aec15a1372db0a630be96f1 Mon Sep 17 00:00:00 2001 From: Ryosuke Yabuki Date: Thu, 5 Dec 2024 14:17:26 +0900 Subject: [PATCH 2/5] fix tests --- tests/data/ant/record_test_result.json | 4 +++- tests/data/bazel/record_test_result.json | 4 +++- .../bazel/record_test_with_build_event_json_result.json | 4 +++- .../record_test_with_multiple_build_event_json_result.json | 4 +++- tests/data/behave/record_test_result.json | 4 +++- tests/data/ctest/record_test_result.json | 4 +++- tests/data/cts/record_test_result.json | 4 +++- tests/data/cucumber/record_test_json_result.json | 4 +++- tests/data/cucumber/record_test_result.json | 4 +++- tests/data/cypress/record_test_result.json | 4 +++- tests/data/dotnet/record_test_result.json | 4 +++- tests/data/flutter/record_test_result.json | 4 +++- tests/data/go_test/record_test_result.json | 4 +++- tests/data/googletest/fail/record_test_result.json | 4 +++- tests/data/googletest/record_test_result.json | 4 +++- tests/data/gradle/recursion/expected.json | 4 +++- tests/data/jest/record_test_result.json | 4 +++- tests/data/maven/record_test_result.json | 4 +++- tests/data/minitest/record_test_result.json | 4 +++- tests/data/nunit/nunit-reporter-bug-with-nested-type.json | 4 +++- tests/data/nunit/record_test_result-linux.json | 4 +++- tests/data/nunit/record_test_result-windows.json | 4 +++- tests/data/playwright/record_test_result.json | 4 +++- tests/data/playwright/record_test_result_with_json.json | 4 +++- tests/data/prove/record_test_result.json | 4 +++- tests/data/pytest/record_test_result.json | 4 +++- tests/data/pytest/record_test_result_json.json | 4 +++- .../robot/record_test_executed_only_one_file_result.json | 4 +++- tests/data/robot/record_test_result.json | 4 +++- tests/data/rspec/record_test_result.json | 4 +++- tests/test_runners/test_raw.py | 6 +++++- 31 files changed, 95 insertions(+), 31 deletions(-) diff --git a/tests/data/ant/record_test_result.json b/tests/data/ant/record_test_result.json index 5bdee936c..800f14290 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": null } diff --git a/tests/data/bazel/record_test_result.json b/tests/data/bazel/record_test_result.json index e76352088..5f00dc24e 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": null } 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..1d5d1c082 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": null } 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..efa16ce20 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": null } diff --git a/tests/data/behave/record_test_result.json b/tests/data/behave/record_test_result.json index edf37e321..5bf269c09 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": null } diff --git a/tests/data/ctest/record_test_result.json b/tests/data/ctest/record_test_result.json index 8356a9e4b..20b081f16 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": null } diff --git a/tests/data/cts/record_test_result.json b/tests/data/cts/record_test_result.json index f44535864..aa20c2486 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": null } diff --git a/tests/data/cucumber/record_test_json_result.json b/tests/data/cucumber/record_test_json_result.json index 405322680..784b4a417 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": null } diff --git a/tests/data/cucumber/record_test_result.json b/tests/data/cucumber/record_test_result.json index daaa8f152..e30956a17 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": null } diff --git a/tests/data/cypress/record_test_result.json b/tests/data/cypress/record_test_result.json index c0af2757d..aa4b5459b 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": null } diff --git a/tests/data/dotnet/record_test_result.json b/tests/data/dotnet/record_test_result.json index f4781fcaa..2e3c7450e 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": null } diff --git a/tests/data/flutter/record_test_result.json b/tests/data/flutter/record_test_result.json index 28cab3ebc..d54c9c8d6 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": null } \ 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..c2988159a 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": null } diff --git a/tests/data/googletest/fail/record_test_result.json b/tests/data/googletest/fail/record_test_result.json index 443a38c9e..2dd4c0ae7 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": null } diff --git a/tests/data/googletest/record_test_result.json b/tests/data/googletest/record_test_result.json index 26f8e9a04..a57948bbb 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": null } diff --git a/tests/data/gradle/recursion/expected.json b/tests/data/gradle/recursion/expected.json index 76f4b5827..ae33f3284 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": null } diff --git a/tests/data/jest/record_test_result.json b/tests/data/jest/record_test_result.json index 48be036e4..6fd92f751 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": null } diff --git a/tests/data/maven/record_test_result.json b/tests/data/maven/record_test_result.json index 5a21dd5ec..ae0aade4d 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": null } diff --git a/tests/data/minitest/record_test_result.json b/tests/data/minitest/record_test_result.json index 421e1acbd..ec196ffbe 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": null } 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..642d29f41 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": null } diff --git a/tests/data/nunit/record_test_result-linux.json b/tests/data/nunit/record_test_result-linux.json index 8007f91a4..f35a8e1ac 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": null } diff --git a/tests/data/nunit/record_test_result-windows.json b/tests/data/nunit/record_test_result-windows.json index 71dbd0e2a..f089616b2 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": null } diff --git a/tests/data/playwright/record_test_result.json b/tests/data/playwright/record_test_result.json index 17a782c58..30675a1a9 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": null } \ 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..80da888a0 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": null } \ 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..cd449e211 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": null } diff --git a/tests/data/pytest/record_test_result.json b/tests/data/pytest/record_test_result.json index 196582a1d..3d79e2a8e 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": null } diff --git a/tests/data/pytest/record_test_result_json.json b/tests/data/pytest/record_test_result_json.json index a4d0e4ad6..5e3370d6f 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": null } 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..b8e972074 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": null } diff --git a/tests/data/robot/record_test_result.json b/tests/data/robot/record_test_result.json index 16e63c1fb..dd8ef9528 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": null } diff --git a/tests/data/rspec/record_test_result.json b/tests/data/rspec/record_test_result.json index a55eb661b..b19064216 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": null } diff --git a/tests/test_runners/test_raw.py b/tests/test_runners/test_raw.py index 694980e27..81cf4d179 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": None, }) @responses.activate @@ -362,7 +364,9 @@ def test_record_tests_junit_xml(self): ], "testRunner": "raw", "group": "", - "noBuild": False + "noBuild": False, + "flavors": [], + "testSuite": None, }) @responses.activate From 3f34f025aa0ea363708050a48a2a61e107f6270d Mon Sep 17 00:00:00 2001 From: Ryosuke Yabuki Date: Thu, 5 Dec 2024 14:27:03 +0900 Subject: [PATCH 3/5] flavors is dict format --- launchable/commands/record/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launchable/commands/record/tests.py b/launchable/commands/record/tests.py index f47b0f2ef..d5159654d 100644 --- a/launchable/commands/record/tests.py +++ b/launchable/commands/record/tests.py @@ -472,7 +472,7 @@ def payload(cases: Generator[TestCase, None, None], # NOTE: # testSuite and flavors are applied only when the no-build option is enabled "testSuite": test_suite, - "flavors": flavor, + "flavors": dict(flavor), }, exs def send(payload: Dict[str, Union[str, List]]) -> None: From 200de29e6969cc9873348cb9c2fc6b323c940865 Mon Sep 17 00:00:00 2001 From: Ryosuke Yabuki Date: Thu, 5 Dec 2024 14:39:37 +0900 Subject: [PATCH 4/5] fix lint check --- launchable/commands/record/tests.py | 2 +- tests/data/ant/record_test_result.json | 2 +- tests/data/bazel/record_test_result.json | 2 +- .../data/bazel/record_test_with_build_event_json_result.json | 2 +- .../record_test_with_multiple_build_event_json_result.json | 2 +- tests/data/behave/record_test_result.json | 2 +- tests/data/ctest/record_test_result.json | 2 +- tests/data/cts/record_test_result.json | 2 +- tests/data/cucumber/record_test_json_result.json | 2 +- tests/data/cucumber/record_test_result.json | 2 +- tests/data/cypress/record_test_result.json | 2 +- tests/data/dotnet/record_test_result.json | 2 +- tests/data/flutter/record_test_result.json | 2 +- tests/data/go_test/record_test_result.json | 2 +- tests/data/googletest/fail/record_test_result.json | 2 +- tests/data/googletest/record_test_result.json | 2 +- tests/data/gradle/recursion/expected.json | 2 +- tests/data/jest/record_test_result.json | 2 +- tests/data/maven/record_test_result.json | 2 +- tests/data/minitest/record_test_result.json | 2 +- tests/data/nunit/nunit-reporter-bug-with-nested-type.json | 2 +- tests/data/nunit/record_test_result-linux.json | 2 +- tests/data/nunit/record_test_result-windows.json | 2 +- tests/data/playwright/record_test_result.json | 2 +- tests/data/playwright/record_test_result_with_json.json | 2 +- tests/data/prove/record_test_result.json | 2 +- tests/data/pytest/record_test_result.json | 2 +- tests/data/pytest/record_test_result_json.json | 2 +- .../data/robot/record_test_executed_only_one_file_result.json | 2 +- tests/data/robot/record_test_result.json | 2 +- tests/data/rspec/record_test_result.json | 2 +- tests/test_runners/test_raw.py | 4 ++-- 32 files changed, 33 insertions(+), 33 deletions(-) diff --git a/launchable/commands/record/tests.py b/launchable/commands/record/tests.py index d5159654d..20bfbca98 100644 --- a/launchable/commands/record/tests.py +++ b/launchable/commands/record/tests.py @@ -471,7 +471,7 @@ def payload(cases: Generator[TestCase, None, None], "noBuild": self.is_no_build, # NOTE: # testSuite and flavors are applied only when the no-build option is enabled - "testSuite": test_suite, + "testSuite": test_suite if test_suite else "", "flavors": dict(flavor), }, exs diff --git a/tests/data/ant/record_test_result.json b/tests/data/ant/record_test_result.json index 800f14290..fc12d05ae 100644 --- a/tests/data/ant/record_test_result.json +++ b/tests/data/ant/record_test_result.json @@ -59,5 +59,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/bazel/record_test_result.json b/tests/data/bazel/record_test_result.json index 5f00dc24e..0d8345d6d 100644 --- a/tests/data/bazel/record_test_result.json +++ b/tests/data/bazel/record_test_result.json @@ -131,5 +131,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "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 1d5d1c082..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 @@ -47,5 +47,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "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 efa16ce20..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 @@ -75,5 +75,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/behave/record_test_result.json b/tests/data/behave/record_test_result.json index 5bf269c09..d02739bff 100644 --- a/tests/data/behave/record_test_result.json +++ b/tests/data/behave/record_test_result.json @@ -27,5 +27,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/ctest/record_test_result.json b/tests/data/ctest/record_test_result.json index 20b081f16..9de48e1b2 100644 --- a/tests/data/ctest/record_test_result.json +++ b/tests/data/ctest/record_test_result.json @@ -61,5 +61,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/cts/record_test_result.json b/tests/data/cts/record_test_result.json index aa20c2486..c64dbce28 100644 --- a/tests/data/cts/record_test_result.json +++ b/tests/data/cts/record_test_result.json @@ -247,5 +247,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/cucumber/record_test_json_result.json b/tests/data/cucumber/record_test_json_result.json index 784b4a417..959df5c78 100644 --- a/tests/data/cucumber/record_test_json_result.json +++ b/tests/data/cucumber/record_test_json_result.json @@ -497,5 +497,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/cucumber/record_test_result.json b/tests/data/cucumber/record_test_result.json index e30956a17..6ccc9502b 100644 --- a/tests/data/cucumber/record_test_result.json +++ b/tests/data/cucumber/record_test_result.json @@ -291,5 +291,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/cypress/record_test_result.json b/tests/data/cypress/record_test_result.json index aa4b5459b..821f5a0ff 100644 --- a/tests/data/cypress/record_test_result.json +++ b/tests/data/cypress/record_test_result.json @@ -71,5 +71,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/dotnet/record_test_result.json b/tests/data/dotnet/record_test_result.json index 2e3c7450e..90aa4df51 100644 --- a/tests/data/dotnet/record_test_result.json +++ b/tests/data/dotnet/record_test_result.json @@ -109,5 +109,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/flutter/record_test_result.json b/tests/data/flutter/record_test_result.json index d54c9c8d6..63bcf3361 100644 --- a/tests/data/flutter/record_test_result.json +++ b/tests/data/flutter/record_test_result.json @@ -59,5 +59,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "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 c2988159a..dfacaebcf 100644 --- a/tests/data/go_test/record_test_result.json +++ b/tests/data/go_test/record_test_result.json @@ -77,5 +77,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/googletest/fail/record_test_result.json b/tests/data/googletest/fail/record_test_result.json index 2dd4c0ae7..7b9b528c8 100644 --- a/tests/data/googletest/fail/record_test_result.json +++ b/tests/data/googletest/fail/record_test_result.json @@ -59,5 +59,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/googletest/record_test_result.json b/tests/data/googletest/record_test_result.json index a57948bbb..2f2a1ffdf 100644 --- a/tests/data/googletest/record_test_result.json +++ b/tests/data/googletest/record_test_result.json @@ -113,5 +113,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/gradle/recursion/expected.json b/tests/data/gradle/recursion/expected.json index ae33f3284..6798dba57 100644 --- a/tests/data/gradle/recursion/expected.json +++ b/tests/data/gradle/recursion/expected.json @@ -77,5 +77,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/jest/record_test_result.json b/tests/data/jest/record_test_result.json index 6fd92f751..74444ce0a 100644 --- a/tests/data/jest/record_test_result.json +++ b/tests/data/jest/record_test_result.json @@ -151,5 +151,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/maven/record_test_result.json b/tests/data/maven/record_test_result.json index ae0aade4d..280567e68 100644 --- a/tests/data/maven/record_test_result.json +++ b/tests/data/maven/record_test_result.json @@ -59,5 +59,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/minitest/record_test_result.json b/tests/data/minitest/record_test_result.json index ec196ffbe..4c7132af2 100644 --- a/tests/data/minitest/record_test_result.json +++ b/tests/data/minitest/record_test_result.json @@ -148,5 +148,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "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 642d29f41..2a1c446e2 100644 --- a/tests/data/nunit/nunit-reporter-bug-with-nested-type.json +++ b/tests/data/nunit/nunit-reporter-bug-with-nested-type.json @@ -38,5 +38,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/nunit/record_test_result-linux.json b/tests/data/nunit/record_test_result-linux.json index f35a8e1ac..3bd767984 100644 --- a/tests/data/nunit/record_test_result-linux.json +++ b/tests/data/nunit/record_test_result-linux.json @@ -108,5 +108,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/nunit/record_test_result-windows.json b/tests/data/nunit/record_test_result-windows.json index f089616b2..f27561db4 100644 --- a/tests/data/nunit/record_test_result-windows.json +++ b/tests/data/nunit/record_test_result-windows.json @@ -108,5 +108,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/playwright/record_test_result.json b/tests/data/playwright/record_test_result.json index 30675a1a9..8f31f3037 100644 --- a/tests/data/playwright/record_test_result.json +++ b/tests/data/playwright/record_test_result.json @@ -1679,5 +1679,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "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 80da888a0..452b1573a 100644 --- a/tests/data/playwright/record_test_result_with_json.json +++ b/tests/data/playwright/record_test_result_with_json.json @@ -2405,5 +2405,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "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 cd449e211..286151e1e 100644 --- a/tests/data/prove/record_test_result.json +++ b/tests/data/prove/record_test_result.json @@ -131,5 +131,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/pytest/record_test_result.json b/tests/data/pytest/record_test_result.json index 3d79e2a8e..ba790eb71 100644 --- a/tests/data/pytest/record_test_result.json +++ b/tests/data/pytest/record_test_result.json @@ -229,5 +229,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/pytest/record_test_result_json.json b/tests/data/pytest/record_test_result_json.json index 5e3370d6f..e87897ea9 100644 --- a/tests/data/pytest/record_test_result_json.json +++ b/tests/data/pytest/record_test_result_json.json @@ -159,5 +159,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "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 b8e972074..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 @@ -59,5 +59,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/robot/record_test_result.json b/tests/data/robot/record_test_result.json index dd8ef9528..e9a327c36 100644 --- a/tests/data/robot/record_test_result.json +++ b/tests/data/robot/record_test_result.json @@ -113,5 +113,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/data/rspec/record_test_result.json b/tests/data/rspec/record_test_result.json index b19064216..76c1f380b 100644 --- a/tests/data/rspec/record_test_result.json +++ b/tests/data/rspec/record_test_result.json @@ -357,5 +357,5 @@ "group": "", "noBuild": false, "flavors": [], - "testSuite": null + "testSuite": "" } diff --git a/tests/test_runners/test_raw.py b/tests/test_runners/test_raw.py index 81cf4d179..fdaf60c73 100644 --- a/tests/test_runners/test_raw.py +++ b/tests/test_runners/test_raw.py @@ -286,7 +286,7 @@ def test_record_tests(self): "group": "", "noBuild": False, "flavors": [], - "testSuite": None, + "testSuite": "", }) @responses.activate @@ -366,7 +366,7 @@ def test_record_tests_junit_xml(self): "group": "", "noBuild": False, "flavors": [], - "testSuite": None, + "testSuite": "", }) @responses.activate From 39e317d294fd3e4325f34009da7a6567b59b6c70 Mon Sep 17 00:00:00 2001 From: Ryosuke Yabuki Date: Thu, 5 Dec 2024 14:47:41 +0900 Subject: [PATCH 5/5] fix feedback --- launchable/commands/record/tests.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/launchable/commands/record/tests.py b/launchable/commands/record/tests.py index 20bfbca98..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 = [] @@ -471,8 +474,8 @@ def payload(cases: Generator[TestCase, None, None], "noBuild": self.is_no_build, # NOTE: # testSuite and flavors are applied only when the no-build option is enabled - "testSuite": test_suite if test_suite else "", - "flavors": dict(flavor), + "testSuite": test_suite_name, + "flavors": flavors, }, exs def send(payload: Dict[str, Union[str, List]]) -> None: @@ -542,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)