forked from openssh-rust/openssh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_ci_tests.sh
executable file
·45 lines (33 loc) · 990 Bytes
/
run_ci_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
set -euxo pipefail
cd "$(dirname "$(realpath "$0")")"
./start_sshd.sh
export RUSTFLAGS='--cfg=ci'
# Use a different target-dir since RUSTFLAGS='--cfg=ci' seems to
# affect dependencies as well.
#
# Since IDEs usually do not set RUSTFLAGS='--cfg=ci', setting it
# here would cause all the dependencies and openssh to be rebuilt.
#
# Thus it makes run_ci_tests.sh incrediably slow, and it also
# affects IDEs checking, since now the IDEs also need to
# rebuild the crate.
export CARGO_TARGET_DIR=ci-target
cargo hack --feature-powerset check
cargo clippy --all-features
export HOSTNAME=127.0.0.1
echo Set up ssh agent
eval "$(ssh-agent)"
ssh-add - <.test-key
function cleanup {
ssh-agent -k
}
trap cleanup EXIT
echo Run tests
rm -rf control-test config-file-test .ssh-connection*
echo Running integration test
cargo test \
--all-features \
--no-fail-fast \
-- --test-threads=3 # Use test-threads=3 so that the output is readable
rm -r .ssh-connection*