Patchwork [3,of,4] test-commandserver: generate files with a fixed EOL for test stability

login
register
mail settings
Submitter Matt Harbison
Date Oct. 2, 2015, 3:05 a.m.
Message ID <a7393d1757e9b0a91a29.1443755102@Envy>
Download mbox | patch
Permalink /patch/10729/
State Superseded
Commit 46984a5308a0525d3d5718ebeeec782e96319fe5
Headers show

Comments

Matt Harbison - Oct. 2, 2015, 3:05 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1443750590 14400
#      Thu Oct 01 21:49:50 2015 -0400
# Node ID a7393d1757e9b0a91a29525c00cbe7cad9e6cb42
# Parent  cd207b634473a3453e1c883356b0fe0f082bc74d
test-commandserver: generate files with a fixed EOL for test stability

The hashes were different on Windows.
Yuya Nishihara - Oct. 2, 2015, 3:12 p.m.
On Thu, 01 Oct 2015 23:05:02 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1443750590 14400
> #      Thu Oct 01 21:49:50 2015 -0400
> # Node ID a7393d1757e9b0a91a29525c00cbe7cad9e6cb42
> # Parent  cd207b634473a3453e1c883356b0fe0f082bc74d
> test-commandserver: generate files with a fixed EOL for test stability
> 
> The hashes were different on Windows.
> 
> diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
> --- a/tests/test-commandserver.t
> +++ b/tests/test-commandserver.t
> @@ -378,7 +378,10 @@
>    ...     runcommand(server, ['log', '-qr', 'draft()'])
>    ...     # create draft commits by another process
>    ...     for i in xrange(5, 7):
> -  ...         os.system('echo a >> a')
> +  ...         f = open('a', 'ab')
> +  ...         f.seek(0, os.SEEK_END)
> +  ...         f.write('a\n')
> +  ...         f.close()

Oops, my bad. It was cmd.exe.
Pushed the series to clowncopter, thanks.

Patch

diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -378,7 +378,10 @@ 
   ...     runcommand(server, ['log', '-qr', 'draft()'])
   ...     # create draft commits by another process
   ...     for i in xrange(5, 7):
-  ...         os.system('echo a >> a')
+  ...         f = open('a', 'ab')
+  ...         f.seek(0, os.SEEK_END)
+  ...         f.write('a\n')
+  ...         f.close()
   ...         os.system('hg commit -Aqm%d' % i)
   ...     # new commits should be listed as draft revisions
   ...     runcommand(server, ['log', '-qr', 'draft()'])