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

async_subtest output incompatible with TAP14 spec #942

Open
happy-barney opened this issue Sep 10, 2022 · 3 comments
Open

async_subtest output incompatible with TAP14 spec #942

happy-barney opened this issue Sep 10, 2022 · 3 comments

Comments

@happy-barney
Copy link

spec says that first result after subtest is a result of subtest so tools processing your output will report invalid reports

Example:

async_subtest ("foo" => sub {
	ok 1, "foo / foo";
})->finish;

ok 1, "bar";

will produce

ok 1 - foo {
    ok 1 - foo / foo
    1..1
}
ok 2 - bar
1..2

which will be parsed by TAP14 (or earlier) compatible parsers as:

  • single test "foo {"
  • subtest "bar"
    • subtest test "foo/foo"
@exodist
Copy link
Member

exodist commented Sep 12, 2022

Hmm, that sounds like a problem with TAP 14, which I helped with (I am in the authors section). The Test2 format predates TAP 14, and TAP 14 was specifically supposed to honor and support it. There must be an omission. Prior to TAP 14 the subtest format was not standardized and worked purely as indented lines were ignored by any conforming parser.

I will bring this up with the others who worked on TAP 14 at some point.

@exodist
Copy link
Member

exodist commented Sep 12, 2022

@happy-barney
Copy link
Author

  • if you want to use this format, you should also prohibit trailing { in regular message
  • you should also specify where diagnostic data for subtest belong
  • you should take into account older tools (eg: Jenkins TAP plugin)
  • last but not least, you should always output tap version

@exodist exodist transferred this issue from Test-More/Test2-Suite Aug 4, 2024
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

2 participants