-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/build/cmd/coordinator: reduce nesting in buildStatus.runSubrepoTests #34247
Comments
Change https://golang.org/cl/195277 mentions this issue: |
Change https://golang.org/cl/195278 mentions this issue: |
Edit: Moved this comment to the right issue, see #32528 (comment). |
A more robust alternative is to copy (or symlink) the testdata into a temporary directory and drop in the |
@bcmills I'm aware that go.mod files in testdata directories create module boundaries. I've discussed it with @ianthehat and we concluded that such modules have module paths unsuitable for external use. No one should require the module with the module path |
Yeah, the problem is not those modules themselves — the problem is that the tests for the parent module will fail when run from within any other module (because their testdata is missing), which implies that a user of (say) |
That's a fair point. But I think that's a problem that needs to be addressed by the module authors themselves. The scope of this issue is about increasing the test coverage of golang.org/x repos to include supported nested modules in addition to the module at the root. Doing additional work to test that modules can be tested successfully without the rest of the git repository contents should be a separate issue. |
Or, to put it another way: ignoring the We should probably set up builders for all of the |
Agreed. I thought we had an issue filed for that, but I can't find it — do you happen to recall one way or the other? |
I haven't seen such an issue. |
Also, I should clarify, what I meant there was "as intended". It's not that one way or another is correct, there are different testing strategies with trade-offs. What I observed was that the change I made to coordinator was working as intended. |
The code to fetch golang.org/x/* dependencies has become deeply nested after additional logic and complexity has been added to runSubrepoTests, making it harder to read, maintain, and be confident in. Factor it out into a dedicated and well documented method. This CL is a pure refactor. The next CL will make changes to simplify the dependency fetching logic, which becomes easer after it has been factored out. Also factor out the code to concatenate multiple errors from runSubrepoTests into a helper multiError type, and simplify path.Join("go", "bin", "go") to a constant "go/bin/go". Fixes golang/go#34247 Change-Id: I4b5775408056723e2e5ab9a84776a11f5069d58a Reviewed-on: https://go-review.googlesource.com/c/build/+/195277 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
As part of working on resolving issues #32528, #30233, and #34190, I've made incremental changes to the
runSubrepoTests
method with the goal of keeping each diff minimal and easy to be confident in. By the end, the method has become quite large as it now deals with both module and GOPATH modes, with local variables spanning large parts of the code.I've attempted to factor out parts of the method into smaller pieces in CL 194684, but in the short time I had, couldn't get to an outcome that was an improvement. Part of the problem was the difficulty of creating helpers methods due to dual-error return pattern that's prevalent. That's issue #34246, it probably needs to be tackled before or at the same time as this.
/cc @bradfitz @andybons
The text was updated successfully, but these errors were encountered: