[PATCH v3 0/3] Add Travis CI support

STALE3735d

Revision v3 of 6 in this series.

14 messages, 5 authors, 2016-06-15 · open the first message on its own page

[PATCH v3 0/3] Add Travis CI support

From: <hidden>
Date: 2016-06-15 23:06:49

From: Lars Schneider <redacted>

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

[PATCH v3 1/3] Add Travis CI support

From: <hidden>
Date: 2016-06-15 23:06:49

From: Lars Schneider <redacted>

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 <redacted>
---
 .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

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

From: <hidden>
Date: 2016-06-15 23:06:49

From: Lars Schneider <redacted>

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

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

From: <hidden>
Date: 2016-06-15 23:06:49

From: Lars Schneider <redacted>

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

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

From: Eric Sunshine <hidden>
Date: 2016-06-15 23:06:49

On Sun, Oct 11, 2015 at 1:55 PM,  [off-list ref] wrote:
quoted hunk
From: Lars Schneider <redacted>

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

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

From: Luke Diamand <hidden>
Date: 2016-06-15 23:06:49

Looks good to me, Ack.

On 11 October 2015 at 18:55,  [off-list ref] wrote:
quoted hunk
From: Lars Schneider <redacted>

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

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

From: Sebastian Schuberth <hidden>
Date: 2016-06-15 23:06:49

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

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

From: Lars Schneider <hidden>
Date: 2016-06-15 23:06:49

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

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

From: Lars Schneider <hidden>
Date: 2016-06-15 23:06:49

On 12 Oct 2015, at 01:05, Sebastian Schuberth [off-list ref] wrote:
On 10/11/2015 19:55, larsxschneider@gmail.com wrote:
quoted
+      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!
quoted
+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

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

From: Sebastian Schuberth <hidden>
Date: 2016-06-15 23:06:50

On Mon, Oct 12, 2015 at 7:12 PM, Lars Schneider
[off-list ref] wrote:
quoted
quoted
+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

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

From: Lars Schneider <hidden>
Date: 2016-06-15 23:06:50

On 12 Oct 2015, at 12:37, Sebastian Schuberth [off-list ref] wrote:
On Mon, Oct 12, 2015 at 7:12 PM, Lars Schneider
[off-list ref] wrote:
quoted
quoted
quoted
+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!
quoted
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

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

From: Sebastian Schuberth <hidden>
Date: 2016-06-15 23:06:50

On Mon, Oct 12, 2015 at 9:43 PM, Lars Schneider
[off-list ref] wrote:
quoted
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

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

From: Jean-Noël Avila <hidden>
Date: 2016-06-15 23:06:51

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.

 

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

From: Lars Schneider <hidden>
Date: 2016-06-15 23:06:52

On 13 Oct 2015, at 12:32, Jean-Noël Avila [off-list ref] wrote:
Le 11/10/2015 19:55, larsxschneider@gmail.com a écrit :
quoted
+
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help