How is --show-codecov-path intended to be used?

Continuing the discussion from How is --enable-code-coverage intended to be used?:

At the end of this thread @SDGGiesbrecht announced the addition of a feature to show where the coverage file is produced. But if one tries to use this option along with --enable-code-coverage, the result is:

error: Unknown option '--enable-code-coverage'
Usage: show-codecov-path
  See 'show-codecov-path --help' for more information.

The documentation gives no indication of this behavior. I'm afraid the addition of this option has made an already-confusing area of SPM more so.

It originally worked as a separate operation from running tests. It displayed the path where other commands would be placing or retrieving any coverage data.

Later, it was changed* into a true flag of the test command, so that it caused the location to display at the end of the test log if something was actually written to that location.

It worked fine through Swift 5.7, which was the last version I worked with. Something else must have changed since then to cause the behaviour you describe now. But I stopped following development, so I do not know when it broke or what modern usage would be.

*Edit: Oops, it wasn’t you like the original wording said. I wrote the post in a hurry and had some names jumbled in my head. Sorry about that.

1 Like

@SDGGiesbrecht It seems as though it is working the original way. But still, nobody documented how it was supposed to interact with other options. Would be able to submit a PR to describe the behavior you implemented?

I looked up the precise versions:

  • It existed as a command (PR) from 5.2 to 5.7.
  • It changed into an option (PR) in 5.8.
  • Then it reverted to being a command (PR) from 5.9 onward. (As I write this post, the latest release is 5.9.2.)

The participants of that last PR and its linked issue would be best suited to document their intent. I am just hearing of it for the first time as I assemble this list.