Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

SI-7696 Restore --show-log #63

Merged
merged 3 commits into from
Jun 8, 2016
Merged

Conversation

som-snytt
Copy link
Contributor

If a test exits abnormally, there is no diff in the test transcript. --show-log shows the log, which probably contains a stack trace in the case of catastrophic failure.

Also, sometimes diffs are too obscure, and it's simply easier to examine the entire test output.
(That's the argument for a distinct --show-log option; maybe --show-diff should show the log for abnormal completion, too.)

For --show-diff output

# starting 1 test in run
!! 1 - run/foo.scala                             [output differs]
% diff /home/apm/projects/snytt/test/files/run/foo-run.log /home/apm/projects/snytt/test/files/run/foo.check---
+++ foo-run.log
@@ -1,0 +1,1 @@
+oops
#0/1 passed, 1 failed in run

--show-log shows

# starting 1 test in run
!! 1 - run/foo.scala                             [output differs]
##### Log file '/home/apm/projects/snytt/test/files/run/foo-run.log' from failed test #####

oops

#0/1 passed, 1 failed in run

som-snytt added 3 commits June 4, 2016 12:41
Look for the diff line in the transcript, which diffs the log
file and the check file, to pick off the log file name, then
just display the contents.

For --show-diff output
```
\# starting 1 test in run
!! 1 - run/foo.scala                             [output differs]
% diff /home/apm/projects/snytt/test/files/run/foo-run.log /home/apm/projects/snytt/test/files/run/foo.check--- empty
+++ foo-run.log
@@ -1,0 +1,1 @@
+oops
\# 0/1 passed, 1 failed in run
```
--show-log shows
```
\# starting 1 test in run
!! 1 - run/foo.scala                             [output differs]
\##### Log file '/home/apm/projects/snytt/test/files/run/foo-run.log' from failed test #####

oops

\# 0/1 passed, 1 failed in run
```
where comment lines are prefixed by \ for purposes of commit message.
On non-zero exit, no transcript is recorded.
Show log in that important use case.

TestInfo encapsulates a bit of useful interface.
If a test throws (and exits non-zero), you can see the log with
`--verbose` (which shows the whole transcript), `--show-log`,
and now also `--show-diff` (which will show log if the other
options aren't set, the test failed and there's no diff to view.
@som-snytt
Copy link
Contributor Author

The last commit lets --show-diff go ahead and show the log if there's no diff in the transcript (due to abnormal termination).

@som-snytt
Copy link
Contributor Author

I guess Mima is the argument for folding partest back into the scala repo.

@lrytz
Copy link
Member

lrytz commented Jun 8, 2016

not sure why we enforce binary compatibility for scala-partest. we (scala, dotty) are the only users, and we don't have any pre-compiled binaries that would link against a newly released minor version, as far as i can tell. cc @szeiger

@lrytz
Copy link
Member

lrytz commented Jun 8, 2016

LGTM otherwise

@szeiger
Copy link
Contributor

szeiger commented Jun 8, 2016

Source compatibility matters to some extent. I don't think binary compatibility does.

@lrytz
Copy link
Member

lrytz commented Jun 8, 2016

We can merge this one too, then.

@lrytz lrytz merged commit f278cc0 into scala:master Jun 8, 2016
@som-snytt som-snytt deleted the issue/7696-show-log branch April 6, 2017 23:52
lrytz added a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
lrytz added a commit to lrytz/scala-partest that referenced this pull request May 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants