"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got-build-regress.sh regress failure
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 12 May 2023 11:21:05 +0200

Download raw body.

Thread
On Fri, May 12, 2023 at 08:52:11AM +0200, Omar Polo wrote:
> On 2023/05/12 02:23:41 +0200, op@omarpolo.com wrote:
> > got-build-regress.sh for branch 'main' on Thu May 11 22:52:04 UTC 2023
> > ==== blame ====
> > ./blame.sh -q -r "/home/chiaki/tmp/"
> > --- /home/chiaki/tmp/got-test-blame_lines_shifted_skip-GNo0yqyF/stdout.expected	Fri May 12 02:00:02 2023
> > +++ /home/chiaki/tmp/got-test-blame_lines_shifted_skip-GNo0yqyF/stdout	Fri May 12 02:00:02 2023
> > @@ -1,7 +1,7 @@
> >  1) bf95b035 2023-05-12 flan_hac X
> > -2) 651369cc 2023-05-12 flan_hac A
> > -3) 651369cc 2023-05-12 flan_hac B
> > -4) 651369cc 2023-05-12 flan_hac C
> > +2) 651369cc 2023-05-11 flan_hac A
> > +3) 651369cc 2023-05-11 flan_hac B
> > +4) 651369cc 2023-05-11 flan_hac C
> >  5) 49e4886b 2023-05-12 flan_hac P
> >  6) 3e4f48d1 2023-05-12 flan_hac Y
> >  7) 49e4886b 2023-05-12 flan_hac Q
> > test failed; leaving test data in /home/chiaki/tmp/got-test-blame_lines_shifted_skip-GNo0yqyF
> > *** Error 1 in regress/cmdline (Makefile:31 'blame')
> > FAILED
> 
> Did it failed because too close to midnight?  (italy is in CEST right
> now, i.e. UTC+2)
> 
> if so, sorry for the noise!  I'll change the regress schedule to avoid
> running close to UTC midnight.

I would keep the schedule as-is because you found a bug in this test case.

This test case assumes that all commits have an identical author timestamp.
The patch below should fix this.

diff /home/stsp/src/got
commit - ba0bed23e515b14cd3fe877c6847785c8c29971e
path + /home/stsp/src/got
blob - 2c121a047d8340ad0c16b6b008bc82fe3d7277eb
file + regress/cmdline/blame.sh
--- regress/cmdline/blame.sh
+++ regress/cmdline/blame.sh
@@ -908,7 +908,7 @@ EOF
 	(cd $testroot/wt && got commit -m "change 1" > /dev/null)
 	local commit1=`git_show_head $testroot/repo`
 	local short_commit1=`trim_obj_id 32 $commit1`
-	local author_time=`git_show_author_time $testroot/repo`
+	local author_time1=`git_show_author_time $testroot/repo`
 
 	cat > $testroot/wt/alpha <<EOF
 A
@@ -921,6 +921,7 @@ EOF
 	(cd $testroot/wt && got commit -m "change 2" > /dev/null)
 	local commit2=`git_show_head $testroot/repo`
 	local short_commit2=`trim_obj_id 32 $commit2`
+	local author_time2=`git_show_author_time $testroot/repo`
 
 	cat > $testroot/wt/alpha <<EOF
 A
@@ -934,7 +935,7 @@ EOF
 	(cd $testroot/wt && got commit -m "change 3" > /dev/null)
 	local commit3=`git_show_head $testroot/repo`
 	local short_commit3=`trim_obj_id 32 $commit3`
-	local author_time=`git_show_author_time $testroot/repo`
+	local author_time3=`git_show_author_time $testroot/repo`
 
 	cat > $testroot/wt/alpha <<EOF
 A
@@ -947,7 +948,7 @@ EOF
 	(cd $testroot/wt && got commit -m "change 4" > /dev/null)
 	local commit4=`git_show_head $testroot/repo`
 	local short_commit4=`trim_obj_id 32 $commit4`
-	local author_time=`git_show_author_time $testroot/repo`
+	local author_time4=`git_show_author_time $testroot/repo`
 
 	cat > $testroot/wt/alpha <<EOF
 X
@@ -961,18 +962,21 @@ EOF
 	(cd $testroot/wt && got commit -m "change 5" > /dev/null)
 	local commit5=`git_show_head $testroot/repo`
 	local short_commit5=`trim_obj_id 32 $commit5`
-	local author_time=`git_show_author_time $testroot/repo`
+	local author_time5=`git_show_author_time $testroot/repo`
 
 	(cd $testroot/wt && got blame alpha > $testroot/stdout)
 
-	d=`date -u -r $author_time +"%G-%m-%d"`
-	echo "1) $short_commit5 $d $GOT_AUTHOR_8 X" > $testroot/stdout.expected
-	echo "2) $short_commit1 $d $GOT_AUTHOR_8 A" >> $testroot/stdout.expected
-	echo "3) $short_commit1 $d $GOT_AUTHOR_8 B" >> $testroot/stdout.expected
-	echo "4) $short_commit1 $d $GOT_AUTHOR_8 C" >> $testroot/stdout.expected
-	echo "5) $short_commit2 $d $GOT_AUTHOR_8 P" >> $testroot/stdout.expected
-	echo "6) $short_commit4 $d $GOT_AUTHOR_8 Y" >> $testroot/stdout.expected
-	echo "7) $short_commit2 $d $GOT_AUTHOR_8 Q" >> $testroot/stdout.expected
+	d1=`date -u -r $author_time1 +"%G-%m-%d"`
+	d2=`date -u -r $author_time2 +"%G-%m-%d"`
+	d4=`date -u -r $author_time4 +"%G-%m-%d"`
+	d5=`date -u -r $author_time5 +"%G-%m-%d"`
+	echo "1) $short_commit5 $d5 $GOT_AUTHOR_8 X" > $testroot/stdout.expected
+	echo "2) $short_commit1 $d1 $GOT_AUTHOR_8 A" >> $testroot/stdout.expected
+	echo "3) $short_commit1 $d1 $GOT_AUTHOR_8 B" >> $testroot/stdout.expected
+	echo "4) $short_commit1 $d1 $GOT_AUTHOR_8 C" >> $testroot/stdout.expected
+	echo "5) $short_commit2 $d2 $GOT_AUTHOR_8 P" >> $testroot/stdout.expected
+	echo "6) $short_commit4 $d4 $GOT_AUTHOR_8 Y" >> $testroot/stdout.expected
+	echo "7) $short_commit2 $d5 $GOT_AUTHOR_8 Q" >> $testroot/stdout.expected
 
 	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret=$?