diff --git a/launchable/commands/record/case_event.py b/launchable/commands/record/case_event.py index dd5b09cdb..39f9678c3 100644 --- a/launchable/commands/record/case_event.py +++ b/launchable/commands/record/case_event.py @@ -109,12 +109,12 @@ def stderr(case: TestCase) -> str: stderr = "" for result in case.result: if type(result) in POSSIBLE_RESULTS: - if result.message and result.text: - stderr = stderr + result.message + "\n" + result.text + # Since the `message` property is a summary of the `text` property, + # we should attempt to retrieve the `text` property first in order to obtain a detailed log. + if result.text: + stderr = stderr + result.text elif result.message: stderr = stderr + result.message + "\n" - elif result.text: - stderr = stderr + result.text return stderr diff --git a/tests/data/ant/record_test_result.json b/tests/data/ant/record_test_result.json index 71a9b2fe1..002477a57 100644 --- a/tests/data/ant/record_test_result.json +++ b/tests/data/ant/record_test_result.json @@ -15,7 +15,7 @@ "duration": 0.006, "status": 0, "stdout": "", - "stderr": "An error message\njunit.framework.AssertionFailedError: An error message\n\tat com.launchable.HelloWorldTest.testWillAlwaysFail(Unknown Source)\n", + "stderr": "junit.framework.AssertionFailedError: An error message\n\tat com.launchable.HelloWorldTest.testWillAlwaysFail(Unknown Source)\n", "created_at": "2021-04-28T10:36:31", "data": null }, diff --git a/tests/data/googletest/fail/record_test_result.json b/tests/data/googletest/fail/record_test_result.json index 038e07bc0..164f3adf3 100644 --- a/tests/data/googletest/fail/record_test_result.json +++ b/tests/data/googletest/fail/record_test_result.json @@ -15,7 +15,7 @@ "duration": 0.001, "status": 0, "stdout": "", - "stderr": "github.com/launchableinc/rocket-car-googletest/test_a.cpp:21\nExpected equality of these values:\n false\n true\ngithub.com/launchableinc/rocket-car-googletest/test_a.cpp:21\nExpected equality of these values:\n false\n true", + "stderr": "github.com/launchableinc/rocket-car-googletest/test_a.cpp:21\nExpected equality of these values:\n false\n true", "created_at": "2021-01-26T14:56:53", "data": null }, diff --git a/tests/data/playwright/record_test_result.json b/tests/data/playwright/record_test_result.json index db1dce9a5..12cb8e038 100644 --- a/tests/data/playwright/record_test_result.json +++ b/tests/data/playwright/record_test_result.json @@ -490,7 +490,7 @@ "duration": 5.417, "status": 0, "stdout": "", - "stderr": "example.spec.ts:10:5 get started link\n\n [chromium] \u203a tests/example.spec.ts:10:5 \u203a get started link \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error: Timed out 5000ms waiting for expect(locator).toBeVisible()\n\n Locator: getByRole('heading', { name: 'Installation!' })\n Expected: visible\n Received: hidden\n Call log:\n - expect.toBeVisible with timeout 5000ms\n - waiting for getByRole('heading', { name: 'Installation!' })\n\n\n 15 |\n 16 | // Expects page to have a heading with the name of Installation.\n > 17 | await expect(page.getByRole('heading', { name: 'Installation!' })).toBeVisible();\n | ^\n 18 | });\n 19 |\n\n at /Users/yabuki-ryosuke/src/github.com/launchableinc/examples/playwright/tests/example.spec.ts:17:70\n\n", + "stderr": "\n [chromium] \u203a tests/example.spec.ts:10:5 \u203a get started link \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error: Timed out 5000ms waiting for expect(locator).toBeVisible()\n\n Locator: getByRole('heading', { name: 'Installation!' })\n Expected: visible\n Received: hidden\n Call log:\n - expect.toBeVisible with timeout 5000ms\n - waiting for getByRole('heading', { name: 'Installation!' })\n\n\n 15 |\n 16 | // Expects page to have a heading with the name of Installation.\n > 17 | await expect(page.getByRole('heading', { name: 'Installation!' })).toBeVisible();\n | ^\n 18 | });\n 19 |\n\n at /Users/yabuki-ryosuke/src/github.com/launchableinc/examples/playwright/tests/example.spec.ts:17:70\n\n", "created_at": "2024-01-31T07:12:52.585Z", "data": null }, @@ -984,7 +984,7 @@ "duration": 6.048, "status": 0, "stdout": "", - "stderr": "example.spec.ts:10:5 get started link\n\n [firefox] \u203a tests/example.spec.ts:10:5 \u203a get started link \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error: Timed out 5000ms waiting for expect(locator).toBeVisible()\n\n Locator: getByRole('heading', { name: 'Installation!' })\n Expected: visible\n Received: hidden\n Call log:\n - expect.toBeVisible with timeout 5000ms\n - waiting for getByRole('heading', { name: 'Installation!' })\n\n\n 15 |\n 16 | // Expects page to have a heading with the name of Installation.\n > 17 | await expect(page.getByRole('heading', { name: 'Installation!' })).toBeVisible();\n | ^\n 18 | });\n 19 |\n\n at /Users/yabuki-ryosuke/src/github.com/launchableinc/examples/playwright/tests/example.spec.ts:17:70\n\n", + "stderr": "\n [firefox] \u203a tests/example.spec.ts:10:5 \u203a get started link \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error: Timed out 5000ms waiting for expect(locator).toBeVisible()\n\n Locator: getByRole('heading', { name: 'Installation!' })\n Expected: visible\n Received: hidden\n Call log:\n - expect.toBeVisible with timeout 5000ms\n - waiting for getByRole('heading', { name: 'Installation!' })\n\n\n 15 |\n 16 | // Expects page to have a heading with the name of Installation.\n > 17 | await expect(page.getByRole('heading', { name: 'Installation!' })).toBeVisible();\n | ^\n 18 | });\n 19 |\n\n at /Users/yabuki-ryosuke/src/github.com/launchableinc/examples/playwright/tests/example.spec.ts:17:70\n\n", "created_at": "2024-01-31T07:12:52.585Z", "data": null }, @@ -1478,7 +1478,7 @@ "duration": 5.586, "status": 0, "stdout": "", - "stderr": "example.spec.ts:10:5 get started link\n\n [webkit] \u203a tests/example.spec.ts:10:5 \u203a get started link \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error: Timed out 5000ms waiting for expect(locator).toBeVisible()\n\n Locator: getByRole('heading', { name: 'Installation!' })\n Expected: visible\n Received: hidden\n Call log:\n - expect.toBeVisible with timeout 5000ms\n - waiting for getByRole('heading', { name: 'Installation!' })\n\n\n 15 |\n 16 | // Expects page to have a heading with the name of Installation.\n > 17 | await expect(page.getByRole('heading', { name: 'Installation!' })).toBeVisible();\n | ^\n 18 | });\n 19 |\n\n at /Users/yabuki-ryosuke/src/github.com/launchableinc/examples/playwright/tests/example.spec.ts:17:70\n\n", + "stderr": "\n [webkit] \u203a tests/example.spec.ts:10:5 \u203a get started link \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n Error: Timed out 5000ms waiting for expect(locator).toBeVisible()\n\n Locator: getByRole('heading', { name: 'Installation!' })\n Expected: visible\n Received: hidden\n Call log:\n - expect.toBeVisible with timeout 5000ms\n - waiting for getByRole('heading', { name: 'Installation!' })\n\n\n 15 |\n 16 | // Expects page to have a heading with the name of Installation.\n > 17 | await expect(page.getByRole('heading', { name: 'Installation!' })).toBeVisible();\n | ^\n 18 | });\n 19 |\n\n at /Users/yabuki-ryosuke/src/github.com/launchableinc/examples/playwright/tests/example.spec.ts:17:70\n\n", "created_at": "2024-01-31T07:12:52.585Z", "data": null } diff --git a/tests/data/prove/record_test_result.json b/tests/data/prove/record_test_result.json index 9fa7c18d6..6a1f21d8f 100644 --- a/tests/data/prove/record_test_result.json +++ b/tests/data/prove/record_test_result.json @@ -33,7 +33,7 @@ "duration": 2.0633590221405, "status": 0, "stdout": "", - "stderr": "not ok 1 - add(1, 2) == 5\nnot ok 1 - add(1, 2) == 5\n# Subtest: add\n not ok 1 - 1 + 2\n 1..1", + "stderr": "not ok 1 - add(1, 2) == 5\n# Subtest: add\n not ok 1 - 1 + 2\n 1..1", "data": null }, { @@ -51,7 +51,7 @@ "duration": 2.1068799495697, "status": 0, "stdout": "", - "stderr": "not ok 2 - add\nnot ok 2 - add", + "stderr": "not ok 2 - add", "data": null }, { diff --git a/tests/data/pytest/record_test_result.json b/tests/data/pytest/record_test_result.json index 5a1b7d687..d6052faa8 100644 --- a/tests/data/pytest/record_test_result.json +++ b/tests/data/pytest/record_test_result.json @@ -42,7 +42,7 @@ "duration": 0.001, "status": 0, "stdout": "", - "stderr": "assert 1 == False\ndef test_func5():\n > assert 1 == False\n E assert 1 == False\n\n tests/funcs3_test.py:6: AssertionError ", + "stderr": "def test_func5():\n > assert 1 == False\n E assert 1 == False\n\n tests/funcs3_test.py:6: AssertionError ", "created_at": "2021-12-09T14:09:43.746900", "data": null }, @@ -88,7 +88,7 @@ "duration": 0.001, "status": 0, "stdout": "", - "stderr": "assert 1 == False\ndef test_func2():\n > assert 1 == False\n E assert 1 == False\n\n tests/test_funcs1.py:6: AssertionError ", + "stderr": "def test_func2():\n > assert 1 == False\n E assert 1 == False\n\n tests/test_funcs1.py:6: AssertionError ", "created_at": "2021-12-09T14:09:43.746900", "data": null },