-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: fix diagnostic assertions in our tests
This uber PR contains a number of changes to our testscript tests: * Drop all errlogmatch's looking for assertions where we really should not need them. Historically we needed these because the threading model of gopls was a bit broken. i.e. despite us notifying of a change to a file, unless we waited for diagnostics to be available then we couldn't guarantee that, for example, completions would be correct * Fix up all go.mod files to include go directives so that we don't fall foul of golang/go#36144 * Where we do require errlogmatch's, make sure we follow the existing semantics per golang/go#36243 and golang/go#36340 * Fix up some scripts so that we don't have initial errors in the file and hence don't need to soak up initial diagnostics * Use sleep $DEFAULT_ERRLOGMATCH_WAIT where we expect there to be no diagnostic errors * Only use errlogmatch on diagnostic publications where we need to know that a file has been opened, e.g. file watching, or where we need to soak up initial diagnostic notifications (see golang/go#36243) * Move all commented-out errlogmatch commands matching on the number of errors to the end of each script. We still can't enable these Add some initial tests that help to verify our expectations around diagnostics being published by gopls. Set GOPATH and GOCACHE consistently for the install testscript scripts to speed them up. Call t.Parallel in a couple of places to speed up the entire test run. Add a test (that is skipped) which capture the essence of golang/go#36144.
- Loading branch information
Showing
54 changed files
with
313 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
cmd/govim/testdata/scenario_caseinsensitivecompletion/no_fuzzy_no_deep.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# A test that causes a failure similar to the scenario described by: | ||
# https://github.com/golang/go/issues/36144. This is marked as "skip" because | ||
# otherwise we would continually break the govim build. The issue has been | ||
# reported, its implications and severity are known, so there is no value in | ||
# having a red CI build. | ||
# | ||
# What's critical here is that the go.mod file is incomplete; it is missing | ||
# the go directive. Hence on the initial load that file gets changed, which | ||
# triggers a file watcher event in govim, which triggers a recalculation of | ||
# diagnostics when the go.mod file is changed, which sometimes causes a | ||
# cancellation of the initial diagnostics for the package, or the diagnostics | ||
# that are sent when a file is opened. | ||
|
||
skip 'Known issue reported as https://github.com/golang/go/issues/36144' | ||
|
||
vim ex 'e main.go' | ||
errlogmatch 'PublishDiagnostics callback: &protocol.PublishDiagnosticsParams{\n\S+:\s+URI:\s+"file://'$WORK/main.go | ||
|
||
-- go.mod -- | ||
module mod.com | ||
|
||
-- main.go -- | ||
package main | ||
|
||
func main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.