Skip to content

Commit

Permalink
CI: start the proxy before the build so it's ready
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
carlosmn committed Apr 19, 2016
1 parent bf6f7ad commit db01724
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ build_script:
test_script:
- ps: |
$ErrorActionPreference="Stop"
# Run this early so we know it's ready by the time we need it
Start-Job { java -jar $Env:APPVEYOR_BUILD_FOLDER\build\poxyproxy.jar -d --port 8080 --credentials foo:bar }
ctest -V -R libgit2_clar
$env:GITTEST_REMOTE_URL="https://github.com/libgit2/non-existent"
$env:GITTEST_REMOTE_USER="libgit2test"
ctest -V -R libgit2_clar-cred_callback
Start-Job { java -jar $Env:APPVEYOR_BUILD_FOLDER\build\poxyproxy.jar -d --port 8080 --credentials foo:bar }
ctest -V .
$env:GITTEST_REMOTE_PROXY_URL = "http://foo:bar@localhost:8080"
.\Debug\libgit2_clar.exe -sonline::clone::proxy_credentials_in_url
$env:GITTEST_REMOTE_PROXY_URL = "http://localhost:8080"
Expand Down
15 changes: 8 additions & 7 deletions script/cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ then
exit $?;
fi

# Should we ask Travis to cache this file?
curl -L https://github.com/ethomson/poxyproxy/releases/download/v0.1.0/poxyproxy-0.1.0.jar >poxyproxy.jar || exit $?
# Run this early so we know it's ready by the time we need it
java -jar poxyproxy.jar -d --port 8080 --credentials foo:bar &

mkdir _build
cd _build
# shellcheck disable=SC2086
Expand Down Expand Up @@ -50,24 +55,20 @@ export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub"
export GITTEST_REMOTE_SSH_PASSPHRASE=""


# Can we ask Travis to cache this file?
curl -L https://github.com/ethomson/poxyproxy/releases/download/v0.1.0/poxyproxy-0.1.0.jar >poxyproxy.jar || exit $?

if [ -e ./libgit2_clar ]; then
./libgit2_clar -sonline::push -sonline::clone::ssh_cert &&
./libgit2_clar -sonline::clone::ssh_with_paths || exit $?
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
./libgit2_clar -sonline::clone::cred_callback || exit $?
fi

java -jar poxyproxy.jar -d --port 8080 --credentials foo:bar &

# Use the proxy we started at the beginning
export GITTEST_REMOTE_PROXY_URL="http://foo:bar@localhost:8080/"
./libgit2_clar -sonline::clone::proxy_credentials_in_url
./libgit2_clar -sonline::clone::proxy_credentials_in_url || exit $?
export GITTEST_REMOTE_PROXY_URL="http://localhost:8080/"
export GITTEST_REMOTE_PROXY_USER="foo"
export GITTEST_REMOTE_PROXY_PASS="bar"
./libgit2_clar -sonline::clone::proxy_credentials_request
./libgit2_clar -sonline::clone::proxy_credentials_request || exit $?

fi

Expand Down

0 comments on commit db01724

Please sign in to comment.