darcs

Patch 1893 tests: always use 'tar -f -' to work with stdin/out

Title tests: always use 'tar -f -' to work with stdin/out
Superseder Nosy List ganesh
Related Issues
Status accepted Assigned To
Milestone

Created on 2019-08-26.14:18:11 by ganesh, last changed 2019-08-26.20:41:37 by bf.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt ganesh, 2019-08-26.14:18:11 text/x-darcs-patch
patch-preview.txt ganesh, 2019-08-26.17:38:47 text/x-darcs-patch
tests_-add-a-utility-function-for-unpacking-tarballs.dpatch ganesh, 2019-08-26.17:38:47 application/x-darcs-patch
tests_-always-use-_tar-_f-__-to-work-with-stdin_out.dpatch ganesh, 2019-08-26.14:18:11 application/x-darcs-patch
unnamed ganesh, 2019-08-26.14:18:11 text/plain
unnamed ganesh, 2019-08-26.17:38:47 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg21205 (view) Author: ganesh Date: 2019-08-26.14:18:11
I'm starting to think I should just stop using Windows...

I'm going to push this to reviewed now because it's
pretty trivial and I need it to get clean test runs, but
any comments just let me know and I can follow up.

1 patch for repository darcs-unstable@darcs.net:screened:

patch 9fdba2a70dc614e86ee154c16660598cca9299ca
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Aug 26 15:18:56 BST 2019
  * tests: always use 'tar -f -' to work with stdin/out
  
  tar on msys has taken to defaulting to \\.\tape0 instead
Attachments
msg21207 (view) Author: bf Date: 2019-08-26.14:52:07
> I'm going to push this to reviewed now because it's
> pretty trivial and I need it to get clean test runs, but
> any comments just let me know and I can follow up.

It would be nice if we could either

 * gather restrictions/pitfalls like that (and recipes to avoid them)
   somehwere e.g. tests/README

 * or, even better, add small shell functions to tests/lib to use,
   instead of the raw commands, where that is problematic.

For instance, we could add

unpack_testdata () {
  # on Windows we cannot use the -f option
  tar xz < $TESTDATA/$1
}

and use it in shell scripts as

unpack_testdata old-style-rebase.tgz

Since much of test script writing is copy-and-paste anyway, this would
more or less automatically proliferate to new scripts...
msg21215 (view) Author: ganesh Date: 2019-08-26.17:38:47
Yes, good point.

I decided to hide the extension in the function too given
we're already hiding $TESTDATA, and we always seem to
be using .tgz rather than .tar.gz anyway.

1 patch for repository darcs-unstable@darcs.net:screened:

patch 900159a56e103417859891226c9f21477cc516ae
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Aug 26 18:33:26 BST 2019
  * tests: add a utility function for unpacking tarballs
  
  This should make it less likely that someone will write
  something that doesn't work on Windows.
Attachments
msg21218 (view) Author: bf Date: 2019-08-26.20:21:59
> I decided to hide the extension in the function too given
> we're already hiding $TESTDATA, and we always seem to
> be using .tgz rather than .tar.gz anyway.

That wouldn't have been my choice but it's not a big deal. Will accept.
History
Date User Action Args
2019-08-26 14:18:11ganeshcreate
2019-08-26 14:40:22ganeshsetstatus: needs-screening -> needs-review
2019-08-26 14:52:07bfsetmessages: + msg21207
2019-08-26 17:38:47ganeshsetfiles: + patch-preview.txt, tests_-add-a-utility-function-for-unpacking-tarballs.dpatch, unnamed
messages: + msg21215
2019-08-26 20:21:59bfsetmessages: + msg21218
2019-08-26 20:41:37bfsetstatus: needs-review -> accepted