[kgb-maintainers] Bug#834597: kgb-bot: FTBFS in testing
gregor herrmann
gregoa at debian.org
Wed Aug 17 21:36:51 UTC 2016
On Wed, 17 Aug 2016 20:34:04 +0200, gregor herrmann wrote:
> When builing from what we have in git, I get even more errors in the
> test suite:
>
> #v+
> Test Summary Report
> -------------------
> t/50-client.t (Wstat: 256 Tests: 31 Failed: 1)
> Failed test: 31
> Non-zero exit status: 1
> t/52-client-git.t (Wstat: 65024 Tests: 68 Failed: 0)
> Non-zero exit status: 254
> Parse errors: No plan found in TAP output
> t/54-client-git-squash.t (Wstat: 256 Tests: 13 Failed: 1)
> Failed test: 13
> Non-zero exit status: 1
> t/55-client-git-merges-ff.t (Wstat: 256 Tests: 14 Failed: 1)
> Failed test: 14
> Non-zero exit status: 1
> t/56-client-git-ff-merge-2.t (Wstat: 256 Tests: 15 Failed: 1)
> Failed test: 15
> Non-zero exit status: 1
> t/57-client-git-squash-tags.t (Wstat: 256 Tests: 9 Failed: 1)
> Failed test: 9
> Non-zero exit status: 1
> Files=16, Tests=263, 17 wallclock secs ( 0.10 usr 0.01 sys + 13.37 cusr 1.71 csys = 15.19 CPU)
> Result: FAIL
> Failed 6/16 test programs. 5/263 subtests failed.
> #v-
Ok, this is caused by ade2ca5.
If I uncomment two new lines:
#v+
@@ -814,8 +814,8 @@ sub format_message {
$p{commit_id} = $commit->id if ($commit->id);
$p{log} = $commit->log if ($commit->log);
}
- $p{author_name} ||= $p{author_login};
- $p{author_login} ||= $p{author_name};
+# $p{author_name} ||= $p{author_login};
+# $p{author_login} ||= $p{author_name};
if (defined($self->module)) {
$p{module} = $self->module;
} elsif ($commit and defined($commit->module)) {
#v-
we're back to "only" t/52-client-git.t failing.
But that's maybe not what we want? :)
t/52-client-git.t works in testing but not in unstable. Maybe the
newer git version?
The test ends with
fatal: независими истории не може да се слеят
merge allnew: command returned error: 128
# stopping test bot, pid 22605
# Removing directory /build/kgb-bot-1.33/t/bot
# Tests were run but no plan was declared and done_testing() was not seen.
t/52-client-git.t ..............
[..]
ok 68
Dubious, test returned 254 (wstat 65024, 0xfe00)
In the code we have
367 TestBot->expect( '#test ^C03Test U. Ser^O (^C03ser^O) ^C05allnew^O '
368 . $commit->id
369 . ' ^C12test^O/^C06there^O created empty branch allnew * ^C14http://scm.host.org/there/allnew/?commit='
370 . $commit->id
371 . '^O' );
372
373 ##### No more commits after the last
374 $commit = $c->describe_commit;
375 is( $commit, undef );
376
377 # now the same on the master branch
378 $git->command( [ 'checkout', '-q', 'master' ], { STDERR => 0 } );
379 $git->command( 'merge', 'allnew' );
380 push_ok();
381 $c2 = $commit = $c->describe_commit;
382 ok( defined($commit), 'empty branch merge commit exists' );
Test 68 which passes is line 375, and the next test at 382 is not
reached. According to the error above, the problem happens in 379.
The "fatal" line in English:
fatal: refusing to merge unrelated histories
This looks interesting: /usr/share/doc/git/RelNotes/2.9.0.txt
Merging two branches that have no common ancestor with "git merge" is
by default forbidden now to prevent creating such an unusual merge by
mistake.
* "git merge" used to allow merging two branches that have no common
base by default, which led to a brand new history of an existing
project created and then get pulled by an unsuspecting maintainer,
which allowed an unnecessary parallel history merged into the
existing project. The command has been taught not to allow this by
default, with an escape hatch "--allow-unrelated-histories" option
to be used in a rare event that merges histories of two projects
that started their lives independently.
And from git-merge(1):
--allow-unrelated-histories
By default, git merge command refuses to merge histories that do not share a common ancestor. This option
can be used to override this safety when merging histories of two projects that started their lives
independently. As that is a very rare occasion, no configuration variable to enable this by default exists
and will not be added.
A quick hotfix would be:
#v+
--- a/t/52-client-git.t
+++ b/t/52-client-git.t
@@ -376,7 +376,13 @@ is( $commit, undef );
# now the same on the master branch
$git->command( [ 'checkout', '-q', 'master' ], { STDERR => 0 } );
-$git->command( 'merge', 'allnew' );
+my $gitversion = Git::command_oneline('version');
+$gitversion =~ s/^git version\s*//;
+if ( $gitversion ge '2.9.0' ) {
+ $git->command( 'merge', 'allnew', '--allow-unrelated-histories' );
+} else {
+ $git->command( 'merge', 'allnew' );
+}
push_ok();
$c2 = $commit = $c->describe_commit;
ok( defined($commit), 'empty branch merge commit exists' );
#v-
With this change the test passes in sid and stretch (ignoring the
fact that this version extraction and comparison attempt is ugly at
best). Do we need this test?
Cheers,
gregor
--
.''`. Homepage https://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
: :' : Debian GNU/Linux user, admin, and developer - https://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Bruce Springsteen: The River
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: Digital Signature
URL: <http://lists.alioth.debian.org/pipermail/kgb-maintainers/attachments/20160817/7e86e52b/attachment-0001.sig>
More information about the kgb-maintainers
mailing list