Skip to content

Add Go repository compiler tests, triage known failures. #296

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

Merged
merged 1 commit into from
Sep 7, 2015

Conversation

dmitshur
Copy link
Member

@dmitshur dmitshur commented Sep 7, 2015

Add a modified version of go/test/run.go for GopherJS. The run.go file should be run via native Go, but it will itself invoke gopherjs run for running tests. All modifications are marked with a "// GOPHERJS" comment.

At this time, only a limited subset of folders and test types is supported. More can be added.

Within the tests that are run, there are currently 234 tests passing and 34 failing. The failing test are marked as known failures and do not trigger CI failure.

As the bugs are resolved, the knownFails map in run.go should be updated to remove resolved failures. The test will currently fail if any of the tests that were expected to fail unexpectedly pass (if it's not an accident, then knownFails map should be updated accordingly). I hope this will not cause too much noise; it can be changed if so.

Four of the tests are compiler panics, they should probably be fixed first. The remaining ones are briefly described but not triaged further than that.

The run.go test runner can be run manually via:

go run run.go -v -summary

Or to include known fails full error messages:

go run run.go -v -summary -show_known_fails

@dmitshur
Copy link
Member Author

dmitshur commented Sep 7, 2015

So, one thing to figure out, the current output is very verbose. With -v flag, the run.go runner outputs all failures. That is great when trying to fix them. But maybe not so great otherwise.

I've made it so that go test -v will print all known failures, but without -v it will not. The thing is that the CI test currently uses go test -v. Maybe I'll add a new flag to the runner for CI to activate, so it won't print known failures to stdout? @neelance, let me know which you prefer.

If we're going to actively and quickly fix all the issues, maybe keeping verbose output is okay.

@dmitshur
Copy link
Member Author

dmitshur commented Sep 7, 2015

I'll push a new commit with non-verbose output for CI; let me know which you like better.

@dmitshur
Copy link
Member Author

dmitshur commented Sep 7, 2015

Okay, compare overly-verbose output (with full error output for known failures), previously:

https://circleci.com/gh/gopherjs/gopherjs/564

Versus the updated verbose output (just a list of tests and their statuses):

https://circleci.com/gh/gopherjs/gopherjs/565

I think the new version is much better. If you want to run the test runner manually and see full error details for known failures, just use -show_known_fails flag:

go run run.go -summary -v -show_known_fails

This way, only deviations in status (previously succeeding tests failing, known failures suddenly succeeding, etc.) will print their full details. Otherwise it's just 1 line per test run, which seems reasonable for go test -v.

@dmitshur
Copy link
Member Author

dmitshur commented Sep 7, 2015

Everything here is ready from my side. I think after you review it @neelance, it may be better to squash into 1 commit, then merge.


goroutine 1 [running]:
github.com/gopherjs/gopherjs/compiler.(*funcContext).fixNumber(0xc820164210, 0xc82000f360, 0x9088a0, 0xc820018ea0)
/Users/Dmitri/Dropbox/Work/2013/GoLand/src/github.com/gopherjs/gopherjs/compiler/expressions.go:1176 +0x235
Copy link
Member

Choose a reason for hiding this comment

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

Absolute paths?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but it's just a description of the error. I copy pasted the first line/few lines of the panic output here.

Ideally, these descriptions can be replaced with more accurate ones if someone goes through them and triages the issues carefully.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 44bb9b5 anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Let's at least make them a bit more pretty by making the paths relative to project root and removing all those pointer values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, didn't see this comment. I agree, let's make the descriptions nicer in a followup commit.

Although I find it I end up just trying to investigate and fix the bug if possible right away... E.g., #298.

@neelance
Copy link
Member

neelance commented Sep 7, 2015

LGTM

Add a modified version of go/test/run.go for GopherJS. The run.go file
should be run via native Go, but it will itself invoke `gopherjs run`
for running tests. All modifications are marked with a "// GOPHERJS"
comment.

At this time, only a limited subset of folders and test types is
supported. More can be added.

Within the tests that are run, there are currently 234 tests passing
and 34 failing. The failing test are marked as known failures and do
not trigger CI failure.

As the bugs are resolved, the knownFails map in run.go should be
updated to remove resolved failures. The test will currently fail if
any of the tests that were expected to fail unexpectedly pass (if it's
not an accident, then knownFails map should be updated accordingly). I
hope this will not cause too much noise; it can be changed if so.

Four of the tests are compiler panics, they should probably be fixed
first. The remaining ones are briefly described but not triaged further
than that.

The run.go test runner can be run manually via:

	go run run.go -v -summary

Or to include known fails full error messages:

	go run run.go -v -summary -show_known_fails

Add fixedbugs/issue10607.go to known failures.

It cannot run because it uses os/exec. This test is meaningless anyway
because it tests native go compiler linking modes.

Remove unneeded TODOs.

Don't output details of known test failures unless show_known_fails flag
is on.

This makes normal verbose output much more readable and suitable for CI.

Change TestGoRepositoryCompilerTests to stream output as it runs.

Previously, it would only display all of output when it finished.

Fix issue where specifying specific test to run failed to run it.

It was because filepath.Split left a trailing slash after dir, so
"fixedbugs/" != "fixedbugs". Use filepath.Clean on input t.dir to
resolve this.

Always display known fails details if -show_known_fails flag is on
(even without -v).

Previously, both -v and -show_known_fails had to be on.

Also tweak the reproduce command printed to include -show_known_fails
flag, since it's needed.

Remove absolute paths from known fails descriptions.
@dmitshur
Copy link
Member Author

dmitshur commented Sep 7, 2015

Squashed into 1 commit, merging.

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