# [PATCH v3 1/3] Add Travis CI support

29 messages from 2015-10-11 to 2015-10-15. Participants: larsxschneider@gmail.com, Eric Sunshine, Luke Diamand, Sebastian Schuberth, Junio C Hamano, Lars Schneider, Matthieu Moy, Jean-Noël Avila, Johannes Schindelin.
Thread: https://gitlist.dev/t/40532

## larsxschneider@gmail.com, 2015-10-11 17:54

Subject: [PATCH v3 0/3] Add Travis CI support
Message-ID: <1444586102-82557-1-git-send-email-larsxschneider@gmail.com>
URL: https://gitlist.dev/e/1444586102-82557-1-git-send-email-larsxschneider%40gmail.com

```
From: Lars Schneider <larsxschneider@gmail.com>

diff to v2:
* fix commit message to express what systems the Travis CI's infrastructure
  "currently" uses (thanks Dscho)
* use `case` instead `if` syntax for OS detection (thanks Dscho)
* remove unnessary DARWIN flag (thanks Junio)
* use flag `case_insensitive_fs` to disable t9819-git-p4-case-folding based on
  the currently used filesytem (thanks Junio)
* replace `stats` call in t9815-git-p4-submit-fail with `ls` to improve
  portability (thanks Junio, Torsten, and Pete)
* use Travis lifecycle properly to make output foldable in Travis (see
  little triangle on the left of the output on the Travis website)
* set git test option "--quite" and run make with option "--quite" to reduce
  log output noise

Thanks,
Lars

Lars Schneider (3):
  Add Travis CI support
  git-p4: Improve test case portability for t9815 git-p4-submit-fail
  git-p4: Skip t9819 test case on case insensitive file systems

 .travis.yml                    | 46 ++++++++++++++++++++++++++++++++++++++++++
 t/t9815-git-p4-submit-fail.sh  |  7 ++-----
 t/t9819-git-p4-case-folding.sh |  6 ++++++
 3 files changed, 54 insertions(+), 5 deletions(-)
 create mode 100644 .travis.yml

--
2.5.1

```

## larsxschneider@gmail.com, 2015-10-11 17:55

Subject: [PATCH v3 1/3] Add Travis CI support
Message-ID: <1444586102-82557-2-git-send-email-larsxschneider@gmail.com>
URL: https://gitlist.dev/e/1444586102-82557-2-git-send-email-larsxschneider%40gmail.com
In-Reply-To: <1444586102-82557-1-git-send-email-larsxschneider@gmail.com>

```
From: Lars Schneider <larsxschneider@gmail.com>

The tests are currently executed on "Ubuntu 12.04 LTS Server Edition
64 bit" and on "OS X Mavericks" using gcc and clang.

Perforce and Git-LFS are installed and therefore available for the
respective tests.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 .travis.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..25a7079
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,46 @@
+language: c
+
+os:
+  - linux
+  - osx
+
+compiler:
+  - clang
+  - gcc
+
+before_install:
+  - >
+    export GIT_TEST_OPTS=" --quiet";
+    case "${TRAVIS_OS_NAME:-linux}" in
+    linux)
+      wget -q https://package.perforce.com/perforce.pubkey -O - \
+        | sudo apt-key add -
+      echo 'deb http://package.perforce.com/apt/ubuntu precise release' \
+        | sudo tee -a /etc/apt/sources.list
+      wget -q https://packagecloud.io/gpg.key -O - | sudo apt-key add -
+      echo 'deb https://packagecloud.io/github/git-lfs/debian/ jessie main' \
+        | sudo tee -a /etc/apt/sources.list
+      sudo apt-get update -qq
+      sudo apt-get install -y apt-transport-https
+      sudo apt-get install perforce-server git-lfs
+      ;;
+    osx)
+      brew_force_set_latest_binary_hash () {
+        FORUMULA=$1
+        SHA=$(brew fetch --force $FORUMULA 2>&1 | grep ^SHA256: | cut -d ' ' -f 2)
+        sed -E -i.bak "s/sha256 \"[0-9a-f]{64}\"/sha256 \"$SHA\"/g" \
+          /usr/local/Library/Taps/homebrew/homebrew-binary/$FORUMULA.rb
+      }
+      brew update
+      brew tap homebrew/binary
+      brew_force_set_latest_binary_hash perforce
+      brew_force_set_latest_binary_hash perforce-server
+      brew install git-lfs perforce-server perforce
+      ;;
+    esac
+
+install: make configure && ./configure
+
+before_script: make
+
+script: make --quiet test
-- 
2.5.1

```

## larsxschneider@gmail.com, 2015-10-11 17:55

Subject: [PATCH v3 2/3] git-p4: Improve test case portability for t9815 git-p4-submit-fail
Message-ID: <1444586102-82557-3-git-send-email-larsxschneider@gmail.com>
URL: https://gitlist.dev/e/1444586102-82557-3-git-send-email-larsxschneider%40gmail.com
In-Reply-To: <1444586102-82557-1-git-send-email-larsxschneider@gmail.com>

```
From: Lars Schneider <larsxschneider@gmail.com>

Replace the stats command with the ls command to check file mode bits.
The stats command is not available on Windows and has different
command line options on OS X.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 t/t9815-git-p4-submit-fail.sh | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh
index 4cff6a7..37b42d0 100755
--- a/t/t9815-git-p4-submit-fail.sh
+++ b/t/t9815-git-p4-submit-fail.sh
@@ -417,11 +417,8 @@ test_expect_success 'cleanup chmod after submit cancel' '
 		! p4 fstat -T action text &&
 		test_path_is_file text+x &&
 		! p4 fstat -T action text+x &&
-		if test_have_prereq !CYGWIN
-		then
-			stat --format=%A text | egrep ^-r-- &&
-			stat --format=%A text+x | egrep ^-r-x
-		fi
+		ls -l text | egrep ^-r-- &&
+		ls -l text+x | egrep ^-r-x
 	)
 '
 
-- 
2.5.1

```

## larsxschneider@gmail.com, 2015-10-11 17:55

Subject: [PATCH v3 3/3] git-p4: Skip t9819 test case on case insensitive file systems
Message-ID: <1444586102-82557-4-git-send-email-larsxschneider@gmail.com>
URL: https://gitlist.dev/e/1444586102-82557-4-git-send-email-larsxschneider%40gmail.com
In-Reply-To: <1444586102-82557-1-git-send-email-larsxschneider@gmail.com>

```
From: Lars Schneider <larsxschneider@gmail.com>

Windows and OS X file systems are case insensitive by default.
Consequently the "git-p4-case-folding" test case does not apply to
them.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
 t/t9819-git-p4-case-folding.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t9819-git-p4-case-folding.sh b/t/t9819-git-p4-case-folding.sh
index 78f1d0f..d808c00 100755
--- a/t/t9819-git-p4-case-folding.sh
+++ b/t/t9819-git-p4-case-folding.sh
@@ -4,6 +4,12 @@ test_description='interaction with P4 case-folding'
 
 . ./lib-git-p4.sh
 
+if test_have_prereq CASE_INSENSITIVE_FS
+then
+	skip_all='skipping P4 case-folding tests; case insensitive file system detected'
+	test_done
+fi
+
 test_expect_success 'start p4d with case folding enabled' '
 	start_p4d -C1
 '
-- 
2.5.1

```

## Eric Sunshine, 2015-10-11 20:40

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <CAPig+cQ4Gd6aNQdrdD7ZEJW2Mn=pJujkqje0-htJpJYz8LVbhQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcQ4Gd6aNQdrdD7ZEJW2Mn%3DpJujkqje0-htJpJYz8LVbhQ%40mail.gmail.com
In-Reply-To: <1444586102-82557-2-git-send-email-larsxschneider@gmail.com>

```
On Sun, Oct 11, 2015 at 1:55 PM,  <larsxschneider@gmail.com> wrote:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> The tests are currently executed on "Ubuntu 12.04 LTS Server Edition
> 64 bit" and on "OS X Mavericks" using gcc and clang.
>
> Perforce and Git-LFS are installed and therefore available for the
> respective tests.
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
> diff --git a/.travis.yml b/.travis.yml
> new file mode 100644
> index 0000000..25a7079
> --- /dev/null
> +++ b/.travis.yml
> @@ -0,0 +1,46 @@
> +language: c
> +
> +os:
> +  - linux
> +  - osx
> +
> +compiler:
> +  - clang
> +  - gcc
> +
> +before_install:
> +  - >
> +    export GIT_TEST_OPTS=" --quiet";
> +    case "${TRAVIS_OS_NAME:-linux}" in
> +    linux)
> +      wget -q https://package.perforce.com/perforce.pubkey -O - \
> +        | sudo apt-key add -
> +      echo 'deb http://package.perforce.com/apt/ubuntu precise release' \
> +        | sudo tee -a /etc/apt/sources.list
> +      wget -q https://packagecloud.io/gpg.key -O - | sudo apt-key add -
> +      echo 'deb https://packagecloud.io/github/git-lfs/debian/ jessie main' \
> +        | sudo tee -a /etc/apt/sources.list
> +      sudo apt-get update -qq
> +      sudo apt-get install -y apt-transport-https
> +      sudo apt-get install perforce-server git-lfs
> +      ;;
> +    osx)
> +      brew_force_set_latest_binary_hash () {
> +        FORUMULA=$1

Is this spelling intentional or is it a misspelling of "formula"?

> +        SHA=$(brew fetch --force $FORUMULA 2>&1 | grep ^SHA256: | cut -d ' ' -f 2)
> +        sed -E -i.bak "s/sha256 \"[0-9a-f]{64}\"/sha256 \"$SHA\"/g" \
> +          /usr/local/Library/Taps/homebrew/homebrew-binary/$FORUMULA.rb
> +      }
> +      brew update
> +      brew tap homebrew/binary
> +      brew_force_set_latest_binary_hash perforce
> +      brew_force_set_latest_binary_hash perforce-server
> +      brew install git-lfs perforce-server perforce
> +      ;;
> +    esac
> +
> +install: make configure && ./configure
> +
> +before_script: make
> +
> +script: make --quiet test
> --
> 2.5.1

```

## Luke Diamand, 2015-10-12 06:47

Subject: Re: [PATCH v3 3/3] git-p4: Skip t9819 test case on case insensitive file systems
Message-ID: <CAE5ih79M9guQsjs34XmyE6sxExa6a6KkgdYEHOyeBCv57-4-QA@mail.gmail.com>
URL: https://gitlist.dev/e/CAE5ih79M9guQsjs34XmyE6sxExa6a6KkgdYEHOyeBCv57-4-QA%40mail.gmail.com
In-Reply-To: <1444586102-82557-4-git-send-email-larsxschneider@gmail.com>

```
Looks good to me, Ack.

On 11 October 2015 at 18:55,  <larsxschneider@gmail.com> wrote:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> Windows and OS X file systems are case insensitive by default.
> Consequently the "git-p4-case-folding" test case does not apply to
> them.
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
>  t/t9819-git-p4-case-folding.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/t/t9819-git-p4-case-folding.sh b/t/t9819-git-p4-case-folding.sh
> index 78f1d0f..d808c00 100755
> --- a/t/t9819-git-p4-case-folding.sh
> +++ b/t/t9819-git-p4-case-folding.sh
> @@ -4,6 +4,12 @@ test_description='interaction with P4 case-folding'
>
>  . ./lib-git-p4.sh
>
> +if test_have_prereq CASE_INSENSITIVE_FS
> +then
> +       skip_all='skipping P4 case-folding tests; case insensitive file system detected'
> +       test_done
> +fi
> +
>  test_expect_success 'start p4d with case folding enabled' '
>         start_p4d -C1
>  '
> --
> 2.5.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

```

## Sebastian Schuberth, 2015-10-12 08:05

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <561B69AE.8050403@gmail.com>
URL: https://gitlist.dev/e/561B69AE.8050403%40gmail.com
In-Reply-To: <1444586102-82557-2-git-send-email-larsxschneider@gmail.com>

```
On 10/11/2015 19:55, larsxschneider@gmail.com wrote:

> +      sudo apt-get update -qq
> +      sudo apt-get install -y apt-transport-https
> +      sudo apt-get install perforce-server git-lfs

Why no "-y" also in this line, or append these to the previous line?

Or maybe even better, like [1] does, also use "--qq" (which implies 
"-y") for "apt-get install"?

> +install: make configure && ./configure
> +
> +before_script: make
> +
> +script: make --quiet test

Semantically, it does not seem correct to me that configuarion goes to 
the install step. As "make test" will build git anyway, I'd instead 
propose to get rid of "install" and just say:

before_script: make configure && ./configure

script: make --quiet test

[1] https://github.com/git/git/pull/154/files

Regards,
Sebastian

```

## Junio C Hamano, 2015-10-12 16:02

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <xmqq37xgnkh0.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqq37xgnkh0.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <561B69AE.8050403@gmail.com>

```
Sebastian Schuberth <sschuberth@gmail.com> writes:

> Semantically, it does not seem correct to me that configuarion goes to
> the install step. As "make test" will build git anyway, I'd instead
> propose to get rid of "install" and just say:
>
> before_script: make configure && ./configure
>
> script: make --quiet test

Very good point.  Do we even need to do anything in the "install"
target?  We aim to be able to testable without any installed Git,
and not running "make install" at all, ever, would be one way to
make sure that works.

This is a slightly related tangent, but we saw a few build issues
reported recently on customized configurations like NO_PTHREAD.  If
we are to start using automated tests, I wonder if we want to build
(and optionally test) with various combinations of the customization
options (e.g. NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL etc.)

Thanks.

```

## Junio C Hamano, 2015-10-12 16:07

Subject: Re: [PATCH v3 0/3] Add Travis CI support
Message-ID: <xmqqpp0km5o5.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqpp0km5o5.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1444586102-82557-1-git-send-email-larsxschneider@gmail.com>

```
larsxschneider@gmail.com writes:

> Lars Schneider (3):
>   Add Travis CI support
>   git-p4: Improve test case portability for t9815 git-p4-submit-fail
>   git-p4: Skip t9819 test case on case insensitive file systems

Can you make this two separate series?  It seems Luke is happy with
the p4 bits and I think it makes sense to have it as a separate
series and apply sooner, while those who are interested in and well
versed in Travis to help polishing the first one.

```

## Junio C Hamano, 2015-10-12 16:07

Subject: Re: [PATCH v3 0/3] Add Travis CI support
Message-ID: <xmqqoag4m5nn.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqoag4m5nn.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1444586102-82557-1-git-send-email-larsxschneider@gmail.com>

```
larsxschneider@gmail.com writes:

> Lars Schneider (3):
>   Add Travis CI support
>   git-p4: Improve test case portability for t9815 git-p4-submit-fail
>   git-p4: Skip t9819 test case on case insensitive file systems

Can you split this into two separate series?

It seems Luke is happy with the p4 bits and I think it makes sense
to have it as a separate series and apply sooner, while those who
are interested in and well versed in Travis to help polishing the
first one.

Thanks.

```

## Lars Schneider, 2015-10-12 16:46

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <CF49BE6B-38E7-4552-B9C7-B7965E8A7881@gmail.com>
URL: https://gitlist.dev/e/CF49BE6B-38E7-4552-B9C7-B7965E8A7881%40gmail.com
In-Reply-To: <CAPig+cQ4Gd6aNQdrdD7ZEJW2Mn=pJujkqje0-htJpJYz8LVbhQ@mail.gmail.com>

```

>> +      brew_force_set_latest_binary_hash () {
>> +        FORUMULA=$1
> 
> Is this spelling intentional or is it a misspelling of "formula"?

This is a misspelling. I will fix it.

Thanks,
Lars

```

## Lars Schneider, 2015-10-12 17:12

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <BF182294-B896-4C2D-B371-74036BC522A2@gmail.com>
URL: https://gitlist.dev/e/BF182294-B896-4C2D-B371-74036BC522A2%40gmail.com
In-Reply-To: <561B69AE.8050403@gmail.com>

```

On 12 Oct 2015, at 01:05, Sebastian Schuberth <sschuberth@gmail.com> wrote:

> On 10/11/2015 19:55, larsxschneider@gmail.com wrote:
> 
>> +      sudo apt-get update -qq
>> +      sudo apt-get install -y apt-transport-https
>> +      sudo apt-get install perforce-server git-lfs
> 
> Why no "-y" also in this line, or append these to the previous line?
> 
> Or maybe even better, like [1] does, also use "--qq" (which implies "-y") for "apt-get install"?
Agreed!

> 
>> +install: make configure && ./configure
>> +
>> +before_script: make
>> +
>> +script: make --quiet test
> 
> Semantically, it does not seem correct to me that configuarion goes to the install step. As "make test" will build git anyway, I'd instead propose to get rid of "install" and just say:
> 
> before_script: make configure && ./configure
> 
> script: make --quiet test

I understand your point. I did this to make the "make" logs easily accessible (no option "--quite"). By default Travis CI automatically collapses the logs from all stages prior to the "script" stage. You can uncollapse these logs by clicking on the little triangle on the left border of the log. Therefore the "make" logs are available without noise.

Do you see value in "make" logs? 

If yes then we could also do:
before_script: make configure && ./configure && make

If no then I will take your suggestion.

Thanks,
Lars
```

## Sebastian Schuberth, 2015-10-12 18:42

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <CAHGBnuMU6d3rqW6sa=u+mE-95zRJZvopJVdLQAUi=-cc+xW86A@mail.gmail.com>
URL: https://gitlist.dev/e/CAHGBnuMU6d3rqW6sa%3Du%2BmE-95zRJZvopJVdLQAUi%3D-cc%2BxW86A%40mail.gmail.com
In-Reply-To: <xmqq37xgnkh0.fsf@gitster.mtv.corp.google.com>

```
On Mon, Oct 12, 2015 at 6:02 PM, Junio C Hamano <gitster@pobox.com> wrote:

>> Semantically, it does not seem correct to me that configuarion goes to
>> the install step. As "make test" will build git anyway, I'd instead
>> propose to get rid of "install" and just say:
>>
>> before_script: make configure && ./configure
>>
>> script: make --quiet test
>
> Very good point.  Do we even need to do anything in the "install"
> target?  We aim to be able to testable without any installed Git,
> and not running "make install" at all, ever, would be one way to
> make sure that works.

Note that Travis' "install" step is about installing dependencies for
the application to build [1], not for installing the built application
(i.e. what "make install" does). In any case, I still think
configuring the application to built in this step is wrong.

> we are to start using automated tests, I wonder if we want to build
> (and optionally test) with various combinations of the customization
> options (e.g. NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL etc.)

I like that idea, but I think we should save that for a future
improvement to .travis.yml.

[1] http://docs.travis-ci.com/user/installing-dependencies/

-- 
Sebastian Schuberth

```

## Sebastian Schuberth, 2015-10-12 19:37

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <CAHGBnuOqVPHAhfN6qtt=VDODW9h+A1xMEnzaZfD61DCNyj_YOg@mail.gmail.com>
URL: https://gitlist.dev/e/CAHGBnuOqVPHAhfN6qtt%3DVDODW9h%2BA1xMEnzaZfD61DCNyj_YOg%40mail.gmail.com
In-Reply-To: <BF182294-B896-4C2D-B371-74036BC522A2@gmail.com>

```
On Mon, Oct 12, 2015 at 7:12 PM, Lars Schneider
<larsxschneider@gmail.com> wrote:

>>> +install: make configure && ./configure
>>> +
>>> +before_script: make
>>> +
>>> +script: make --quiet test
>>
>> Semantically, it does not seem correct to me that configuarion goes to the install step. As "make test" will build git anyway, I'd instead propose to get rid of "install" and just say:
>>
>> before_script: make configure && ./configure
>>
>> script: make --quiet test
>
> I understand your point. I did this to make the "make" logs easily accessible (no option "--quite"). By default Travis CI automatically collapses the logs from all stages prior to the "script" stage. You can uncollapse these logs by clicking on the little triangle on the left border of the log. Therefore the "make" logs are available without noise.

To make this more clear, I guess what you're referring to is the
visual difference between [1] and [2], correct?

> Do you see value in "make" logs?
>
> If yes then we could also do:
> before_script: make configure && ./configure && make

Reading through Travis' docs [3] again, "before_script" is documented
to "return a non-zero exit code, the build is errored and stops
immediately", while "script" is documented as "returns a non-zero exit
code, the build is failed, but continues to run before being marked as
failed". As it does not make much sense to continue the build or even
start testing if the build failed, maybe it's indeed best to do:

before_script: make configure && ./configure && make

script: make --quiet test

[1] https://travis-ci.org/larsxschneider/git/jobs/84805733
[2] https://travis-ci.org/larsxschneider/git/jobs/84955658
[3] http://docs.travis-ci.com/user/customizing-the-build/

-- 
Sebastian Schuberth

```

## Lars Schneider, 2015-10-12 19:40

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <B85D5671-9F8C-452E-87B9-EB4DE3C85955@gmail.com>
URL: https://gitlist.dev/e/B85D5671-9F8C-452E-87B9-EB4DE3C85955%40gmail.com
In-Reply-To: <xmqq37xgnkh0.fsf@gitster.mtv.corp.google.com>

```

On 12 Oct 2015, at 09:02, Junio C Hamano <gitster@pobox.com> wrote:

> Sebastian Schuberth <sschuberth@gmail.com> writes:
> 
>> Semantically, it does not seem correct to me that configuarion goes to
>> the install step. As "make test" will build git anyway, I'd instead
>> propose to get rid of "install" and just say:
>> 
>> before_script: make configure && ./configure
>> 
>> script: make --quiet test
> 
> Very good point.  Do we even need to do anything in the "install"
> target?  We aim to be able to testable without any installed Git,
> and not running "make install" at all, ever, would be one way to
> make sure that works.
The Travis CI "install" stage is independent of "make install". AFAIK you can use the Travis lifecycle stages pretty much as you want. However, I agree we should not use the "install" stage to avoid confusion.


> This is a slightly related tangent, but we saw a few build issues
> reported recently on customized configurations like NO_PTHREAD.  If
> we are to start using automated tests, I wonder if we want to build
> (and optionally test) with various combinations of the customization
> options (e.g. NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL etc.)
This easy to do. However, the more we environment settings we define the longer the build runs. I created a test matrix that runs the following combinations:
{Linux | OSX} * {gcc | clang} * {Default, NO_PTHREAD, NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL}

These result in 28 (= 2*2*7) combinations. I created a build without the "Default" environment (=24 combination) here:
https://travis-ci.org/larsxschneider/git/builds/84978673

Should I add them them to the Travis CI patch?

Thanks,
Lars

```

## Lars Schneider, 2015-10-12 19:43

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <61B448FB-DB61-42B6-ACDF-181F76169061@gmail.com>
URL: https://gitlist.dev/e/61B448FB-DB61-42B6-ACDF-181F76169061%40gmail.com
In-Reply-To: <CAHGBnuOqVPHAhfN6qtt=VDODW9h+A1xMEnzaZfD61DCNyj_YOg@mail.gmail.com>

```

On 12 Oct 2015, at 12:37, Sebastian Schuberth <sschuberth@gmail.com> wrote:

> On Mon, Oct 12, 2015 at 7:12 PM, Lars Schneider
> <larsxschneider@gmail.com> wrote:
> 
>>>> +install: make configure && ./configure
>>>> +
>>>> +before_script: make
>>>> +
>>>> +script: make --quiet test
>>> 
>>> Semantically, it does not seem correct to me that configuarion goes to the install step. As "make test" will build git anyway, I'd instead propose to get rid of "install" and just say:
>>> 
>>> before_script: make configure && ./configure
>>> 
>>> script: make --quiet test
>> 
>> I understand your point. I did this to make the "make" logs easily accessible (no option "--quite"). By default Travis CI automatically collapses the logs from all stages prior to the "script" stage. You can uncollapse these logs by clicking on the little triangle on the left border of the log. Therefore the "make" logs are available without noise.
> 
> To make this more clear, I guess what you're referring to is the
> visual difference between [1] and [2], correct?
correct!

> 
>> Do you see value in "make" logs?
>> 
>> If yes then we could also do:
>> before_script: make configure && ./configure && make
> 
> Reading through Travis' docs [3] again, "before_script" is documented
> to "return a non-zero exit code, the build is errored and stops
> immediately", while "script" is documented as "returns a non-zero exit
> code, the build is failed, but continues to run before being marked as
> failed". As it does not make much sense to continue the build or even
> start testing if the build failed, maybe it's indeed best to do:
> 
> before_script: make configure && ./configure && make
> 
> script: make --quiet test

Ok, then I will make it so :-)

Thanks,
Lars
```

## Sebastian Schuberth, 2015-10-12 19:48

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <CAHGBnuNxZY9KEo43c31EEm-mzS3wmw-OLkmYa5jYmCJ64a655A@mail.gmail.com>
URL: https://gitlist.dev/e/CAHGBnuNxZY9KEo43c31EEm-mzS3wmw-OLkmYa5jYmCJ64a655A%40mail.gmail.com
In-Reply-To: <B85D5671-9F8C-452E-87B9-EB4DE3C85955@gmail.com>

```
On Mon, Oct 12, 2015 at 9:40 PM, Lars Schneider
<larsxschneider@gmail.com> wrote:

>> This is a slightly related tangent, but we saw a few build issues
>> reported recently on customized configurations like NO_PTHREAD.  If
>> we are to start using automated tests, I wonder if we want to build
>> (and optionally test) with various combinations of the customization
>> options (e.g. NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL etc.)
> This easy to do. However, the more we environment settings we define the longer the build runs. I created a test matrix that runs the following combinations:
> {Linux | OSX} * {gcc | clang} * {Default, NO_PTHREAD, NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL}
>
> These result in 28 (= 2*2*7) combinations. I created a build without the "Default" environment (=24 combination) here:
> https://travis-ci.org/larsxschneider/git/builds/84978673
>
> Should I add them them to the Travis CI patch?

I'd say it depends on how long such a matrix build would take in
average. Personally, I'd prefer to not wait more than, say, 30 minutes
for testing a PR. From your Travis build history it looks to me as if
we already exceed that limit many fold, so I'd prefer to not use
matrix builds unless we find ways to speed up the build in general,
for example by using ccache [1].

[1] http://docs.travis-ci.com/user/caching/#ccache-cache

-- 
Sebastian Schuberth

```

## Sebastian Schuberth, 2015-10-12 19:53

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <CAHGBnuN+sBptYQo2T03-Ja1E_6Q3SdT7dBEVPOQXupvDU3Ot1Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAHGBnuN%2BsBptYQo2T03-Ja1E_6Q3SdT7dBEVPOQXupvDU3Ot1Q%40mail.gmail.com
In-Reply-To: <61B448FB-DB61-42B6-ACDF-181F76169061@gmail.com>

```
On Mon, Oct 12, 2015 at 9:43 PM, Lars Schneider
<larsxschneider@gmail.com> wrote:

>> Reading through Travis' docs [3] again, "before_script" is documented
>> to "return a non-zero exit code, the build is errored and stops
>> immediately", while "script" is documented as "returns a non-zero exit
>> code, the build is failed, but continues to run before being marked as
>> failed". As it does not make much sense to continue the build or even
>> start testing if the build failed, maybe it's indeed best to do:
>>
>> before_script: make configure && ./configure && make
>>
>> script: make --quiet test
>
> Ok, then I will make it so :-)

Also, this has the added benefit of being quickly able to see how much
time building vs testing took. As these two are the big blocks, we'd
want to optimize both steps for time, and it's easier to see what we
gain e.g. from a possible build-time improvement if these steps are
listed individually in the Travis log.

-- 
Sebastian Schuberth

```

## Matthieu Moy, 2015-10-12 20:10

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <vpq7fmryhiy.fsf@grenoble-inp.fr>
URL: https://gitlist.dev/e/vpq7fmryhiy.fsf%40grenoble-inp.fr
In-Reply-To: <B85D5671-9F8C-452E-87B9-EB4DE3C85955@gmail.com>

```
Lars Schneider <larsxschneider@gmail.com> writes:

> {Linux | OSX} * {gcc | clang} * {Default, NO_PTHREAD, NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL}

Another option would be to have a single "NO_*" build, that would
activate all NO_PTHREAD, NO_CURL, NO_OPENSSL, NO_MMAP, NO_IPV6, NO_PERL
at the same time. We'd miss issues with perl but no pthread or so, but
this should catch most issues.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Matthieu Moy, 2015-10-12 20:20

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <vpqwpurx2j1.fsf@grenoble-inp.fr>
URL: https://gitlist.dev/e/vpqwpurx2j1.fsf%40grenoble-inp.fr
In-Reply-To: <1444586102-82557-2-git-send-email-larsxschneider@gmail.com>

```
larsxschneider@gmail.com writes:

> --- /dev/null
> +++ b/.travis.yml
> @@ -0,0 +1,46 @@
> +language: c
> +
> +os:
> +  - linux
> +  - osx
> +
> +compiler:
> +  - clang
> +  - gcc
> +
> +before_install:
> +  - >
> +    export GIT_TEST_OPTS=" --quiet";
> +    case "${TRAVIS_OS_NAME:-linux}" in
> +    linux)
> +      wget -q https://package.perforce.com/perforce.pubkey -O - \
> +        | sudo apt-key add -
> +      echo 'deb http://package.perforce.com/apt/ubuntu precise release' \
> +        | sudo tee -a /etc/apt/sources.list
> +      wget -q https://packagecloud.io/gpg.key -O - | sudo apt-key add -
> +      echo 'deb https://packagecloud.io/github/git-lfs/debian/ jessie main' \
> +        | sudo tee -a /etc/apt/sources.list
> +      sudo apt-get update -qq
> +      sudo apt-get install -y apt-transport-https
> +      sudo apt-get install perforce-server git-lfs

Sorry if this has been discussed already, but do you really need these
"sudo" calls?

They trigger builds on the legacy Travis CI infrastructure:

  http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade

No big deal, but getting rid of sudo would be cool, and documenting why
it can't easily be done in commit message and/or comments would be nice
otherwise.

Thanks for working on that!

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Jean-Noël Avila, 2015-10-13 10:32

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <561CDDBA.609@gmail.com>
URL: https://gitlist.dev/e/561CDDBA.609%40gmail.com
In-Reply-To: <1444586102-82557-2-git-send-email-larsxschneider@gmail.com>

```
Le 11/10/2015 19:55, larsxschneider@gmail.com a écrit :
> +
> +before_script: make
> +
> +script: make --quiet test

Travis can be used in container mode but that would need getting rid of
"sudo" command and only installing from white-listed sources
(https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json)

Anyway, even within the present VM mode, 1.5 cores are available, so it
makes sense to add "-j2" to every make commands.

 

```

## Lars Schneider, 2015-10-14 22:52

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <1B50DC8E-45CC-4D9A-80A1-6391D762A81C@gmail.com>
URL: https://gitlist.dev/e/1B50DC8E-45CC-4D9A-80A1-6391D762A81C%40gmail.com
In-Reply-To: <vpqwpurx2j1.fsf@grenoble-inp.fr>

```

On 12 Oct 2015, at 22:20, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

> larsxschneider@gmail.com writes:
> 
>> --- /dev/null
>> +++ b/.travis.yml
>> @@ -0,0 +1,46 @@
>> +language: c
>> +
>> +os:
>> +  - linux
>> +  - osx
>> +
>> +compiler:
>> +  - clang
>> +  - gcc
>> +
>> +before_install:
>> +  - >
>> +    export GIT_TEST_OPTS=" --quiet";
>> +    case "${TRAVIS_OS_NAME:-linux}" in
>> +    linux)
>> +      wget -q https://package.perforce.com/perforce.pubkey -O - \
>> +        | sudo apt-key add -
>> +      echo 'deb http://package.perforce.com/apt/ubuntu precise release' \
>> +        | sudo tee -a /etc/apt/sources.list
>> +      wget -q https://packagecloud.io/gpg.key -O - | sudo apt-key add -
>> +      echo 'deb https://packagecloud.io/github/git-lfs/debian/ jessie main' \
>> +        | sudo tee -a /etc/apt/sources.list
>> +      sudo apt-get update -qq
>> +      sudo apt-get install -y apt-transport-https
>> +      sudo apt-get install perforce-server git-lfs
> 
> Sorry if this has been discussed already, but do you really need these
> "sudo" calls?
> 
> They trigger builds on the legacy Travis CI infrastructure:
> 
>  http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade
> 
> No big deal, but getting rid of sudo would be cool, and documenting why
> it can't easily be done in commit message and/or comments would be nice
> otherwise.
I would like to get rid of the "sudo" calls, too. Unfortunately I wasn't able to achieve this so far because these packages are not white listed on Travis CI (see Jean-Noël answer in this thread). I tried to download and install the *.deb files manually using dpkg without luck. Any idea or hint?
Nevertheless I don't think this is a problem as Travis CI states that "sudo isn't possible (__right now__)" on the new infrastructure. They need to find a solutions because I believe many projects will run into this issue...
http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade#Using-sudo-isn%E2%80%99t-possible-(right-now)

- Lars
```

## Lars Schneider, 2015-10-15 07:59

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <14146E1E-857D-416B-9287-F20826DCB806@gmail.com>
URL: https://gitlist.dev/e/14146E1E-857D-416B-9287-F20826DCB806%40gmail.com
In-Reply-To: <561CDDBA.609@gmail.com>

```

On 13 Oct 2015, at 12:32, Jean-Noël Avila <avila.jn@gmail.com> wrote:

> Le 11/10/2015 19:55, larsxschneider@gmail.com a écrit :
>> +
>> +before_script: make
>> +
>> +script: make --quiet test
> 
> Travis can be used in container mode but that would need getting rid of
> "sudo" command and only installing from white-listed sources
> (https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json)
> 
> Anyway, even within the present VM mode, 1.5 cores are available, so it
> makes sense to add "-j2" to every make commands.
> 
I was reluctant to this because I feared problems. Especially while running tests in parallel. However, the result looks quite good.

make -j2 9min 11sec:
https://travis-ci.org/larsxschneider/git/jobs/85478022

make 17min 20sec:
https://travis-ci.org/larsxschneider/git/jobs/85432398

If there is no argument against running test in parallel then I will add it to the next roll.

Thanks,
Lars
```

## Matthieu Moy, 2015-10-15 08:07

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <vpq37xc4ksz.fsf@grenoble-inp.fr>
URL: https://gitlist.dev/e/vpq37xc4ksz.fsf%40grenoble-inp.fr
In-Reply-To: <1B50DC8E-45CC-4D9A-80A1-6391D762A81C@gmail.com>

```
Lars Schneider <larsxschneider@gmail.com> writes:

> I would like to get rid of the "sudo" calls, too. Unfortunately I
> wasn't able to achieve this so far because these packages are not
> white listed on Travis CI (see Jean-Noël answer in this thread).

I think this would deserve a mention in the commit message, but I won't
insist on that.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Matthieu Moy, 2015-10-15 08:12

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <vpqwpuo35zo.fsf@grenoble-inp.fr>
URL: https://gitlist.dev/e/vpqwpuo35zo.fsf%40grenoble-inp.fr
In-Reply-To: <14146E1E-857D-416B-9287-F20826DCB806@gmail.com>

```
Lars Schneider <larsxschneider@gmail.com> writes:

> I was reluctant to this because I feared problems. Especially while
> running tests in parallel.

Isn't the point of using a CI tool to notice problems? ;-)

More seriously, running tests in parallel shouldn't be a problem since
each test runs in its own directory with HOME set to this private
directory, so two diffent tests should not interfer. If there's an issue
with parallel tests, we probably prefer discovering them than avoiding
them.

> make -j2 9min 11sec:
> https://travis-ci.org/larsxschneider/git/jobs/85478022
>
> make 17min 20sec:
> https://travis-ci.org/larsxschneider/git/jobs/85432398

Since the tests are essentially IO-bound and not CPU-bound, it may even
make sense to use -j3 here.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```

## Jean-Noël Avila, 2015-10-15 09:02

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <561F6BB4.8080202@gmail.com>
URL: https://gitlist.dev/e/561F6BB4.8080202%40gmail.com
In-Reply-To: <1B50DC8E-45CC-4D9A-80A1-6391D762A81C@gmail.com>

```
Le 15/10/2015 00:52, Lars Schneider a écrit :
> On 12 Oct 2015, at 22:20, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
>
>> larsxschneider@gmail.com writes:
>>
>>> --- /dev/null
>>> +++ b/.travis.yml
>>> @@ -0,0 +1,46 @@
>>> +language: c
>>> +
>>> +os:
>>> +  - linux
>>> +  - osx
>>> +
>>> +compiler:
>>> +  - clang
>>> +  - gcc
>>> +
>>> +before_install:
>>> +  - >
>>> +    export GIT_TEST_OPTS=" --quiet";
>>> +    case "${TRAVIS_OS_NAME:-linux}" in
>>> +    linux)
>>> +      wget -q https://package.perforce.com/perforce.pubkey -O - \
>>> +        | sudo apt-key add -
>>> +      echo 'deb http://package.perforce.com/apt/ubuntu precise release' \
>>> +        | sudo tee -a /etc/apt/sources.list
>>> +      wget -q https://packagecloud.io/gpg.key -O - | sudo apt-key add -
>>> +      echo 'deb https://packagecloud.io/github/git-lfs/debian/ jessie main' \
>>> +        | sudo tee -a /etc/apt/sources.list
>>> +      sudo apt-get update -qq
>>> +      sudo apt-get install -y apt-transport-https
>>> +      sudo apt-get install perforce-server git-lfs
>> Sorry if this has been discussed already, but do you really need these
>> "sudo" calls?
>>
>> They trigger builds on the legacy Travis CI infrastructure:
>>
>>  http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade
>>
>> No big deal, but getting rid of sudo would be cool, and documenting why
>> it can't easily be done in commit message and/or comments would be nice
>> otherwise.
> I would like to get rid of the "sudo" calls, too. Unfortunately I wasn't able to achieve this so far because these packages are not white listed on Travis CI (see Jean-Noël answer in this thread). I tried to download and install the *.deb files manually using dpkg without luck. Any idea or hint?
> Nevertheless I don't think this is a problem as Travis CI states that "sudo isn't possible (__right now__)" on the new infrastructure. They need to find a solutions because I believe many projects will run into this issue...
> http://docs.travis-ci.com/user/migrating-from-legacy/?utm_source=legacy-notice&utm_medium=banner&utm_campaign=legacy-upgrade#Using-sudo-isn%E2%80%99t-possible-(right-now)
>
> - Lars


There's another hope. The requirements can be installed in the user's
HOME and cached between builds. In this case, no need for sudo.
Obviously, that rules out using apt and dpkg.

Jean-Noël

```

## Lars Schneider, 2015-10-15 10:35

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <F501FD44-F14B-4902-9E24-149451804C1C@gmail.com>
URL: https://gitlist.dev/e/F501FD44-F14B-4902-9E24-149451804C1C%40gmail.com
In-Reply-To: <vpqwpuo35zo.fsf@grenoble-inp.fr>

```

On 15 Oct 2015, at 10:12, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

> Lars Schneider <larsxschneider@gmail.com> writes:
> 
>> I was reluctant to this because I feared problems. Especially while
>> running tests in parallel.
> 
> Isn't the point of using a CI tool to notice problems? ;-)
> 
> More seriously, running tests in parallel shouldn't be a problem since
> each test runs in its own directory with HOME set to this private
> directory, so two diffent tests should not interfer. If there's an issue
> with parallel tests, we probably prefer discovering them than avoiding
> them.
OK. Great!


>> make -j2 9min 11sec:
>> https://travis-ci.org/larsxschneider/git/jobs/85478022
>> 
>> make 17min 20sec:
>> https://travis-ci.org/larsxschneider/git/jobs/85432398
> 
> Since the tests are essentially IO-bound and not CPU-bound, it may even
> make sense to use -j3 here.
Hehe you're right.

make -j3 6min 2sec
https://travis-ci.org/larsxschneider/git/jobs/85497307

just for fun I tried a few more values and -j5 seems to be the best with 4min 27sec
https://travis-ci.org/larsxschneider/git/jobs/85501015

-j6 is slower again. Do you see a reason not to use "-j5"?

Thanks,
Lars

```

## Johannes Schindelin, 2015-10-15 10:50

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <alpine.DEB.1.00.1510151247550.31610@s15462909.onlinehome-server.info>
URL: https://gitlist.dev/e/alpine.DEB.1.00.1510151247550.31610%40s15462909.onlinehome-server.info
In-Reply-To: <vpqwpuo35zo.fsf@grenoble-inp.fr>

```
Hi,

On Thu, 15 Oct 2015, Matthieu Moy wrote:

> Lars Schneider <larsxschneider@gmail.com> writes:
> 
> > I was reluctant to this because I feared problems. Especially while
> > running tests in parallel.
> 
> Isn't the point of using a CI tool to notice problems? ;-)
> 
> More seriously, running tests in parallel shouldn't be a problem since
> each test runs in its own directory with HOME set to this private
> directory, so two diffent tests should not interfer. If there's an issue
> with parallel tests, we probably prefer discovering them than avoiding
> them.

I vividly remember pulling my hair out over BuildHive (i.e. the Java-based
Jenkins alternative to Travis) failures that turned out to be
resource-related: I simply overloaded the BuildHive node.

So I assumed that the problems Lars referred to would not be problems of
Git, or the test suite, but of overwhelming a free service with an
unreasonable load.

> > make -j2 9min 11sec:
> > https://travis-ci.org/larsxschneider/git/jobs/85478022
> >
> > make 17min 20sec:
> > https://travis-ci.org/larsxschneider/git/jobs/85432398
> 
> Since the tests are essentially IO-bound and not CPU-bound, it may even
> make sense to use -j3 here.

I would like to caution against overloading Travis. They are really nice
to us, we should try to be nice to them, too.

Ciao,
Dscho

```

## Matthieu Moy, 2015-10-15 17:14

Subject: Re: [PATCH v3 1/3] Add Travis CI support
Message-ID: <vpq7fmoyryw.fsf@grenoble-inp.fr>
URL: https://gitlist.dev/e/vpq7fmoyryw.fsf%40grenoble-inp.fr
In-Reply-To: <alpine.DEB.1.00.1510151247550.31610@s15462909.onlinehome-server.info>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On Thu, 15 Oct 2015, Matthieu Moy wrote:
>
>> Since the tests are essentially IO-bound and not CPU-bound, it may even
>> make sense to use -j3 here.
>
> I would like to caution against overloading Travis. They are really nice
> to us, we should try to be nice to them, too.

Right.

Using a bit of parallelism shouldn't harm (we put a heavier load on
them, but for a shorter time), so using -j2 or -j3 seems OK to me, but I
wouldn't go higher to remain gentle with Travis CI.

Note: I'm writting this without having a real idea of what consequence
of -jN have on their infrastructure, take my writing as wild guess, not
as real arguments.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

```
