Re: [PATCH/RFC 1/1] t0027: Some tests are not expensive

2017-04-30 Thread Torsten Bögershausen



On 01/05/17 05:07, Junio C Hamano wrote:

tbo...@web.de writes:


From: Torsten Bögershausen 
...
The execution time for the non-expansive part is 6..8 seconds under Linux,
and 32 seconds under Mac Os X.

Running the "expensive" version roughly doubles the time.


Hmph, perhaps none of these is truly expensive if that is the case?
I am not talking about ~10 or ~30 seconds in absolute terms, but
reacting to "excluding the ones only halves the time."

The files used in the test vector seem to be all small.



Is the expensiveness due to the fact that there are so many of them,

Yes


and not due to some specific conversion being very slow?

Yes

The easiest solution is probably to simply remove the EXPENSIVE
precondition from t0027 and run it always on all platforms.
At the same time t0025 can be removed.
Unless somebody objects, I will send a V2 the next days.


Re: [PATCH/RFC 1/1] t0027: Some tests are not expensive

2017-04-30 Thread Junio C Hamano
tbo...@web.de writes:

> From: Torsten Bögershausen 
> ...
> The execution time for the non-expansive part is 6..8 seconds under Linux,
> and 32 seconds under Mac Os X.
>
> Running the "expensive" version roughly doubles the time.

Hmph, perhaps none of these is truly expensive if that is the case?
I am not talking about ~10 or ~30 seconds in absolute terms, but
reacting to "excluding the ones only halves the time."

The files used in the test vector seem to be all small.
Is the expensiveness due to the fact that there are so many of them,
and not due to some specific conversion being very slow?


[PATCH/RFC 1/1] t0027: Some tests are not expensive

2017-04-29 Thread tboegi
From: Torsten Bögershausen 

The purpose of t0027 is to test all CRLF related conversions at
"git checkout" and "git add".

Running t0027 under Git for Windows takes 3-4 minutes, so the whole script
had been marked as "EXPENSIVE".

The source code for "Git for Windows" overrides this since 2014:
"t0027 is marked expensive, but really, for MinGW we want to run these
tests always."

Recent "stress" tests show that t0025 if flaky, reported by Lars Schneider,
larsxschnei...@gmail.com

All tests from t0025 are covered in t0027 as well, so that t0025 can be
retired later.

Split the tests in t0027 into 2 groups: expensive and not expensive.
Expensive are all tests which check the CRLF conversion warnings and
all tests which activate the Git internal "ident" filter.

All other test are now run under all platforms, which allows to remove
the flaky t0025 in the next commit.

The execution time for the non-expansive part is 6..8 seconds under Linux,
and 32 seconds under Mac Os X.

Running the "expensive" version roughly doubles the time.

And in case you ask, things are not going significantly faster using a SSD
instead of a spinning disk.

Signed-off-by: Torsten Bögershausen 
PS: The removal of t0025 is not included (yet)
---
 t/t0027-auto-crlf.sh | 100 ++-
 1 file changed, 59 insertions(+), 41 deletions(-)

diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 90db54c..2c5aff6 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -4,10 +4,12 @@ test_description='CRLF conversion all combinations'
 
 . ./test-lib.sh
 
-if ! test_have_prereq EXPENSIVE
+if ! test_have_prereq EXPENSIVE && ! test_have_prereq MINGW
 then
-   skip_all="EXPENSIVE not set"
-   test_done
+   say "# EXPENSIVE or MINGW not set, skipping ident and warning tests"
+else
+   EXPENSIVE0027=t
+   export EXPENSIVE0027
 fi
 
 compare_files () {
@@ -95,11 +97,14 @@ commit_check_warn () {
git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
done &&
git commit -m "core.autocrlf $crlf" &&
-   check_warning "$lfname" ${pfx}_LF.err &&
-   check_warning "$crlfname" ${pfx}_CRLF.err &&
-   check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err &&
-   check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err &&
-   check_warning "$crlfnul" ${pfx}_CRLF_nul.err
+   if test "$EXPENSIVE0027" = t
+   then
+   check_warning "$lfname" ${pfx}_LF.err &&
+   check_warning "$crlfname" ${pfx}_CRLF.err &&
+   check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err &&
+   check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err &&
+   check_warning "$crlfnul" ${pfx}_CRLF_nul.err
+   fi
 }
 
 commit_chk_wrnNNO () {
@@ -122,24 +127,27 @@ commit_chk_wrnNNO () {
git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
done
 
-   test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" '
-   check_warning "$lfwarn" ${pfx}_LF.err
-   '
-   test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf 
CRLF" '
-   check_warning "$crlfwarn" ${pfx}_CRLF.err
-   '
-
-   test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf 
CRLF_mix_LF" '
-   check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err
-   '
-
-   test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf 
LF_mix_cr" '
-   check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err
-   '
-
-   test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf 
CRLF_nul" '
-   check_warning "$crlfnul" ${pfx}_CRLF_nul.err
-   '
+   if test "$EXPENSIVE0027" = t
+   then
+   test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" 
'
+   check_warning "$lfwarn" ${pfx}_LF.err
+   '
+   test_expect_success "commit NNO files attr=$attr aeol=$aeol 
crlf=$crlf CRLF" '
+   check_warning "$crlfwarn" ${pfx}_CRLF.err
+   '
+
+   test_expect_success "commit NNO files attr=$attr aeol=$aeol 
crlf=$crlf CRLF_mix_LF" '
+   check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err
+   '
+
+   test_expect_success "commit NNO files attr=$attr aeol=$aeol 
crlf=$crlf LF_mix_cr" '
+   check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err
+   '
+
+   test_expect_success "commit NNO files attr=$attr aeol=$aeol 
crlf=$crlf CRLF_nul" '
+   check_warning "$crlfnul" ${pfx}_CRLF_nul.err
+   '
+   fi
 }
 
 stats_ascii () {
@@ -250,21 +258,24 @@ checkout_files () {
fi
done
 
-   test_expect_success "ls-files --eol attr=$attr $ident aeol=$aeol 
core.autocrlf=$crlf core.eol=$ceol" '
-   test_when_finished "rm expect actual" &&
-