threads / patch / 40532

v3, 3 partsAdd Travis CI support

Subject: [PATCH v3 1/3] Add Travis CI support

## tl;dr

29 messages between Oct 11, 2015 and Oct 15, 2015. Diffs are folded; open one to read it.

replies: 28people: 8as markdown or json

larsxschneider@gmail.com· Oct 11, 2015, 17:54 UTC · lore

[PATCH v3 0/3] Add Travis CI support

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· Oct 11, 2015, 17:55 UTC · re: larsxschneider@gmail.com · lore
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
Show changes to .travis.yml +46 −0
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
Eric Sunshine· Oct 11, 2015, 20:40 UTC · re: larsxschneider@gmail.com · lore

Re: [PATCH v3 1/3] Add Travis CI support

On Sun, Oct 11, 2015 at 1:55 PM,  <larsxschneider@gmail.com> wrote:
Show 45 quoted lines
> 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"?
Show 19 quoted lines
> +        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
Lars Schneider· Oct 12, 2015, 16:46 UTC · re: Eric Sunshine · lore

Re: [PATCH v3 1/3] Add Travis CI support

>> +      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

Sebastian Schuberth· Oct 12, 2015, 08:05 UTC · re: larsxschneider@gmail.com · lore

Re: [PATCH v3 1/3] Add Travis CI support

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"?

Show 5 quoted lines
> +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· Oct 12, 2015, 16:02 UTC · re: Sebastian Schuberth · lore

Re: [PATCH v3 1/3] Add Travis CI support

Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 7 quoted lines
> 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.
Sebastian Schuberth· Oct 12, 2015, 18:42 UTC · re: Junio C Hamano · lore

Re: [PATCH v3 1/3] Add Travis CI support

On Mon, Oct 12, 2015 at 6:02 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
>> 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
Lars Schneider· Oct 12, 2015, 19:40 UTC · re: Junio C Hamano · lore

Re: [PATCH v3 1/3] Add Travis CI support

On 12 Oct 2015, at 09:02, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> 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.
Show 5 quoted lines
> 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

Sebastian Schuberth· Oct 12, 2015, 19:48 UTC · re: Lars Schneider · lore

Re: [PATCH v3 1/3] Add Travis CI support

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

Show 12 quoted lines
>> 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
Matthieu Moy· Oct 12, 2015, 20:10 UTC · re: Lars Schneider · lore

Re: [PATCH v3 1/3] Add Travis CI support

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/
Lars Schneider· Oct 12, 2015, 17:12 UTC · re: Sebastian Schuberth · lore

Re: [PATCH v3 1/3] Add Travis CI support

On 12 Oct 2015, at 01:05, Sebastian Schuberth <sschuberth@gmail.com> wrote:
Show 9 quoted lines
> 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!
Show 12 quoted lines
> 
>> +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· Oct 12, 2015, 19:37 UTC · re: Lars Schneider · lore

Re: [PATCH v3 1/3] Add Travis CI support

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

Show 13 quoted lines
>>> +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· Oct 12, 2015, 19:43 UTC · re: Sebastian Schuberth · lore

Re: [PATCH v3 1/3] Add Travis CI support

On 12 Oct 2015, at 12:37, Sebastian Schuberth <sschuberth@gmail.com> wrote:
Show 19 quoted lines
> 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!
Show 16 quoted lines
> 
>> 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· Oct 12, 2015, 19:53 UTC · re: Lars Schneider · lore

Re: [PATCH v3 1/3] Add Travis CI support

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

Show 12 quoted lines
>> 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· Oct 12, 2015, 20:20 UTC · re: larsxschneider@gmail.com · lore

Re: [PATCH v3 1/3] Add Travis CI support

larsxschneider@gmail.com writes:
Show 28 quoted lines
> --- /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/
Lars Schneider· Oct 14, 2015, 22:52 UTC · re: Matthieu Moy · lore

Re: [PATCH v3 1/3] Add Travis CI support

On 12 Oct 2015, at 22:20, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 41 quoted lines
> 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
Matthieu Moy· Oct 15, 2015, 08:07 UTC · re: Lars Schneider · lore

Re: [PATCH v3 1/3] Add Travis CI support

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/
Jean-Noël Avila· Oct 15, 2015, 09:02 UTC · re: Lars Schneider · lore

Re: [PATCH v3 1/3] Add Travis CI support

Le 15/10/2015 00:52, Lars Schneider a écrit :
Show 47 quoted lines
> 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
Jean-Noël Avila· Oct 13, 2015, 10:32 UTC · re: larsxschneider@gmail.com · lore

Re: [PATCH v3 1/3] Add Travis CI support

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· Oct 15, 2015, 07:59 UTC · re: Jean-Noël Avila · lore

Re: [PATCH v3 1/3] Add Travis CI support

On 13 Oct 2015, at 12:32, Jean-Noël Avila <avila.jn@gmail.com> wrote:
Show 13 quoted lines
> 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· Oct 15, 2015, 08:12 UTC · re: Lars Schneider · lore

Re: [PATCH v3 1/3] Add Travis CI support

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.

Show 5 quoted lines
> 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/
Lars Schneider· Oct 15, 2015, 10:35 UTC · re: Matthieu Moy · lore

Re: [PATCH v3 1/3] Add Travis CI support

On 15 Oct 2015, at 10:12, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 12 quoted lines
> 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!
Show 8 quoted lines
>> 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· Oct 15, 2015, 10:50 UTC · re: Matthieu Moy · lore

Re: [PATCH v3 1/3] Add Travis CI support

Hi,
On Thu, 15 Oct 2015, Matthieu Moy wrote:
Show 12 quoted lines
> 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.

Show 8 quoted lines
> > 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· Oct 15, 2015, 17:14 UTC · re: Johannes Schindelin · lore

Re: [PATCH v3 1/3] Add Travis CI support

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 7 quoted lines
> 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/
larsxschneider@gmail.com· Oct 11, 2015, 17:55 UTC · re: larsxschneider@gmail.com · lore

[PATCH v3 2/3] git-p4: Improve test case portability for t9815 git-p4-submit-fail

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(-)
Show changes to t/t9815-git-p4-submit-fail.sh +2 −5
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· Oct 11, 2015, 17:55 UTC · re: larsxschneider@gmail.com · lore

[PATCH v3 3/3] git-p4: Skip t9819 test case on case insensitive file systems

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(+)
Show changes to t/t9819-git-p4-case-folding.sh +6 −0
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
Luke Diamand· Oct 12, 2015, 06:47 UTC · re: larsxschneider@gmail.com · lore

Re: [PATCH v3 3/3] git-p4: Skip t9819 test case on case insensitive file systems

Looks good to me, Ack.
On 11 October 2015 at 18:55,  <larsxschneider@gmail.com> wrote:
Show 35 quoted lines
> 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
Junio C Hamano· Oct 12, 2015, 16:07 UTC · re: larsxschneider@gmail.com · lore

Re: [PATCH v3 0/3] Add Travis CI support

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· Oct 12, 2015, 16:07 UTC · re: larsxschneider@gmail.com · lore

Re: [PATCH v3 0/3] Add Travis CI support

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.

← back to recent threads