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

Clarify status and message in test runner spec #175

Merged

Conversation

ee7
Copy link
Member

@ee7 ee7 commented Jul 7, 2021

Reproducing the commit messages:

Clarify top-level fail in test runner spec

Consider the situation of:

  • The user submits a solution in a compiled language
  • The user's solution compiles without error
  • The first test passes, but the next test "produces an error" (for
    example, it raises an exception).

In this case, the correct top-level status is fail, with one
test-level status of pass, and one test-level status of error. But
the previous wording could imply that a top-level status of fail
is only correct if at least one test has the status fail.

Clarify per-test message in test runner spec

The previous wording could imply that a per-test message property
can only be present when the test status is fail.

Clarify top-level error in test runner spec

To me, the previous wording implied that a top-level status of error
is valid when at least one test "errors". But actually, if at least one
test was "executed", the top-level status should be pass or fail.

Try to clarify test-level error in test runner spec

(Difficult).


I'm making this PR because in exercism/nim-test-runner#87 (comment) it was unclear to me what the expected results.json is when a test errors.

I wanted to incorporate Erik's clarification for a top-level status:

If any of the tests were executed, the status property should be null or omitted.

and for a test-level status:

In this case the key thing is that no result is returned, so you can't know if it would be a pass or fail, so error is appropriate here.

because I think the current docs don't convey this.

I think fail vs error could be clearer elsewhere in interface.md too (I'd appreciate if someone could read through the full interface.md contents with this PR and help out), but I'll set this PR as non-draft in case we prefer to follow-up later.

ee7 added 4 commits July 7, 2021 16:00
Consider the situation of:
- The user submits a solution in a compiled language
- The user's solution compiles without error
- The first test passes, but the next test "produces an error" (for
  example, it raises an exception).

In this case, the correct top-level status is `fail`, with one
test-level status of `pass`, and one test-level status of `error`. But
the previous wording could imply that a top-level status of `fail`
is only correct if at least one test has the status `fail`.
The previous wording could imply that a per-test `message` property
can only be present when the test `status` is `fail`.
To me, the previous wording implied that a top-level `status` of `error`
is valid when at least one test "errors". But actually, if at least one
test was "executed", the top-level status should be `pass` or `fail`.
@@ -119,15 +119,15 @@ The following per-test statuses are valid:

- `pass`: The test passed
- `fail`: The test failed
- `error`: The test errored
- `error`: The test errored - that is, it did not return a value
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not happy with this, but I think we can do better than just "The test errored".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is good enough I feel

building/tooling/test-runners/interface.md Outdated Show resolved Hide resolved
Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
Co-authored-by: Erik Schierboom <erik_schierboom@hotmail.com>
Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com>
@ErikSchierboom
Copy link
Member

@ee7 Happy about the current version?

@ee7
Copy link
Member Author

ee7 commented Jul 22, 2021

@ErikSchierboom Yeah. Good enough for now, I think.

@ErikSchierboom ErikSchierboom merged commit 0011404 into exercism:main Jul 22, 2021
@ee7 ee7 deleted the test-runner-clarify-status-and-message branch July 22, 2021 11:02
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

Successfully merging this pull request may close these issues.

2 participants