diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-09-03 21:49:00 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2022-09-04 11:53:44 +0100 |
commit | e11e759cb1877f52bf696d5f1e0b30f53a50ca4a (patch) | |
tree | b1ddb0b3026ebc52ff597154b6c35041d4aa5345 | |
parent | 42d05da9ea816296623bba686e533fb651825fc8 (diff) |
dgit push: Update tests
Change the global test git config to reject plain "git push".
Update almost all tests to use "push-built".
In some cases, change to using "push-source".
In one case (chosen essentially arbitrarily), use the config override
and continue using push to mean push-built.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
37 files changed, 58 insertions, 64 deletions
@@ -913,7 +913,7 @@ t-commit-build-push-expect-log () { t-commit "$msg" t-dgit build LC_MESSAGES=C \ - t-dgit push --new 2>&1 |tee $tmp/push.log + t-dgit push-built --new 2>&1 |tee $tmp/push.log t-grep-mpat "$mpat" $tmp/push.log } diff --git a/tests/lib-baredebian b/tests/lib-baredebian index 557c051..51beb1f 100644 --- a/tests/lib-baredebian +++ b/tests/lib-baredebian @@ -68,7 +68,8 @@ baredebian-test-core-push () { # (rather than dgit build), but so that we can check that our # output is the same as users are used to. - t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new push + t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new \ + push-built } baredebian-test-core-postpush () { diff --git a/tests/lib-core b/tests/lib-core index 7fdddb4..d4d0bd5 100644 --- a/tests/lib-core +++ b/tests/lib-core @@ -33,6 +33,7 @@ t-set-using-tmp () { git config --global user.email 'dgit-test@debian.example.net' git config --global user.name "$DEBFULLNAME" git config --global protocol.ext.allow always + git config --global dgit.default.push-subcmd reject } t-filter-out-git-hyphen-dir () { diff --git a/tests/lib-orig-include-exclude b/tests/lib-orig-include-exclude index 104cf0b..4372f36 100644 --- a/tests/lib-orig-include-exclude +++ b/tests/lib-orig-include-exclude @@ -29,7 +29,7 @@ test-push-1 () { test-push-2 () { $test_push_2_hook - t-dgit $ch "$@" push + t-dgit $ch "$@" push-built } test-push-1 1.0-2 --ch:-sa diff --git a/tests/setup/examplegit b/tests/setup/examplegit index d25ee95..2d4ce4f 100755 --- a/tests/setup/examplegit +++ b/tests/setup/examplegit @@ -16,7 +16,7 @@ push-to () { t-refs-same-start t-ref-head t-dgit build - t-dgit push --new $2 + t-dgit push-built --new $2 t-pushed-good $1 $2 t-archive-process-incoming $2 } diff --git a/tests/tests/badcommit-rewrite b/tests/tests/badcommit-rewrite index 3e2f37e..f116723 100755 --- a/tests/tests/badcommit-rewrite +++ b/tests/tests/badcommit-rewrite @@ -20,7 +20,7 @@ t-make-badcommit git reset --hard $badcommit t-dgit -wgf build -t-dgit push --overwrite=1.2 stable +t-dgit push-built --overwrite=1.2 stable t-archive-process-incoming stable rstable=refs/remotes/dgit/dgit/stable diff --git a/tests/tests/clone-nogit b/tests/tests/clone-nogit index f36a7b6..9dceafc 100755 --- a/tests/tests/clone-nogit +++ b/tests/tests/clone-nogit @@ -19,8 +19,7 @@ debcommit -a t-refs-same-start t-ref-head -t-dgit --dpkg-buildpackage:-d build -t-dgit push +t-dgit push-source t-pushed-good dgit/sid diff --git a/tests/tests/debpolicy-dbretry b/tests/tests/debpolicy-dbretry index a9f2334..421dee2 100755 --- a/tests/tests/debpolicy-dbretry +++ b/tests/tests/debpolicy-dbretry @@ -20,7 +20,7 @@ git reset --hard HEAD~ t-commit 'Make something to autotaint' t-dgit build -t-dgit push --new +t-dgit push-built --new autotaint=`t-git-get-ref "refs/tags/$tagpfx/$v"` @@ -55,7 +55,7 @@ DGIT_RPD_TEST_DBLOOP_HOOK=' '\'' and die "$? $!"; } ' \ -t-dgit push --deliberately-not-fast-forward +t-dgit push-built --deliberately-not-fast-forward exec 3>&- wait $sqlite3_pid diff --git a/tests/tests/debpolicy-newreject b/tests/tests/debpolicy-newreject index af02ac1..e02abd4 100755 --- a/tests/tests/debpolicy-newreject +++ b/tests/tests/debpolicy-newreject @@ -12,6 +12,8 @@ revision=1 git tag start t-dgit setup-mergechangelogs +git config dgit.default.push-subcmd built + echo FORBIDDEN >debian/some-file git add debian/some-file t-commit 'Commit a forbidden thing' diff --git a/tests/tests/distropatches-reject b/tests/tests/distropatches-reject index 75f43db..00e5edc 100755 --- a/tests/tests/distropatches-reject +++ b/tests/tests/distropatches-reject @@ -64,9 +64,9 @@ build DEB_VENDOR=test-dummy-aside \ expect-fail-distro-series DEB_VENDOR \ -t-dgit push +t-dgit push-built -t-dgit push +t-dgit push-built cd .. perl -i~ -pe 's/^Dgit:.*\n//' incoming/${p}_${v}.dsc diff --git a/tests/tests/dpkgsourceignores-correct b/tests/tests/dpkgsourceignores-correct index 33de95e..f71c3a4 100755 --- a/tests/tests/dpkgsourceignores-correct +++ b/tests/tests/dpkgsourceignores-correct @@ -48,6 +48,6 @@ git add . git commit -m 'want these' t-dgit --quilt=smash -wgf build-source -t-dgit -wgf push +t-dgit -wgf push-built t-ok diff --git a/tests/tests/drs-push-masterupdate b/tests/tests/drs-push-masterupdate index 8457b59..7135467 100755 --- a/tests/tests/drs-push-masterupdate +++ b/tests/tests/drs-push-masterupdate @@ -13,7 +13,7 @@ git tag common-ancestor revision=1 t-dgit build -t-dgit push --new +t-dgit push-built --new push_and_check () { git push $dgitrepo $1 @@ -24,7 +24,7 @@ push_and_check () { git checkout master t-commit 'Empty update' t-dgit build - t-dgit push --new + t-dgit push-built --new t-pushed-good master } diff --git a/tests/tests/gbp-orig b/tests/tests/gbp-orig index 2ac0073..15516c5 100755 --- a/tests/tests/gbp-orig +++ b/tests/tests/gbp-orig @@ -26,7 +26,7 @@ t-dgit -wgf --dgit-view-save=split.b gbp-build --git-ignore-branch t-dgit -wgf --quilt=gbp clean # gbp leaves dirty trees :-/ -t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push --new +t-dgit -wgf --dgit-view-save=split.p --quilt=gbp push-built --new t-gbp-pushed-good diff --git a/tests/tests/gitworktree b/tests/tests/gitworktree index e675a0a..e0f0e0d 100755 --- a/tests/tests/gitworktree +++ b/tests/tests/gitworktree @@ -22,8 +22,6 @@ git add modification git commit -m 'want this' t-dgit -wgf quilt-fixup -t-dgit -wgf --quilt=nofix build - -t-dgit -wgf push +t-dgit -wgf --quilt=nofix push-source t-ok diff --git a/tests/tests/mirror b/tests/tests/mirror index 4aa756b..cedaf56 100755 --- a/tests/tests/mirror +++ b/tests/tests/mirror @@ -17,7 +17,7 @@ t-mirror-setup cd $p revision=1 t-dgit build -t-dgit push --new +t-dgit push-built --new t-check-mirrored diff --git a/tests/tests/mirror-debnewgit b/tests/tests/mirror-debnewgit index 59b96ef..3015d0e 100755 --- a/tests/tests/mirror-debnewgit +++ b/tests/tests/mirror-debnewgit @@ -20,7 +20,7 @@ t-cloned-fetched-good t-commit 'test commit' 3-2 t-dgit build -t-dgit push +t-dgit push-built t-check-mirrored t-ok diff --git a/tests/tests/mirror-private b/tests/tests/mirror-private index 1e885ae..eaf3dad 100755 --- a/tests/tests/mirror-private +++ b/tests/tests/mirror-private @@ -17,8 +17,7 @@ revision=1 t-reporefs master -t-dgit build -t-dgit push --new +t-dgit push-source --new t-check-not-mirrored t-files-notexist $reposmirror/$p.* diff --git a/tests/tests/mismatches-contents b/tests/tests/mismatches-contents index e424016..20bf980 100755 --- a/tests/tests/mismatches-contents +++ b/tests/tests/mismatches-contents @@ -19,6 +19,6 @@ git commit -m "Commit $v" t-dgit build-source t-expect-fail 'debian/TRASH' \ -t-dgit push --new +t-dgit push-built --new t-ok diff --git a/tests/tests/mismatches-dscchanges b/tests/tests/mismatches-dscchanges index 85c7086..e73385e 100755 --- a/tests/tests/mismatches-dscchanges +++ b/tests/tests/mismatches-dscchanges @@ -19,7 +19,7 @@ check () { ../*.$fext t-expect-fail "$emsgpat" \ - t-dgit -wgf push --new + t-dgit -wgf push-built --new } check dsc E:'dpkg-source.*error.*checksum' @@ -29,6 +29,6 @@ check changes E:'dgit.*hash or size.*varies' t-dgit -wgf build-source -t-dgit -wgf push --new +t-dgit -wgf push-built --new t-ok diff --git a/tests/tests/overwrite-chkclog b/tests/tests/overwrite-chkclog index fee2181..35147bc 100755 --- a/tests/tests/overwrite-chkclog +++ b/tests/tests/overwrite-chkclog @@ -13,7 +13,7 @@ t-commit 'No changes, just send to stable' '' stable t-dgit -wgf build t-expect-fail 'Perhaps debian/changelog does not mention' \ -t-dgit push --overwrite stable +t-dgit push-built --overwrite stable t-dgit setup-mergechangelogs @@ -30,7 +30,7 @@ git commit -m 'UNRELEASED changelog' t-dgit -wgf build t-expect-fail E:'Distribution.*is UNRELEASED' \ -t-dgit push --overwrite stable +t-dgit push-built --overwrite stable git revert --no-edit 'HEAD^{/UNRELEASED changelog}' @@ -41,10 +41,10 @@ git add debian/changelog git commit -m 'Break changelog' t-expect-fail 'Perhaps debian/changelog does not mention' \ -t-dgit push --overwrite stable +t-dgit push-built --overwrite stable git revert --no-edit 'HEAD^{/Break changelog}' -t-dgit push --overwrite stable +t-dgit push-built --overwrite stable t-ok diff --git a/tests/tests/overwrite-junk b/tests/tests/overwrite-junk index e11d1f8..978da28 100755 --- a/tests/tests/overwrite-junk +++ b/tests/tests/overwrite-junk @@ -17,6 +17,6 @@ t-dgit -wgf build cd $tmp/git/$p.git; git tag -f $tagpfx/1.2 $tagpfx/1.1 ) -t-dgit push --overwrite=1.2 stable +t-dgit push-built --overwrite=1.2 stable t-ok diff --git a/tests/tests/overwrite-splitbrains b/tests/tests/overwrite-splitbrains index 815c207..6e72c3d 100755 --- a/tests/tests/overwrite-splitbrains +++ b/tests/tests/overwrite-splitbrains @@ -14,12 +14,12 @@ t-refs-same-start t-ref-head t-expect-fail 'maybe --overwrite is needed' \ -t-dgit --quilt=gbp --dgit-view-save=split.p push +t-dgit --quilt=gbp --dgit-view-save=split.p push-built t-refs-same-start t-ref-head -t-dgit --quilt=gbp --dgit-view-save=split.p --overwrite push +t-dgit --quilt=gbp --dgit-view-save=split.p --overwrite push-built t-gbp-pushed-good diff --git a/tests/tests/overwrite-version b/tests/tests/overwrite-version index 34301ac..9925098 100755 --- a/tests/tests/overwrite-version +++ b/tests/tests/overwrite-version @@ -13,8 +13,8 @@ t-commit 'No changes, just send to stable' '' stable t-dgit -wgf build t-expect-fail 'HEAD is not a descendant' \ -t-dgit push stable +t-dgit push-built stable -t-dgit push --overwrite=1.2 stable +t-dgit push-built --overwrite=1.2 stable t-ok diff --git a/tests/tests/pbuilder b/tests/tests/pbuilder index 56eed0b..418c4a4 100755 --- a/tests/tests/pbuilder +++ b/tests/tests/pbuilder @@ -25,7 +25,7 @@ t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" pbuilder -b # RC-buggy in that it doesn't build with -A .. t-dgit -v0 --pbuilder="$troot/pretend-pbuilder" --pbuilder!:--no-source-only-changes pbuilder -t-dgit -wgf push --new +t-dgit -wgf push-built --new t-pushed-good master stable t-pushed-good-check-changes diff --git a/tests/tests/push-buildproductsdir b/tests/tests/push-buildproductsdir index cc1c5e2..ee4b344 100755 --- a/tests/tests/push-buildproductsdir +++ b/tests/tests/push-buildproductsdir @@ -25,7 +25,7 @@ mv $p*_* bpd/ mv bpd/*orig* . cd $p -t-dgit --build-products-dir=../bpd push +t-dgit --build-products-dir=../bpd push-built t-pushed-good dgit/sid diff --git a/tests/tests/push-newpackage b/tests/tests/push-newpackage index 79355e3..ac3aaef 100755 --- a/tests/tests/push-newpackage +++ b/tests/tests/push-newpackage @@ -9,21 +9,21 @@ t-refs-same-start t-ref-head t-expect-push-fail 'package appears to be new in this suite' \ -t-dgit push +t-dgit push-built t-dgit build git checkout bogus set +e -(set -e; DGIT_TEST_DEBUG=' ' t-dgit push --new) +(set -e; DGIT_TEST_DEBUG=' ' t-dgit push-built --new) rc=$? set -e if [ $rc = 0 ]; then fail "push succeeded when tree mismatch"; fi git checkout master -t-dgit push --new +t-dgit push-built --new t-pushed-good master diff --git a/tests/tests/push-newrepeat b/tests/tests/push-newrepeat index 048dfd2..88f4462 100755 --- a/tests/tests/push-newrepeat +++ b/tests/tests/push-newrepeat @@ -14,8 +14,8 @@ t-dgit --quilt=smash build-source t-expect-fail E:'Push failed, while updating the remote git repository' \ t-dgit -cdgit-distro.test-dummy.git-url=file:///dev/enoent/fail \ - push --new + push-built --new -t-dgit push --new --force-reusing-version +t-dgit push-built --new --force-reusing-version t-ok diff --git a/tests/tests/push-nextdgit b/tests/tests/push-nextdgit index d0436ab..4494231 100755 --- a/tests/tests/push-nextdgit +++ b/tests/tests/push-nextdgit @@ -18,7 +18,7 @@ t-refs-same-start t-ref-head t-dgit --dpkg-buildpackage:-d build -t-dgit push +t-dgit push-source t-pushed-good dgit/sid diff --git a/tests/tests/quilt b/tests/tests/quilt index f26f744..06b646c 100755 --- a/tests/tests/quilt +++ b/tests/tests/quilt @@ -25,7 +25,7 @@ iteration () { t-refs-same-start t-dgit --dpkg-buildpackage:-d build - t-dgit push + t-dgit push-built t-pushed-good dgit/sid } diff --git a/tests/tests/quilt-gbp b/tests/tests/quilt-gbp index 4dc597d..e1e53c8 100755 --- a/tests/tests/quilt-gbp +++ b/tests/tests/quilt-gbp @@ -45,7 +45,7 @@ test-push-1 () { } test-push-2 () { - t-dgit --quilt=gbp --dgit-view-save=split.p push + t-dgit --quilt=gbp --dgit-view-save=split.p push-built t-gbp-pushed-good } @@ -55,7 +55,7 @@ test-push-1 t-dgit --quilt=gbp --clean=git --dgit-view-save=split.b build-source t-expect-fail "HEAD specifies a different tree to $p" \ - t-dgit push + t-dgit push-built test-push-2 diff --git a/tests/tests/quilt-singlepatch b/tests/tests/quilt-singlepatch index 9c03595..68982a2 100755 --- a/tests/tests/quilt-singlepatch +++ b/tests/tests/quilt-singlepatch @@ -24,7 +24,7 @@ t-ref-head t-dgit -wgf build-source -t-dgit push +t-dgit push-built t-pushed-good dgit/sid diff <<END - debian/patches/series @@ -40,6 +40,6 @@ git apply --reverse debian/patches/debian-changes git commit -a -m 'go back to plain upstream' t-dgit -wgf build-source -t-dgit --damp-run --force-reusing-version push +t-dgit --damp-run --force-reusing-version push-built t-ok diff --git a/tests/tests/quilt-splitbrains b/tests/tests/quilt-splitbrains index f8d8091..1940410 100755 --- a/tests/tests/quilt-splitbrains +++ b/tests/tests/quilt-splitbrains @@ -26,7 +26,7 @@ want-success () { t-dgit "$@" --quilt=$qmode --dgit-view-save=split.b build-source - t-dgit "$@" --quilt=$qmode --dgit-view-save=split.p push + t-dgit "$@" --quilt=$qmode --dgit-view-save=split.p push-built t-$qmode-pushed-good $suite } @@ -101,7 +101,7 @@ t-dgit --quilt=unapplied build-source t-dgit --quilt=nofix build-source t-refs-same-start t-ref-head -t-dgit --quilt=nofix push +t-dgit --quilt=nofix push-built t-pushed-good-core diff --git a/tests/tests/sourceonlypolicy b/tests/tests/sourceonlypolicy index b0569c3..ec365a6 100755 --- a/tests/tests/sourceonlypolicy +++ b/tests/tests/sourceonlypolicy @@ -29,7 +29,7 @@ t-commit 'Now with binaries' t-dgit -wgf build t-expect-fail E:'uploading binaries.*source only' \ -dgit-with-policy always push --new +dgit-with-policy always push-built --new t-commit 'Source-only not NEW' diff --git a/tests/tests/tag-updates b/tests/tests/tag-updates index 824fd1e..7a17a8b 100755 --- a/tests/tests/tag-updates +++ b/tests/tests/tag-updates @@ -7,8 +7,7 @@ t-prep-newpackage example 1.0 cd $p revision=1 -t-dgit build -t-dgit push --new +t-dgit push-source --new tagref=`t-v-tag` tagname=${tn#refs/tags} diff --git a/tests/tests/trustingpolicy-replay b/tests/tests/trustingpolicy-replay index a2d280d..8ebeb2c 100755 --- a/tests/tests/trustingpolicy-replay +++ b/tests/tests/trustingpolicy-replay @@ -16,18 +16,15 @@ cd $p revision=1 git tag start -t-dgit build -t-dgit push --new +t-dgit push-source --new t-rm-dput-dropping t-commit 'Prep v1.1 which will be rewound' -t-dgit build -t-dgit push +t-dgit push-source git checkout $tagpfx/1.0 -t-dgit build -t-dgit push --deliberately-fresh-repo --force-reusing-version +t-dgit push-source --deliberately-fresh-repo --force-reusing-version remote="`git config dgit-distro.test-dummy.git-url`/$p.git" @@ -53,7 +50,7 @@ prepare-replay () { t-commit "request with $delib that we will replay" t-dgit build t-expect-push-fail 'system: No such file or directory' \ - t-dgit push $delib + t-dgit push-source $delib t-policy dgit-repos-policy-trusting @@ -79,8 +76,7 @@ attempt-replay 'does not declare previously heads/for-testing' prepare-replay --deliberately-not-fast-forward t-commit 'later version to stop not fast forward rewinding' -t-dgit build -t-dgit push +t-dgit push-source attempt-replay "does not declare previously tags/$tagpfx/$v" diff --git a/tests/tests/unrepresentable b/tests/tests/unrepresentable index 76dfdaf..8f451aa 100755 --- a/tests/tests/unrepresentable +++ b/tests/tests/unrepresentable @@ -32,7 +32,7 @@ build-source () { t-dgit --quilt=nofix -wgf build-source } run-push () { - t-dgit -wgf --dry-run push --new + t-dgit -wgf --dry-run push-built --new } badly-raw () { wrongmsg=$1 diff --git a/tests/tests/version-opt b/tests/tests/version-opt index 2933912..fff9a4d 100755 --- a/tests/tests/version-opt +++ b/tests/tests/version-opt @@ -13,8 +13,7 @@ revision=1 git tag start t-dgit setup-mergechangelogs -t-dgit build-source -t-dgit push --new --overwrite +t-dgit push-source --new --overwrite t-archive-process-incoming sid |