Commit Graph

107 Commits

Author SHA1 Message Date
Edward Thomson
fad9042897 streams: sockets are non-blocking and can timeout
Make socket I/O non-blocking and add optional timeouts.

Users may now set `GIT_OPT_SET_SERVER_CONNECT_TIMEOUT` to set a shorter
connection timeout. (The connect timeout cannot be longer than the
operating system default.) Users may also now configure the socket read
and write timeouts with `GIT_OPT_SET_SERVER_TIMEOUT`.

By default, connects still timeout based on the operating system
defaults (typically 75 seconds) and socket read and writes block.

Add a test against our custom testing git server that ensures that we
can timeout reads against a slow server.
2023-05-13 16:42:04 +01:00
Edward Thomson
933b04c219 ci: update to poxygit v0.6.0
v0.6.0 of poxygit add support for throttling connections to test
timeouts and low-bandwidth situations.
2023-05-13 16:42:04 +01:00
Edward Thomson
80742e159c Merge pull request #6456 from libgit2/ethomson/sha256_experimental
SHA256: more SHA256 support
2023-02-14 17:01:23 +00:00
Edward Thomson
e3cd859150 ci: build our own git on xenial
The git included with xenial is ancient, and lacks sha256 support.
2023-02-13 10:27:13 +00:00
Edward Thomson
0006ff6335 clone: support sha256 2023-02-12 22:02:00 +00:00
Edward Thomson
b857122f16 ci: convert PATH correctly to Cygwin format on Windows
We provide `BUILD_PATH` to our build script; provide it and mutate
`PATH` when running our tests as well.

We were previously using `cygpath` to try to convert a _list_ of Windows
paths into cygwin / Unix style `PATH` format. This does not work -- it
treats the path list as a single path (with semicolons -- understandably
as those are allowed characters in a Windows path).

For example, `C:\One;C:\Two;C:\Three` is converted to
`/c/one;c:/two;c:/three`.

Add a new function to convert path lists, so that paths are split by
semicolon and fed to `cygpath` independently, then re-joined with a
colon. This means that our example `C:\One;C:\Two;C:\Three` is correctly
converted to `/c/one:/c/two:/c/three`.
2023-02-09 12:10:40 +00:00
Edward Thomson
a7bc32edd5 ci: limit test runner to build path
We provide `BUILD_PATH` to our build script; provide it and mutate
`PATH` when running our tests as well.
2023-02-09 12:10:40 +00:00
Edward Thomson
d1411ed856 ci: compile against libssh2 on windows 2023-02-09 12:10:40 +00:00
Edward Thomson
5288aa301c ci: use latest ci-dependencies release for mingw 2023-02-09 12:10:40 +00:00
Edward Thomson
ea4ce92aea ci: isolate the home directory for test execution
libgit2 can now isolate its home directory, and our test runner (by
default) isolates the home directory. In our CI environment, we want to
set up some pieces (like ssh configuration) in a fake homedir. Continue
to do so and propagate that to clar.
2023-02-09 12:10:40 +00:00
Carlos Martín Nieto
c29651fe8b tests: append the github.com ssh keys so we have access during tests
Currently just the one test needs it.

The ssh-rsa makes sure we're asking for the cipher we find in `known_hosts` as
that won't be the one selected by default. This will be relevant in later changes.
2022-11-04 10:33:37 +01:00
Edward Thomson
cf326948b1 clone: test for cloning a repo with namespace scope
Test that we can successfully clone a repository that is namespace
scoped on the remote and does not advertise a HEAD. To do this, we must
specify the branch to checkout.
2022-09-19 05:07:16 -04:00
Edward Thomson
9d9a90ad3d clone: test bare clone namespaced repo with no HEAD
Test that we can successfully clone a repository that is namespace
scoped to a bare repository locally. We need not specify a checkout
branch in this case (obviously, since we do not check anything out in a
bare clone).
2022-09-19 05:07:16 -04:00
Edward Thomson
ebb0830c65 ci: clean up daemon processes on exit
We previously (correctly) cleaned up the git daemon and SSH server, but
failed to clean up our bespoke HTTP server and HTTP proxies. Capture
their PIDs on process creation and kill them when we shut down.
2022-09-16 10:46:18 -04:00
Edward Thomson
5afc146a6f ci: update dockerfiles for mbedTLS new url
Update the new URL for mbedTLS.
2022-07-06 13:10:33 -04:00
Edward Thomson
06b32a3f74 ci: move centos8 to centos stream
CentOS 8 is no longer supported; use CentOS stream.
2022-04-20 14:45:52 -04:00
Edward Thomson
926efbd296 ci: use the runner's uid/gid
Use the runner's uid/gid for the containers for sanity when sharing
files across volumes.
2022-04-20 14:45:52 -04:00
Edward Thomson
2ee753a295 ci: some debugging output for containers 2022-04-19 11:55:49 -04:00
Edward Thomson
4c6eab99a7 ci: run benchmark tests nightly 2022-02-27 23:44:19 -05:00
Edward Thomson
e48bb3b708 ci: allow for build-time (cmake --build) options
Allow for options in the `cmake --build` phase, so that callers can
specify (eg) the config type.
2022-02-27 23:44:19 -05:00
Edward Thomson
cfdf36f989 ci: rename build setup scripts
Rename our build setup scripts to include the `build` name so that we
can add additional CI setup scripts with no ambiguity.
2022-02-27 23:44:19 -05:00
Edward Thomson
d02f4f7ad7 cmake: refactor add_clar_test into separate module 2022-02-22 22:07:45 -05:00
Edward Thomson
e6d93612e8 refactor: move utility tests into util 2022-02-22 22:07:45 -05:00
Edward Thomson
6913422323 ci: test [user@host:port]:path formats 2022-01-17 21:06:06 -05:00
Edward Thomson
f4fec25182 ci: minor formatting cleanups to test output 2022-01-13 16:55:36 -05:00
Edward Thomson
515daeaf4d remote: introduce follow_redirects connect option
Give callers the ability to select how to handle redirects - either
supporting redirects during the initial connection (so that, for
example, `git.example.com/repo` can redirect to `github.com/example/repo`)
or all/no redirects.  This is for compatibility with git.
2022-01-13 21:34:20 +00:00
Edward Thomson
c104a56536 ci: stop retrying "flaky" tests
We (thankfully) don't have flaky tests anymore, don't retry them.
2022-01-13 09:36:08 -05:00
Edward Thomson
cd261af218 ci: use poxygit v0.5.1
The new version of our test git server adds redirect support.  Upgrade
to it.
2022-01-13 09:03:00 -05:00
Edward Thomson
825dd544ab ci: pull libssh2 from www.libssh2.org
libssh2.org and www.libssh2.org were previously identical; now this is a
redirect.
2021-09-21 12:02:01 -04:00
Edward Thomson
0e04726866 opts: test GIT_OPT_SET_SSL_CERT_LOCATIONS
Include a self-signed certificate for test.libgit2.org:1443 that we can
use to verify that GIT_OPT_SET_SSL_CERT_LOCATIONS works.
2021-08-29 21:52:30 -04:00
Edward Thomson
a5d6a5768f ci: stop on test failure 2021-08-29 21:01:49 -04:00
Edward Thomson
dbcb1cd746 ci: update container versions
Update all the container versions to force a rebuild so that they'll get
tagged with latest (due to changes in the CI scripts).
2021-08-23 15:04:35 -04:00
Edward Thomson
ecdb41f911 ci: update centos to find libssh2 2021-08-21 08:18:25 -04:00
Edward Thomson
a42577db27 ci: update centos builds 2021-08-16 14:09:17 -04:00
Edward Thomson
d4416624fa ci: update centos builds 2021-08-16 13:49:38 -04:00
Edward Thomson
5ad53ec762 ci: update centos builds 2021-08-15 23:19:54 -04:00
Edward Thomson
1ebdb6f203 ci: update centos7 and centos8 build 2021-08-15 22:53:19 -04:00
Edward Thomson
e6c9fcf08d ci: add centos7 and centos8 docker definitions 2021-08-15 17:17:58 -04:00
Edward Thomson
b140e22e2e ci: remove the docker entrypoint
Omitting an entrypoint.sh to configure the container and instead
depending on docker primitives allows us to be more portable.  (If a
distribution uses a different mechanism for adding users, we need not
have multiple entrypoint.sh files or invariants within it; instead we
can configure that in the dockerfile itself along with all the other
distribution specific components.)
2021-08-09 08:42:34 -04:00
Edward Thomson
7ad81a42a2 ci: use GitHub for storing mingw-w64 build dependency 2021-05-04 12:23:17 +01:00
Edward Thomson
75888f273e ci: don't use ninja on macOS
Ninja is not installed by default on the macOS machines; stop trying to
use it.  Instead use `make -j` which should be roughly equivalent in
performance but supported everywhere.
2021-01-15 12:12:07 +00:00
Miguel Arroz
8dc0ba75f0 Change libssh2 version to 1.9.0 on focal 2020-12-21 21:31:50 -08:00
Edward Thomson
5a9d16dceb ci: support multi-arch docker builds
Provide the base to our docker images and run with the QEMU docker
support optionally.
2020-11-23 23:08:23 +00:00
Edward Thomson
9f8802d3ea ci: add krb5 to bionic container 2020-11-23 20:22:07 +00:00
Edward Thomson
3d6b90359d ci: stop using deprecated set-env in GitHub Actions
(And move the ci scripts into the `ci` directory.)
2020-11-18 18:08:23 +00:00
Patrick Steinhardt
ffac520e83 azure: move build scripts into "azure-pipelines" directory
Since we have migrated to Azure Pipelines, we have deprecated and
subsequentally removed all infrastructure for AppVeyor and
Travis. Thus it doesn't make a lot of sense to have the split
between "ci/" and "azure-pipelines/" directories anymoer, as
"azure-pipelines/" is essentially our only CI.

Move all CI scripts into the "azure-pipelines/" directory to have
everything centrally located and to remove clutter in the
top-level directory.
2019-07-20 19:10:10 +02:00
Patrick Steinhardt
d827b11b67 tests: execute leak checker via CTest directly
Right now, we have an awful hack in our test CI setup that extracts the
test command from CTest's output and then prepends the leak checker.
This is dependent on non-machine-parseable output from CMake and also
breaks on various ocassions, like for example when we have spaces in the
current path or when the path contains backslashes. Both conditions may
easily be triggered on Win32 systems, and in fact they do break our
Azure Pipelines builds.

Remove the awful hack in favour of a new CMake build option
"USE_LEAK_CHECKER". If specifying e.g. "-DUSE_LEAK_CHECKER=valgrind",
then we will set up all tests to be run under valgrind. Like this, we
can again simply execute ctest without needing to rely on evil sourcery.
2019-07-20 19:10:10 +02:00
Patrick Steinhardt
86ecd6008d fuzzers: provide test targets
Instead of having to find the fuzzer executables in our Azure test
scripts, provide test targets for each of our fuzzers that will
run them with the correct paths.
2019-07-20 19:10:10 +02:00
Patrick Steinhardt
eb27fb9bdb ci: build fuzzers on Powershell based build jobs
In order to guarantee that our fuzzers build just fine on the Windows
platform, let's enable building fuzzers on all Powershell-based builds.
2019-07-05 11:59:17 +02:00
Edward Thomson
6b2240542a ci: build with ENABLE_WERROR on Windows
Build with -Werror's equivalent (/WX) on MSVC
2019-06-25 14:41:36 +01:00