From: Jeff King <hidden> Date: 2016-06-15 22:47:12
This series adds support for making trash directories for the test
scripts outside of the usual hierarchy. The main benefit is improved
performance. By putting the trash directories onto a tmpfs (rather than
SATA disks), my "make -j32 test" time went from around 1m51s to around
1m01s. I can only imagine what improvement it would have for people on
NFS. :)
It also has the nice side effect that running the test suite doesn't
thrash your disk as much, in case you wanted to do something else while
it was running.
[1/3] tests: use "$TEST_DIRECTORY" instead of ".."
[2/3] tests: provide $TRASH_DIRECTORY variable
[3/3] tests: allow user to specify trash directory location
-Peff
From: Jeff King <hidden> Date: 2016-06-15 22:47:12
The $TEST_DIRECTORY variable allows tests to find the
top-level test directory regardless of the current working
directory.
In the past, this has been used to accomodate tests which
change directories, but it is also the first step to being
able to move trash directories outside of the
$TEST_DIRECTORY hierarchy.
Signed-off-by: Jeff King <redacted>
---
t/t3404-rebase-interactive.sh | 2 +-
t/t3411-rebase-preserve-around-merges.sh | 2 +-
t/t3414-rebase-preserve-onto.sh | 2 +-
t/t4020-diff-external.sh | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
@@ -10,7 +10,7 @@ aren'"'"'t on top of $ONTO, even if they are on top of $UPSTREAM.' ../test-lib.sh-.../lib-rebase.sh+."$TEST_DIRECTORY"/lib-rebase.sh# Set up branches like this:# A1---B1---E1---F1---G1
From: Jeff King <hidden> Date: 2016-06-15 22:47:12
Most scripts don't care about the absolute path to the trash
directory. The one exception was t4014 script, which pieced
together $TEST_DIRECTORY and $test itself to get an absolute
directory.
Instead, let's provide a $TRASH_DIRECTORY which specifies
the same thing. This keeps the $test variable internal to
test-lib.sh and paves the way for trash directories in other
locations.
Signed-off-by: Jeff King <redacted>
---
t/t4014-format-patch.sh | 3 +--
t/test-lib.sh | 3 ++-
2 files changed, 3 insertions(+), 3 deletions(-)
@@ -493,13 +493,12 @@ test_expect_success 'format-patch from a subdirectory (2)' '' test_expect_success'format-patch from a subdirectory (3)''-here="$TEST_DIRECTORY/$test"&&rm-f0*&&filename=$(rm-rfsub&&mkdir-psub/dir&&cdsub/dir&&-gitformat-patch-1-o"$here"+gitformat-patch-1-o"$TRASH_DIRECTORY")&&basename=$(expr"$filename":".*/\(.*\)")&&test-f"$basename"
From: Jeff King <hidden> Date: 2016-06-15 22:47:12
The tests generate a large amount of I/O activity creating
and destroying repositories and files. We can improve the
time it takes to run the test suite by creating trash
directories on filesystems with better performance
characteristic, even though we may not want the rest of the
git repository on those filesystems (e.g., because they are
not network connected, or because they are temporary
ramdisks).
For example, on a dual processor system:
$ cd t && time make -j32
real 1m51.562s
user 0m59.260s
sys 1m20.933s
# /dev/shm is tmpfs
$ cd t && time make -j32 GIT_TEST_OPTS="--root=/dev/shm"
real 1m1.484s
user 0m53.555s
sys 1m5.264s
We almost halve the wall clock time, and we utilize the
dual processors much better.
Signed-off-by: Jeff King <redacted>
---
There is a test below for absolute versus relative path in the root
provided. Do we need some extra magic to make it work on non-Unix
platforms?
t/test-lib.sh | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
From: Jeff King <hidden> Date: 2016-06-15 22:47:12
This is useful if you want to specify GIT_TEST_OPTS that you
always use.
Signed-off-by: Jeff King <redacted>
---
On Sun, Aug 09, 2009 at 04:35:19AM -0400, Jeff King wrote:
[1/3] tests: use "$TEST_DIRECTORY" instead of ".."
[2/3] tests: provide $TRASH_DIRECTORY variable
[3/3] tests: allow user to specify trash directory location
I think a 4/3 like this is nice to let you use --root without extra
typing each time. And when you do "cd t && make t$WHATEVER.sh
GIT_TEST_OPTS='-v -i'", it will automatically be overridden, which is
probably what you want, so you can inspect the failed tests in t/trash*.
t/Makefile | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
From: Johannes Sixt <hidden> Date: 2016-06-15 22:47:12
On Sonntag, 9. August 2009, Jeff King wrote:
There is a test below for absolute versus relative path in the root
provided. Do we need some extra magic to make it work on non-Unix
platforms?
Not for Windows. Those devolpers who want to use an absolute path can use the
POSIX path notation:
GIT_TEST_OPTS=--root=/c/temp/gittests
This works in t4014.
-- Hannes
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:47:12
Hi,
On Sun, 9 Aug 2009, Johannes Sixt wrote:
On Sonntag, 9. August 2009, Jeff King wrote:
quoted
There is a test below for absolute versus relative path in the root
provided. Do we need some extra magic to make it work on non-Unix
platforms?
Not for Windows. Those devolpers who want to use an absolute path can use the
POSIX path notation:
GIT_TEST_OPTS=--root=/c/temp/gittests
This works in t4014.
But I am not aware of any reasonable tmpfs equivalent on Windows. Are
you? I would be _very_ interested.
Ciao,
Dscho