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

A test running addendum? #42

Open
Leont opened this issue Dec 28, 2022 · 1 comment
Open

A test running addendum? #42

Leont opened this issue Dec 28, 2022 · 1 comment

Comments

@Leont
Copy link

Leont commented Dec 28, 2022

Currently we're only describing the TAP stream and nothing around it. I think it may be useful to also (probably separate from the main document?) to write something about running the programs that output TAP. In particular

  • Interpreting the return value of the program.
  • Using an environmental variable to hint to the TAP producer what versions of TAP the consumer wants to consume (e.g. TAP_VERSIONS=14,13,12)
@ferdnyc
Copy link

ferdnyc commented Jun 18, 2023

@Leont

  • Using an environmental variable to hint to the TAP producer what versions of TAP the consumer wants to consume (e.g. TAP_VERSIONS=14,13,12)

That sounds to me like an implementation detail and an unspecifiable requirement at the same time.

  • Producers aren't required to support outputting any version of TAP other than the one they output (as indicated by the version line), so in terms of practical requirements there's no reason for them to support that envvar either.

  • For producers that do support configurable output, does it really benefit anyone to constrain them as to how? They may accept command-line args, they may take a config file, they may respect an envvar. Any of those can work, and depending on the testing scenario each approach can be a better fit than the others. Experience says most tools end up doing "all of the above", if not more.

(Envvars are great in a CI environment or similar, but they suck if you're distributing tests with a public project. Now you have to try and find a way to ensure that everyone who runs the tests has the right variables set in their environment — which won't happen. Whereas, if you can check in a config file that the producer will automatically pick up, problem solved.)

For exit codes, the spec already says (In §Harness Behavior):

A harness should treat a test program as a failed test if:

  • The TAP output lines indicate test failure, or
  • The TAP output of the process is invalid in a way that is not
    recoverable, or
  • The exit code of the test program is not 0 (including test programs
    killed by a fatal Unix signal).

If one or more test programs are considered failures, then a TAP Harness
should indicate failure to the user in whatever means are appropriate.
For example, a command-line test runner might exit with a non-zero status
code, while a web-based continuous integration system might put a red
"FAILED" notice in the html output.

Which I think is appropriately vague, in the same "different approaches for different scenarios" way.

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