apple / swift-testing

A modern, expressive testing package for Swift
Apache License 2.0
1.47k stars 52 forks source link

Don't emit JSON blobs for test cases if a test function isn't parameterized. #482

Closed grynspan closed 2 weeks ago

grynspan commented 2 weeks ago

Internally, Swift Testing models non-parameterized test functions as parameterized over a single input, (). This is a very useful abstraction internally, but when it comes to the JSON output for parameterized tests, it can be confusing or surprising to see information about a test case that was synthesized by the library.

This PR suppresses events and metadata for the single test case of a non-parameterized test function.

Checklist:

grynspan commented 2 weeks ago

@swift-ci please test

briancroom commented 2 weeks ago

Have you thought about what kind/layering of test coverage we should have for this code?

grynspan commented 2 weeks ago

Have you thought about what kind/layering of test coverage we should have for this code?

We already technically have tests that cover this code, it's just never been a failure for extra data to be present. I intend to add some additional test coverage once the JSON format is finalized per #479.