Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit b9dc372

Browse files
committed
chore(travis): fail jobs that have a mismatched pubspec.lock
We expect that, for a clean checkout, running "pub get" will not update the pubspec.lock file. Any such updates should have been made along with the corresponding change to pubspec.yaml or must be part of the commit being tested. Otherwise, that specific job should fail so the author can resubmit with the updated pubspec.lock file.
1 parent f9cf915 commit b9dc372

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/travis/setup.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,22 @@ fi
2424
echo =============================================================================
2525
. ./scripts/env.sh
2626
$DART --version
27+
PUBSPEC_HASH=$(shasum pubspec.lock)
2728
$PUB install
29+
if [[ $(shasum pubspec.lock) != "$PUBSPEC_HASH" ]]; then
30+
if [ "$USE_G3" = "YES" ]; then
31+
echo ERROR: This commit causes pubspec.lock for g3v1x to change. g3v1x
32+
echo uses dependency overrides to tests against specific versions of packages.
33+
echo Please ensure that these updated packages are available for g3v1x, update
34+
echo the dependency overrides and the pubspec.lock for g3v1x and push that. You
35+
echo may test this job again after that. Until then, this is considered a
36+
echo failure for the USE_G3=YES jobs.
37+
else
38+
echo ERROR: This commit causes pubspec.lock to change. Please include the
39+
echo pubspec.lock changes in this commit and re-run this test.
40+
fi
41+
exit 1
42+
fi
2843

2944
# Record dart version for tests.
3045
echo $'import "dart:js";\n\nmain() {\n context["DART_VERSION"] = \''"$($DART --version 2>&1)"$'\';\n}' > test/dart_version.dart

0 commit comments

Comments
 (0)