[PATCH] tests: make test-convert-git.t reproducible

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Dec 24 13:24:49 EST 2016



On 12/24/2016 06:45 PM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1482601208 25200
> #      Sat Dec 24 10:40:08 2016 -0700
> # Node ID ee1c5cef44af3163e95858f23730b6bd1d035595
> # Parent  b2be4ccaff1d89356cbd9637aa9191e8048012b6
> tests: make test-convert-git.t reproducible
>
> For reasons I can't explain, Git's copy detection code was identifying
> different source files on OS X and (presumably) Solaris versus Linux
> (which the test was originally authored against). This was causing
> unstable test output.
>
> Changing the test to use a non-ambiguous source file appears to make
> the test stable.
>
> The test was introduced recently in ea3540e66fd8.

Pushed, thanks for the quick fixes.

> diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t
> --- a/tests/test-convert-git.t
> +++ b/tests/test-convert-git.t
> @@ -376,29 +376,40 @@ source, the copy source took the content
>
>  renamelimit config option works
>
>    $ cd git-repo2
> -  $ cp bar bar-copy0
> -  $ echo 0 >> bar-copy0
> -  $ cp bar bar-copy1
> -  $ echo 1 >> bar-copy1
> -  $ git add bar-copy0 bar-copy1
> -  $ commit -a -m 'copy bar 2 times'
> +  $ cat >> copy-source << EOF
> +  > sc0
> +  > sc1
> +  > sc2
> +  > sc3
> +  > sc4
> +  > sc5
> +  > sc6
> +  > EOF
> +  $ git add copy-source
> +  $ commit -m 'add copy-source'
> +  $ cp copy-source source-copy0
> +  $ echo 0 >> source-copy0
> +  $ cp copy-source source-copy1
> +  $ echo 1 >> source-copy1
> +  $ git add source-copy0 source-copy1
> +  $ commit -a -m 'copy copy-source 2 times'
>    $ cd ..
>
>    $ hg -q convert --config convert.git.renamelimit=1 \
>    > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo2
>    $ hg -R fullrepo2 status -C --change master
> -  A bar-copy0
> -  A bar-copy1
> +  A source-copy0
> +  A source-copy1
>
>    $ hg -q convert --config convert.git.renamelimit=100 \
>    > --config convert.git.findcopiesharder=true --datesort git-repo2 fullrepo3
>    $ hg -R fullrepo3 status -C --change master
> -  A bar-copy0
> -    bar
> -  A bar-copy1
> -    bar
> +  A source-copy0
> +    copy-source
> +  A source-copy1
> +    copy-source
>
>  test binary conversion (issue1359)
>
>    $ count=19

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list