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

SI-7003 Partest redirects stderr to log file #2591

Merged
merged 2 commits into from May 26, 2013

Conversation

som-snytt
Copy link
Contributor

Some scalac output is on stderr, and it's useful to see that
in the log file, especially for debugging.

Adds a line filter for logs, specified as "filter: pattern"
in the test source.

Backslashes are made forward only when detected as paths.

Test alignments:

Deprecations which do not pertain to the system under test
are corrected in the obvious way.

When testing deprecated API, suppress warnings by deprecating
the Test object.

Check files are updated with useful true warnings, instead of
running under -nowarn.

Language feature imports as required, instead of running under -language.

Language feature not required, such as casual use of postfix.

Heed useful warning.

Ignore broken warnings. (Rarely, -nowarn.)

Debug output from the test required an update.

Review by @khernyo since he originated the issue and has looked at the feature.

@huitseeker
Copy link
Contributor

Isn't this expected to worsen SI-7198 ?

@som-snytt
Copy link
Contributor Author

@huitseeker see the line filter, second line of message. s/worsen/ameliorate/

I broke it at the last second last night by always filtering the log, which both runs the line filter and flips back slashes, which is an old issue Paul had amended and I unamended at some point.

Sorry about that.

@som-snytt
Copy link
Contributor Author

Updated with filters on a handful of tests that produce inliner warnings under -optimise.

It's clear that a better filter mechanism is warranted; that is out of scope here; but probably the test wants a nicer way to express what it wants to assert about its log output (besides equality with check file).

Closer to scope is the ability to ignore all inliner warnings under -optimise (for all tests), but it's not obvious that that is desirable (though it does represent previous behavior).

Some scalac output is on stderr, and it's useful to see that
in the log file, especially for debugging.

Adds a line filter for logs, specified as "filter: pattern"
in the test source.

Backslashes are made forward only when detected as paths.

Test alignments:

Deprecations which do not pertain to the system under test
are corrected in the obvious way.

When testing deprecated API, suppress warnings by deprecating
the Test object.

Check files are updated with useful true warnings, instead of
running under -nowarn.

Language feature imports as required, instead of running under -language.

Language feature not required, such as casual use of postfix.

Heed useful warning.

Ignore broken warnings. (Rarely, -nowarn.)

Inliner warnings pop up under -optimise only, so for now, just
filter them out where they occur.

Debug output from the test required an update.
@som-snytt
Copy link
Contributor Author

You can't see it in the second commit message, but the "--" in the transcript for filtering is yellow to echo the yellow of a skipped test.

Partest will also read files/filters and files/kind/filters for
filter expressions (one per line, trimmed, leading #comments)
which are taken as regexes.

A test/files/filters is provided which attempts to quell HotSpot
warnings; the test for this commit requires it.

The elided lines can be revealed using the lemon juice of verbosity:

apm@mara:~/projects/snytt/test$ ./partest --verbose --show-diff files/run/t7198.scala
[snip]
>>>>> Transcripts from failed tests >>>>>

> partest files/run/t7198.scala
% scalac t7198.scala
[snip]
% filtering t7198-run.log
--Over the moon
--Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve shared memory (errno = 28).

The filtering operation is part of the transcript, which is printed on failure.

No attempt is made to be clever about not slurping the filters file a thousand times.

Previous literal patterns had to be updated because there's parens in them thar strings.

Future feature: pattern aliases, define once globally and invoke in test filters.
@paulp
Copy link
Contributor

paulp commented May 26, 2013

Yow, too much code for paulp to keep up with things. Well, it's partest, it's not like it could be getting any worse. But I will feel a lot better when we spin off partest into a separate component.

@paulp
Copy link
Contributor

paulp commented May 26, 2013

LGTMICRF

paulp added a commit that referenced this pull request May 26, 2013
SI-7003 Partest redirects stderr to log file
@paulp paulp merged commit 970c245 into scala:master May 26, 2013
@som-snytt
Copy link
Contributor Author

We could move it back to a branch of the improving repo.

The partest change is only capture stderr and use filters to cope. I expected someone to say, Will this make it harder to get my tests passing? Yes, it will. Maybe they'll say something when they can't figure out how to make their tests pass the validator.

Maybe I'll update the Par-Test readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants