Skip to content

Commit 5874e15

Browse files
committed
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.
1 parent 54a1bf0 commit 5874e15

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

script/cibuild.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,18 @@ else
8585
export GITTEST_REMOTE_SSH_FINGERPRINT=$(ssh-keygen -F '[localhost]:2222' -l | tail -n 1 | cut -d ' ' -f 2 | tr -d ':')
8686
fi
8787

88+
# Use the SSH server
8889
export GITTEST_REMOTE_URL="ssh://localhost:2222/$HOME/_temp/test.git"
8990
export GITTEST_REMOTE_USER=$USER
9091
export GITTEST_REMOTE_SSH_KEY="$HOME/.ssh/id_rsa"
9192
export GITTEST_REMOTE_SSH_PUBKEY="$HOME/.ssh/id_rsa.pub"
9293
export GITTEST_REMOTE_SSH_PASSPHRASE=""
94+
ctest -V -R libgit2_clar-ssh || exit $?
95+
9396
# Use the proxy we started at the beginning
9497
export GITTEST_REMOTE_PROXY_URL="localhost:8080"
9598
export GITTEST_REMOTE_PROXY_USER="foo"
9699
export GITTEST_REMOTE_PROXY_PASS="bar"
97-
98-
if [ -e ./libgit2_clar ]; then
99-
./libgit2_clar -sonline::push -sonline::clone::ssh_cert &&
100-
./libgit2_clar -sonline::clone::ssh_with_paths || exit $?
101-
102-
ctest -V -R libgit2_clar-proxy_credentials || exit $?
103-
fi
100+
ctest -V -R libgit2_clar-proxy_credentials || exit $?
104101

105102
kill $(cat "$HOME/sshd/pid")

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ ELSE ()
5858
ADD_TEST(libgit2_clar "${libgit2_BINARY_DIR}/libgit2_clar" -v -xclone::local::git_style_unc_paths -xclone::local::standard_unc_paths_are_written_git_style)
5959
ENDIF ()
6060

61-
# Add a test target which runs the cred callback tests, to be
62-
# called after setting the url and user
61+
# Add additional test targets that require special setup
6362
ADD_TEST(libgit2_clar-proxy_credentials "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline::clone::proxy_credentials_in_url -sonline::clone::proxy_credentials_request)
63+
ADD_TEST(libgit2_clar-ssh "${libgit2_BINARY_DIR}/libgit2_clar" -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths)

0 commit comments

Comments
 (0)