TravisCI: Test and lint latest version modules. #1776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current approach of the CI tests of specifying the path to the directory that contains the module only tests version 1 of the module despite there being newer version available. The same is true for the lints.
This resolves the test portion by obtaining a list of all modules required by the root go.mod file and providing the entire module path, which includes the version, to the go test command instead of the
directory.
Unfortunately, the linter does not recognize full module paths, however it will lint the latest module version from within the module directory itself, so this resolves the linting case by stripping the full module path and version down to the directory and changing into the directory to perform the lint checks.
It also contains two additional commits which correct newly discovered lint errors discovered by running them against the new version modules and to add requires for newer module versions that are not yet fully integrated to the main
go.mod
file along with a new file with a build tag to ignore it which imports those modules to preventgo mod tidy
from removing the otherwise unused entries.