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

cmd/go: convert tests using testdata files to script framework #36320

Open
matloob opened this issue Dec 30, 2019 · 63 comments
Open

cmd/go: convert tests using testdata files to script framework #36320

matloob opened this issue Dec 30, 2019 · 63 comments
Labels
Milestone

Comments

@matloob
Copy link
Contributor

@matloob matloob commented Dec 30, 2019

I'd like to convert the cmd/go tests using testdata/src as their GOPATH to the script framework. We don't run those tests in parallel because we don't want concurrent go command runs started by the tests using the same GOPATH. While we can modify the test framework to copy the testdata files to a isolated temp directory GOPATH for those tests, I think it's simpler to just convert those tests to the script framework, and that has the additional benefit that we keep the test logic and data together in the same files making the tests easier to read.

@matloob matloob added the Testing label Dec 30, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212877 mentions this issue: cmd/go: convert TestIssue17119 to the script test framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212878 mentions this issue: cmd/go: convert TestGoGenerateBadImports to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212879 mentions this issue: cmd/go: convert TestRunPkg to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212811 mentions this issue: cmd/go: convert TestCoverageImportMainLoop and TestGoTestMain

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212812 mentions this issue: cmd/go: convert TestGoBuildNotMain to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212813 mentions this issue: cmd/go: convert TestIssue7108 to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212814 mentions this issue: cmd/go: convert TestRunInternal to the script test framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212815 mentions this issue: cmd/go: convert TestCoveragePattern to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212816 mentions this issue: cmd/go: convert tests using testdata/src/syntaxerror to scripts

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 30, 2019

Change https://golang.org/cl/212937 mentions this issue: cmd/go: convert TestGoTestDetectsTestOnlyImportCycles to script

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 31, 2019

Change https://golang.org/cl/212939 mentions this issue: cmd/go: convert TestGoTestImportErrorStack to the script framework

@cagedmantis cagedmantis added this to the Backlog milestone Jan 2, 2020
@cagedmantis cagedmantis added the NeedsFix label Jan 2, 2020
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 2, 2020

Change https://golang.org/cl/213126 mentions this issue: cmd/go: convert TestListTests to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 2, 2020

Change https://golang.org/cl/213127 mentions this issue: cmd/go: convert TestGoTestWithoutTests to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 2, 2020

Change https://golang.org/cl/213128 mentions this issue: cmd/go: convert tests using testdata/src/testrace to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 2, 2020

Change https://golang.org/cl/213130 mentions this issue: cmd/go: convert TestTestRegexps to the script framework

gopherbot pushed a commit that referenced this issue Jan 3, 2020
This includes TestMatchesNoTestsDoesNotOverrideBuildFailure
and TestErrorMessageForSyntaxErrorInTestGoFileSaysFAIL.
Convert the tests that use the testdata/src/syntaxerror directory
to the script framework.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I2b2b616e8c124996ae8c8e5b737f15bb493ec588
Reviewed-on: https://go-review.googlesource.com/c/go/+/212816
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 3, 2020
The error that's tested in this test is also tested in list_test_err.txt
which uses go list -test -deps. Because both commands are just loading
packages, the difference is not meaningful.

Updates #36320
Updates #17751

Change-Id: Ie712a77d64e8985dd908a1afb515ed3ecc0a9985
Reviewed-on: https://go-review.googlesource.com/c/go/+/212937
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 3, 2020
This test already runs in parallel, but still convert it to the
script framework so we can delete the testdata/src directory and
remove any ambiguity about which tests can run in parallel.

Updates #36320

Change-Id: I6470979bd8bad0631dc6ead0d4eb9c83878356e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/212815
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 3, 2020
This conversion is a bit weird, because the original test runs in the cmd/go
directory, while the script test runs in the GOPATH directory. So even though
it's not necessary for the new test, it changes dircectory to $WORK, so that
its error message regexp can have four components like the original, just
changing the old gopath directory 'testdata' the new one 'gopath'.

Part of converting all tests to script framework to improve test parallelism.

Updates #36320
Updates #17751

Change-Id: Ie5b029c43dc22167278d3104b37c0b57c61326be
Reviewed-on: https://go-review.googlesource.com/c/go/+/212814
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 3, 2020
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Icd62dc8db55bec52ad326bc370ee7e435aae2559
Reviewed-on: https://go-review.googlesource.com/c/go/+/212812
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 3, 2020
The literal string match had to be turned into a regexp, otherwise
pretty straightforward.

Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: I46f62312f02dc9adf83ed91c6f807420d29fbb12
Reviewed-on: https://go-review.googlesource.com/c/go/+/212939
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 3, 2020

Change https://golang.org/cl/213219 mentions this issue: cmd/go: rewrite tests using testdata/example[12]_test.go to scripts

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 3, 2020

Change https://golang.org/cl/213220 mentions this issue: cmd/go: remove tests using testdata/flag_test.go

gopherbot pushed a commit that referenced this issue Jan 6, 2020
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Ic16a0c6c1eabeba003b9cff620e2911078fd6cf8
Reviewed-on: https://go-review.googlesource.com/c/go/+/212813
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 6, 2020
Part of the effort to convert all non-parallel cmd/go tests to the script
framework.

Updates #17751
Updates #36320

Change-Id: I2bc0b1e5c03e2c49b5c79ac24a908a202840d5d4
Reviewed-on: https://go-review.googlesource.com/c/go/+/212879
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 6, 2020
Part of converting all tests to script framework to improve
test parallelism.

Updates #36320
Updates #17751

Change-Id: Id1afafad2063d917fd55e08f0725ce3e93201c35
Reviewed-on: https://go-review.googlesource.com/c/go/+/212878
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
gopherbot pushed a commit that referenced this issue Jan 6, 2020
It's already parallel, but we might as well convert it and
get rid of the testdata/src dircetory completely.

Updates #36320

Change-Id: I75e335b32d64a8ddedd65e4337949b729c9e0fbe
Reviewed-on: https://go-review.googlesource.com/c/go/+/212877
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 8, 2020

Change https://golang.org/cl/213877 mentions this issue: cmd/go: convert TestGoGetInsecure to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 9, 2020

Change https://golang.org/cl/214117 mentions this issue: cmd/go: convert two go get tests to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 9, 2020

Change https://golang.org/cl/214119 mentions this issue: cmd/go: convert TestGoTestJSON to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 9, 2020

Change https://golang.org/cl/214138 mentions this issue: cmd/go: convert tests using testdata/src/(exclude|empty) to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 9, 2020

Change https://golang.org/cl/214141 mentions this issue: cmd/go: convert some go get tests to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 9, 2020

Change https://golang.org/cl/214218 mentions this issue: cmd/go: convert some vet tests to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 9, 2020

Change https://golang.org/cl/214158 mentions this issue: cmd/go: convert TestLegacyModGet to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214284 mentions this issue: cmd/go: convert tests using testdata/src/(xtestonly|cgotest) to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214285 mentions this issue: cmd/go: convert TestGoTest(Cpu|Mutex)profile.* to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214288 mentions this issue: cmd/go: convert TestSymlink* to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214291 mentions this issue: cmd/go: convert TestCoverageRuns to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214292 mentions this issue: cmd/go: convert TestIssue6480 to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214296 mentions this issue: cmd/go: convert TestBadCgoDirectives to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214295 mentions this issue: convert TestGoBuildOutput to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214382 mentions this issue: cmd/go: convert remaining non-parallel tooSlow to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214388 mentions this issue: cmd/go: convert TestDotDotDotOutsideGOPATH to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214387 mentions this issue: cmd/go: convert TestBuildIDContainsArchModeEnv to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214390 mentions this issue: cmd/go: convert TestIssue12096 to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 10, 2020

Change https://golang.org/cl/214391 mentions this issue: cmd/go: convert TestPackageNotStaleWithTrailingSlash to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214425 mentions this issue: cmd/go: convert TestGoBuildARM to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214423 mentions this issue: cmd/go: convert TestGoTestBuildsAnXtestContainingOnly... to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214426 mentions this issue: cmd/go: convert TestGoTestRaceInstallsCgo to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214427 mentions this issue: cmd/go: convert TestBuildDryRunWithCgo to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214424 mentions this issue: cmd/go: convert TestIssue11709 to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214429 mentions this issue: convert TestVersionControlErrorMessageIncludesCorrectDirectory to script test

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214428 mentions this issue: cmd/go: convert TestRelativeGOBINFail to script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214431 mentions this issue: cmd/go: convert TestShadowingLogic to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214432 mentions this issue: cmd/go: convert TestGoBuildGOPATHOrder to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214579 mentions this issue: cmd/go: convert TestLinkXImportPathEscape to the script framework

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 13, 2020

Change https://golang.org/cl/214578 mentions this issue: cmd/go: convert testCDAndGOPATHAreDifferent to the script framework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.