Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
2f4e7cb0
Commit
2f4e7cb0
authored
Apr 20, 2018
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
travis: split testing from building
parent
54990d75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
74 deletions
+84
-74
.travis.yml
+1
-0
script/cibuild.sh
+0
-74
script/citest.sh
+83
-0
No files found.
.travis.yml
View file @
2f4e7cb0
...
...
@@ -74,6 +74,7 @@ install:
# Run the Build script and tests
script
:
-
script/cibuild.sh
-
script/citest.sh
# Run Tests
after_success
:
...
...
script/cibuild.sh
View file @
2f4e7cb0
...
...
@@ -21,82 +21,8 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
mount
-t
hfs
$device
$CLAR_TMP
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
cmake ..
-DBUILD_EXAMPLES
=
ON
-DCMAKE_INSTALL_PREFIX
=
../_install
$OPTIONS
||
exit
$?
make
-j2
install
||
exit
$?
# If this platform doesn't support test execution, bail out now
if
[
-n
"
$SKIP_TESTS
"
]
;
then
exit
$?
;
fi
# Create a test repo which we can use for the online::push tests
mkdir
"
$HOME
"
/_temp
git init
--bare
"
$HOME
"
/_temp/test.git
git daemon
--listen
=
localhost
--export-all
--enable
=
receive-pack
--base-path
=
"
$HOME
"
/_temp
"
$HOME
"
/_temp 2>/dev/null &
export
GITTEST_REMOTE_URL
=
"git://localhost/test.git"
# Run the test suite
ctest
-V
-R
libgit2_clar
||
exit
$?
# Now that we've tested the raw git protocol, let's set up ssh to we
# can do the push tests over it
killall git-daemon
# Set up sshd
mkdir ~/sshd/
cat
>
~/sshd/sshd_config
<<-
EOF
Port 2222
ListenAddress 0.0.0.0
Protocol 2
HostKey
${
HOME
}
/sshd/id_rsa
PidFile
${
HOME
}
/sshd/pid
RSAAuthentication yes
PasswordAuthentication yes
PubkeyAuthentication yes
ChallengeResponseAuthentication no
# Required here as sshd will simply close connection otherwise
UsePAM no
EOF
ssh-keygen
-t
rsa
-f
~/sshd/id_rsa
-N
""
-q
/usr/sbin/sshd
-f
~/sshd/sshd_config
# Set up keys
ssh-keygen
-t
rsa
-f
~/.ssh/id_rsa
-N
""
-q
cat
~/.ssh/id_rsa.pub
>>
~/.ssh/authorized_keys
while
read
algorithm key comment
;
do
echo
"[localhost]:2222
$algorithm
$key
"
>>
~/.ssh/known_hosts
done
<~/sshd/id_rsa.pub
# Get the fingerprint for localhost and remove the colons so we can parse it as
# a hex number. The Mac version is newer so it has a different output format.
if
[
"
$TRAVIS_OS_NAME
"
=
"osx"
]
;
then
export
GITTEST_REMOTE_SSH_FINGERPRINT
=
$(
ssh-keygen
-E
md5
-F
'[localhost]:2222'
-l
| tail
-n
1 | cut
-d
' '
-f
3 | cut
-d
:
-f2-
| tr
-d
:
)
else
export
GITTEST_REMOTE_SSH_FINGERPRINT
=
$(
ssh-keygen
-F
'[localhost]:2222'
-l
| tail
-n
1 | cut
-d
' '
-f
2 | tr
-d
':'
)
fi
# Use the SSH server
export
GITTEST_REMOTE_URL
=
"ssh://localhost:2222/
$HOME
/_temp/test.git"
export
GITTEST_REMOTE_USER
=
$USER
export
GITTEST_REMOTE_SSH_KEY
=
"
$HOME
/.ssh/id_rsa"
export
GITTEST_REMOTE_SSH_PUBKEY
=
"
$HOME
/.ssh/id_rsa.pub"
export
GITTEST_REMOTE_SSH_PASSPHRASE
=
""
ctest
-V
-R
libgit2_clar-ssh
||
exit
$?
# Use the proxy we started at the beginning
export
GITTEST_REMOTE_PROXY_URL
=
"localhost:8080"
export
GITTEST_REMOTE_PROXY_USER
=
"foo"
export
GITTEST_REMOTE_PROXY_PASS
=
"bar"
ctest
-V
-R
libgit2_clar-proxy_credentials
||
exit
$?
kill
$(
cat
"
$HOME
/sshd/pid"
)
script/citest.sh
0 → 100755
View file @
2f4e7cb0
#!/bin/sh
set
-x
# If this platform doesn't support test execution, bail out now
if
[
-n
"
$SKIP_TESTS
"
]
;
then
exit
$?
;
fi
if
[
!
-d
_build
]
;
then
echo
"no _build dir found; you should run cibuild.sh first"
exit
1
fi
cd
_build
# 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 &
# Create a test repo which we can use for the online::push tests
mkdir
"
$HOME
"
/_temp
git init
--bare
"
$HOME
"
/_temp/test.git
git daemon
--listen
=
localhost
--export-all
--enable
=
receive-pack
--base-path
=
"
$HOME
"
/_temp
"
$HOME
"
/_temp 2>/dev/null &
export
GITTEST_REMOTE_URL
=
"git://localhost/test.git"
# Run the test suite
ctest
-V
-R
libgit2_clar
||
exit
$?
# Now that we've tested the raw git protocol, let's set up ssh to we
# can do the push tests over it
killall git-daemon
# Set up sshd
mkdir ~/sshd/
cat
>
~/sshd/sshd_config
<<-
EOF
Port 2222
ListenAddress 0.0.0.0
Protocol 2
HostKey
${
HOME
}
/sshd/id_rsa
PidFile
${
HOME
}
/sshd/pid
RSAAuthentication yes
PasswordAuthentication yes
PubkeyAuthentication yes
ChallengeResponseAuthentication no
# Required here as sshd will simply close connection otherwise
UsePAM no
EOF
ssh-keygen
-t
rsa
-f
~/sshd/id_rsa
-N
""
-q
/usr/sbin/sshd
-f
~/sshd/sshd_config
# Set up keys
ssh-keygen
-t
rsa
-f
~/.ssh/id_rsa
-N
""
-q
cat
~/.ssh/id_rsa.pub
>>
~/.ssh/authorized_keys
while
read
algorithm key comment
;
do
echo
"[localhost]:2222
$algorithm
$key
"
>>
~/.ssh/known_hosts
done
<~/sshd/id_rsa.pub
# Get the fingerprint for localhost and remove the colons so we can parse it as
# a hex number. The Mac version is newer so it has a different output format.
if
[
"
$TRAVIS_OS_NAME
"
=
"osx"
]
;
then
export
GITTEST_REMOTE_SSH_FINGERPRINT
=
$(
ssh-keygen
-E
md5
-F
'[localhost]:2222'
-l
| tail
-n
1 | cut
-d
' '
-f
3 | cut
-d
:
-f2-
| tr
-d
:
)
else
export
GITTEST_REMOTE_SSH_FINGERPRINT
=
$(
ssh-keygen
-F
'[localhost]:2222'
-l
| tail
-n
1 | cut
-d
' '
-f
2 | tr
-d
':'
)
fi
# Use the SSH server
export
GITTEST_REMOTE_URL
=
"ssh://localhost:2222/
$HOME
/_temp/test.git"
export
GITTEST_REMOTE_USER
=
$USER
export
GITTEST_REMOTE_SSH_KEY
=
"
$HOME
/.ssh/id_rsa"
export
GITTEST_REMOTE_SSH_PUBKEY
=
"
$HOME
/.ssh/id_rsa.pub"
export
GITTEST_REMOTE_SSH_PASSPHRASE
=
""
ctest
-V
-R
libgit2_clar-ssh
||
exit
$?
# Use the proxy we started at the beginning
export
GITTEST_REMOTE_PROXY_URL
=
"localhost:8080"
export
GITTEST_REMOTE_PROXY_USER
=
"foo"
export
GITTEST_REMOTE_PROXY_PASS
=
"bar"
ctest
-V
-R
libgit2_clar-proxy_credentials
||
exit
$?
kill
$(
cat
"
$HOME
/sshd/pid"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment