Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test suite name to test names (optionally) #144

Open
igagis opened this issue Jun 22, 2021 · 3 comments
Open

Add test suite name to test names (optionally) #144

igagis opened this issue Jun 22, 2021 · 3 comments

Comments

@igagis
Copy link

igagis commented Jun 22, 2021

currently the failed test case appears in Github Actions as:

image

Only test name is present in this report. Need to add also test suite name.

In this example, the test_which_fails_check_eq_with_custom_message test is within factorial test suite.

Would be nice to have <test-suite> <test-name> (separated by space, or make separator customizable via with: in yaml) instead of just <test-name> in the github actions report.

Test report:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name='failing tests' tests='31' disabled='5' errors='1' failures='19' skipped='0' time='0.002'>
	<testsuite name='factorial' tests='17' disabled='5' failures='5' errors='1' skipped='0'>
		<testcase name='positive_arguments_must_produce_expected_result[0]' status='passed' time='0'/>
		<testcase name='factorial_of_value_from_fixture' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/main.cpp:72: error: check_eq(3628800, 3628801)'/>
		</testcase>
		<testcase name='factorial_of_value_from_fixture[3]' status='passed' time='0'/>
		<testcase name='factorial_of_value_from_fixture[2]' status='passed' time='0'/>
		<testcase name='disabled_test' status='disabled' time='0'/>
		<testcase name='positive_arguments_must_produce_expected_result' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/main.cpp:45: error: check_ne(6, 6)hello world!'/>
		</testcase>
		<testcase name='test_which_throws_unknown_exception' status='errored' time='0'>
			<error message='uncaught (anonymous namespace)::some_unknown_exception'/>
		</testcase>
		<testcase name='positive_arguments_must_produce_expected_result[2]' status='failed' time='0.001'>
			<failure message='/home/ivan/prj/tst/tests/failed/main.cpp:85: error: check(false)'/>
		</testcase>
		<testcase name='positive_arguments_must_produce_expected_result[3]' status='passed' time='0'/>
		<testcase name='factorial_of_value_from_fixture[0]' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/main.cpp:109: error: expected 2'/>
		</testcase>
		<testcase name='disabled_param_test[0]' status='disabled' time='0'/>
		<testcase name='disabled_param_test[1]' status='disabled' time='0'/>
		<testcase name='disabled_param_test[2]' status='disabled' time='0'/>
		<testcase name='test_which_fails_check_eq_with_custom_message' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/main.cpp:62: error: check_eq(6, 7)hello world!'/>
		</testcase>
		<testcase name='disabled_param_test[3]' status='disabled' time='0'/>
		<testcase name='positive_arguments_must_produce_expected_result[1]' status='passed' time='0'/>
		<testcase name='factorial_of_value_from_fixture[1]' status='passed' time='0'/>
	</testsuite>
	<testsuite name='failing_checks' tests='14' disabled='0' failures='14' errors='0' skipped='0'>
		<testcase name='check_ge_print' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:59: error: check_ge(2, 3)failed!'/>
		</testcase>
		<testcase name='check_ge' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:55: error: check_ge(2, 3)Hello world!'/>
		</testcase>
		<testcase name='check_gt_print' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:43: error: check_gt(2, 2)failed!'/>
		</testcase>
		<testcase name='check_lt_print' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:35: error: check_lt(2, 2)failed!'/>
		</testcase>
		<testcase name='check_print' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:11: error: failed!'/>
		</testcase>
		<testcase name='check_gt' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:39: error: check_gt(2, 2)Hello world!'/>
		</testcase>
		<testcase name='check' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:7: error: Hello world!'/>
		</testcase>
		<testcase name='check_le_print' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:51: error: check_le(2, 1)failed!'/>
		</testcase>
		<testcase name='check_eq' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:15: error: check_eq(1, 2)Hello world!'/>
		</testcase>
		<testcase name='check_eq_print' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:19: error: check_eq(1, 2)failed!'/>
		</testcase>
		<testcase name='check_le' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:47: error: check_le(2, 1)Hello world!'/>
		</testcase>
		<testcase name='check_ne' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:23: error: check_ne(2, 2)Hello world!'/>
		</testcase>
		<testcase name='check_lt' status='failed' time='0'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:31: error: check_lt(2, 2)Hello world!'/>
		</testcase>
		<testcase name='check_ne_print' status='failed' time='0.001'>
			<failure message='/home/ivan/prj/tst/tests/failed/checks.cpp:27: error: check_ne(2, 2)failed!'/>
		</testcase>
	</testsuite>
</testsuites>
@EnricoMi
Copy link
Owner

EnricoMi commented Jul 5, 2021

Adding the test suite name can make that line very long. Does adding it provide that much value given the Raw output should point you to the failing test and file anyway?

@igagis
Copy link
Author

igagis commented Jul 5, 2021

Well, it gives value. If there is a desire to keep strings short, maybe it makes sense to make this feature configurable via with: argument? Like:

with:
  print_suite_name: true

@EnricoMi EnricoMi changed the title test suite name is not printed for failed tests Add test suite name to test names (optionally) Jul 20, 2021
@garazdawi
Copy link

The annotation with found and skipped tests would also benefit from having the suite name before the testcase name. In there the length does not matter as much so it could probably be enabled by default.

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

No branches or pull requests

3 participants