[flutter_plugin_tool] Fix CHANGELOG validation failure summary (#4266)

The error summary for a CHANGELOG validation failure was written when
the only thing being checked was that the versions matched, but now
there are other ways to fail as well (i.e., leaving NEXT). This fixes
the summary message to be more generic so that it doesn't mislead people
who hit validation failures.

While adding the test for this message, I discovered that almost all of
the tests were actually talking to pub.dev, causing their behavior to in
some cases depend on whether a package with that name happened to have
been published, and if so what its version was. In order to make the
tests hermetic and predictable, this fixes that by making all tests use
a mock HTTP client.
This commit is contained in:
stuartmorgan
2021-08-26 09:10:15 -04:00
committed by GitHub
parent da97a527ad
commit f4a6fc84a4
2 changed files with 26 additions and 42 deletions

View File

@ -178,7 +178,7 @@ class VersionCheckCommand extends PackageLoopingCommand {
if (!(await _validateChangelogVersion(package,
pubspec: pubspec, pubspecVersionChanged: versionChanged))) {
errors.add('pubspec.yaml and CHANGELOG.md have different versions');
errors.add('CHANGELOG.md failed validation.');
}
return errors.isEmpty