Commit Graph

81 Commits

Author SHA1 Message Date
Patrick Steinhardt
f8974af4f1 ci: remove unused old ci scripts
(cherry picked from commit 24d175621b)
2018-10-19 13:47:12 +02:00
Edward Thomson
564b9a0571 ci: move travis to the new scripts
(cherry picked from commit 24b8dd8275)
2018-10-19 13:46:16 +02:00
Edward Thomson
bac92335d9 ci: move appveyor to new scripts
(cherry picked from commit 465f8b5163)
2018-10-19 13:46:16 +02:00
Edward Thomson
db7586b384 ci: enable leak checking on osx
(cherry picked from commit b00672b9e4)
2018-10-19 13:46:16 +02:00
Edward Thomson
62222191aa tests: simplify cmake test configuration
Simplify the names for the tests, removing the unnecessary
"libgit2-clar" prefix.  Make "all" the new default test run, and include
the online tests by default (since HTTPS should always be enabled).

For the CI tests, create an offline-only test, then the various online
tests.

(cherry picked from commit ce798b256b)
2018-10-19 13:46:15 +02:00
Etienne Samson
8c9417d583 scripts: remove extraneous semicolons
(cherry picked from commit 149790b96e)
2018-10-19 13:39:05 +02:00
Etienne Samson
f9e90168cb scripts: use leaks on macOS
(cherry picked from commit 4c969618f6)
2018-10-19 13:39:05 +02:00
Etienne Samson
48c932c294 valgrind: bump num-callers to 50 for fuller stack traces
(cherry picked from commit 0fb8c1d09c)
2018-10-19 13:39:05 +02:00
Etienne Samson
731156a575 travis: let cmake perform the build & install step
The goal is to let cmake manage the parallelism

(cherry picked from commit 1f4ada2a42)
2018-10-19 13:39:05 +02:00
Etienne Samson
b2233a6590 valgrind: skip buf::oom test
(cherry picked from commit 573c408921)
2018-10-19 13:39:05 +02:00
Etienne Samson
37dce72159 travis: split valgrind check in its own script
(cherry picked from commit 74b0a43207)
2018-10-19 13:39:05 +02:00
Etienne Samson
af56c98ec3 travis: split testing from building
(cherry picked from commit 2f4e7cb0e8)
2018-10-19 13:39:05 +02:00
Patrick Steinhardt
758a3168b3 tests: create new test target for all SSH-based tests
Some tests shall be run against our own SSH server we spin up in Travis.
As those need to be run separate from our previous tests which run
against git-daemon, we have to do this in a separate step. Instead of
bundling all that knowledge in the CI script, move it into the test
build instructions by creating a new test target.

(cherry picked from commit 5874e151d7)
2018-10-19 13:34:11 +02:00
Patrick Steinhardt
2362ce6ce9 tests: online::clone: inline creds-test with nonexistent URL
Right now, we test our credential callback code twice, once via SSH on
localhost and once via a non-existent GitHub repository. While the first
URL makes sense to be configurable, it does not make sense to hard-code
the non-existing repository, which requires us to call tests multiple
times. Instead, we can just inline the URL into another set of tests.

(cherry picked from commit 54a1bf057a)
2018-10-19 13:33:09 +02:00
Patrick Steinhardt
a1a495f21e tests: online::clone: construct credential-URL from environment
We support two types of passing credentials to the proxy, either via the
URL or explicitly by specifying user and password. We test these types
by modifying the proxy URL and executing the tests twice, which is
in fact unnecessary and requires us to maintain the list of environment
variables and test executions across multiple CI infrastructures.

To fix the situation, we can just always pass the host, port, user and
password to the tests. The tests can then assemble the complete URL
either with or without included credentials, allowing us to test both
cases in-process.

(cherry picked from commit fea6092079)
2018-10-19 13:32:12 +02:00
Edward Thomson
0c51ecf2ac travis: add custom apt sources
Move back to Travis's VM infrastructure for efficiency.

(cherry picked from commit 9dc21efdbf)
2018-10-19 13:19:00 +02:00
Carlos Martín Nieto
9343482873 travis: let's try a 5GB ramdisk
(cherry picked from commit 71ba464435)
2018-10-19 13:12:31 +02:00
Carlos Martín Nieto
4eecbdd0be travis: put clar's sandbox in a ramdisk on macOS
The macOS tests are by far the slowest right now. This attempts to remedy the
situation somewhat by asking clar to put its test data on a ramdisk.

(cherry picked from commit 37bb15122e)
2018-10-19 13:12:31 +02:00
Patrick Steinhardt
1c85bcd8b9 appveyor: build examples
By default, CMake will not build our examples directory. As we do not
instruct either the MinGW or MSVC builds on AppVeyor to enable building
these examples, we cannot verify that those examples at least build on
Windows systems.

Fix that by passing `-DBUILD_EXAMPLES=ON` to AppVeyor's CMake
invocation.

(cherry picked from commit 0b98a66baa)
2018-10-19 13:11:44 +02:00
Edward Thomson
dc413239ab travis: only install custom libcurl on trusty
(cherry picked from commit c582fa4eb6)
2018-10-19 13:11:40 +02:00
Edward Thomson
7d1c72a468 travis: only kill our own sshd
(cherry picked from commit 697583ea3a)
2018-10-19 13:11:40 +02:00
Edward Thomson
16957a7fe6 travis: build with patched libcurl
Ubuntu trusty has a bug in curl when using NTLM credentials in a proxy,
dereferencing a null pointer and causing segmentation faults.  Use a
custom-patched version of libcurl that avoids this issue.

(cherry picked from commit f031e20b51)
2018-10-19 13:10:14 +02:00
Patrick Steinhardt
76a7d5f172 travis: cibuild: set up our own sshd server
Some tests of ours require to be running against an SSH server.
Currently, we simply run against the SSH server provided and started by
Travis itself. As our Linux tests run in a sudo-less environment, we
have no control over its configuration and startup/shutdown procedure.
While this has been no problem until now, it will become a problem as
soon as we migrate over to newer Precise images, as the SSH server does
not have any host keys set up. Luckily, we can simply set up our own
unpriviledged SSH server. This has the benefit of us being able to
modify its configuration even in a sudo-less environment.

This commit sets up the unpriviledged SSH server on port 2222.

(cherry picked from commit 06619904a2)
2018-10-19 13:09:38 +02:00
Patrick Steinhardt
96d0298921 travis: replace use of deprecated homebrew/dupes tap
The formulae provided by the homebrew/dupes tap are deprecated since at
least April 4, 2017, with formulae having been migrated to
homebrew/core.

Replace the deprecated reference to "homebrew/dupes/zlib" with only
"zlib".
2017-06-13 08:13:48 +02:00
Edward Thomson
844e85f21d travis: install openssl explicitly 2017-06-12 20:00:21 +01:00
Edward Thomson
408a7b7737 appveyor: don't rewrite system mingw
Download mingw-w64 into our build directory and execute it there, don't
try to overwrite the system's mingw.
2017-02-24 20:25:45 +00:00
Patrick Steinhardt
18c18e3df8 coverity: check for Coverity token only if necessary
When running a Coverity build, we have to provide an
authentication token in order to proof that we are actually
allowed to run analysis in the name of a certain project. As this
token should be secret, it is only set on the main repository, so
when we were requested to run the Coverity script on another
repository we do error out. But in fact we do also error out if
the Coverity analysis should _not_ be run if there is no
authentication token provided.

Fix the issue by only checking for the authentication token after
determining if analysis is indeed requested.
2016-10-31 16:01:10 +01:00
Patrick Steinhardt
561276eed6 coverity: only analyze the master branch of the main repository
We used to only execute Coverity analysis on the 'development'
branch before commit 998f001 (Refine build limitation,
2014-01-15), which refined Coverity build limitations. While we
do not really use the 'development' branch anymore, it does
still make sense to only analyze a single branch, as otherwise
Coverity might get confused.

Re-establish the restriction such that we only analyze libgit2's
'master' branch. Also fix the message announcing why we do not
actually analyze a certain build.
2016-10-28 14:56:10 +02:00
Patrick Steinhardt
6c4d2d3ea2 coverity: fix download URL 2016-10-28 14:45:55 +02:00
Patrick Steinhardt
ec3f5a9c20 script: cibuild: build examples 2016-10-10 09:04:42 +02:00
Carlos Martín Nieto
db357667bc travis: take the newer ssh-keygen format into account
The Mac machines have updated their SSH version and so the ssh-keygen
format has changed. Ask it for MD5, which is the one that is output as
hex.
2016-10-05 20:23:58 +02:00
Carlos Martín Nieto
94d565b957 cibuild: set -x
This lets us see the details of what we're doing instead of just seeing the
output of unknown commands in the build output.
2016-10-05 18:52:43 +02:00
Edward Thomson
a37624ecc7 Merge pull request #3815 from pks-t/pks/coverity-model
Coverity user model
2016-07-24 16:05:17 -04:00
Edward Thomson
0239eff354 ci: install homebrew's curl on mac 2016-07-24 14:54:40 -04:00
Edward Thomson
08556e6db3 ci: install homebrew's zlib on mac 2016-07-22 21:10:25 -04:00
Patrick Steinhardt
4d8fe1cda0 coverity: model functions printing into git_buf
The `git_buf` structure seems to be too complicated to correctly
grasp for Coverity. As such, add simpler models trying to guide
Coverity and remove false positives related to these functions.
2016-06-07 09:22:02 +02:00
Patrick Steinhardt
956f1e2387 coverity: add user model
The static analysis engine coverity allows for user models
overriding how it treats functions when analyzing code. Like
this, one can greatly reduce the rate of false positives and thus
make it easier to spot actual errors.

Add a user model that overrides function models for `git_buf_len`
and `git_vector_insert`, which together amount for a majority of
false positives.
2016-06-07 09:20:51 +02:00
Carlos Martín Nieto
db01724fd9 CI: start the proxy before the build so it's ready
It takes a bit for the propxy to get ready to accept connections, so
start it before the build so we can be reasonably sure that it's going
to be ready in time.
2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
2f3f1ee085 proxy: test proxy support on Travis 2016-04-19 13:54:19 +02:00
Carlos Martín Nieto
4848dd326a Merge pull request #3647 from pks-t/pks/coverity-fixes-round6
Coverity fixes round 6
2016-03-14 17:45:15 +01:00
Carlos Martín Nieto
b1093e62d5 Remove CI support for mingw32
The tests have never run successfully and we do have successful builds
of mingw-w64, so remove these CI builds which do not add value.
2016-03-14 11:05:58 +01:00
Patrick Steinhardt
2615d0d694 coverity: report errors when uploading tarball
Curl by default does not report errors by setting the error code.
As the upload can fail through several conditions (e.g. the rate
limit, leading to unauthorized access) we should indicate this
information in Travis CI.

To improve upon the behavior, use `--write-out=%{http_code}` to
write out the HTTP code in addition to the received body and
return an error if the code does not equal 201.
2016-03-11 13:31:12 +01:00
Carlos Martín Nieto
ba9bb664f3 tests: create a ctest target for cred_callback 2016-03-03 19:31:02 +01:00
Carlos Martín Nieto
2520573778 test: make sure we retry the auth callback on all platforms
We were missing this test on Windows, which meant we didn't notice that
we never fixed the single authentication attempt it tries, nor its wrong
return code.

Enable this for the unix platforms as well over HTTP. We previously were
doing it locally but disabled it on OS X due to issues with its sshd not
accepting password authentication.
2016-03-03 11:18:03 +01:00
Patrick Steinhardt
859ed5ddc7 common: introduce GITERR_CHECK_ALLOC_BUF
We commonly have to check if a git_buf has been allocated
correctly or if we ran out of memory. Introduce a new macro
similar to `GITERR_CHECK_ALLOC` which checks if we ran OOM and if
so returns an error. Provide a `#nodef` for Coverity to mark the
error case as an abort path.
2016-02-23 11:50:23 +01:00
Patrick Steinhardt
f2a554b45e coverity: hint git_vector_foreach does not deref NULL contents
Coverity does not comprehend the connection between a vector's
size and the contents pointer, that is that the vector's pointer
is non-NULL when its size is positive. As the vector code should
be reasonably well tested and users are expected to not manually
modify a vector's contents it seems save to assume that the
macros will never dereference a NULL pointer.

Fix Coverity warnings by overriding the foreach macros with
macros that explicitly aborting when (v)->contents is NULL.
2016-02-23 11:50:23 +01:00
Patrick Steinhardt
40f6f22517 coverity: hint that string length is at least 2
When checking if a string is prefixed by a drive letter (e.g.
"C:") we verify this by inspecting the first and second character
of the string. Coverity thinks this is a defect as we do not
check the string's length first, but in fact we only check the
second character if the first character is part of the alphabet,
that is it cannot be '\0'.

Fix this by overriding the macro and explicitly checking the
string's length.
2016-02-18 20:50:33 +01:00
Patrick Steinhardt
5981ab1d70 coverity: add nodefs for abort macros
Add nodefs for macros that abort the current flow due to errors.
This includes macros that trigger on integer overflows and for
the version check macro. This aids Coverity as we point out that
these paths will cause a fatal error.
2016-02-18 20:50:33 +01:00
Patrick Steinhardt
50174ab459 coverity: use https URL for posting build
When posting our instrumented build results to Coverity we have
to include sensitive information, in particular our authorization
token. Currently we use an unencrypted channel to post this
information, leading to the token being transferred in plain.

Fix this by using a secured connection instead.
2016-02-10 11:06:23 +01:00
Patrick Steinhardt
8dddea42aa coverity: provide nodef for GITERR_CHECK_ALLOC
Coverity currently lists a lot of errors with regard to
GITERR_CHECK_ALLOC causing resource leaks. We know this macro is
only invoked when we want to abort because we are out of memory.

Coverity allows for overriding the default model where we know
that certain functions guarantee a desired behavior. The
user_nodefs.h is used to override the behavior of macros.
Re-define GITERR_CHECK_ALLOC inside of it to specify its abort
nature.
2016-02-10 10:59:14 +01:00