-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.example
More file actions
executable file
·35 lines (29 loc) · 1.1 KB
/
run_tests.example
File metadata and controls
executable file
·35 lines (29 loc) · 1.1 KB
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
#!/bin/bash
# Runs the unit tests on another host. Required because our tests need to
# run as root and modify both package and user configuration, so you really
# don't want them running on your development machine.
#
# To skip slow tests, run this with: --exclude slow:true
set -eu -o pipefail
remote=$1
shift
elixir=$HOME/opt/elixir
hex=$HOME/code/erlang/hex
converge=$HOME/code/erlang/converge
# Compile on local machine, because we want to
# 1) compile deps/ despite the --no-deps-check used on the test machine,
# which we use because it doesn't have the source git repositories
# 2) get compilation errors faster
# 3) avoid mix mistakenly not compiling files on the test machine, when
# its clock is in the future
MIX_ENV=test mix compile
rsync -az --delete --delete-excluded --exclude=.git \
"$elixir" \
"$hex" \
"$converge" \
root@"$remote":
ssh root@"$remote" "
cd ~/hex &&
HEX_OFFLINE=1 PATH=/root/elixir/bin:\$PATH mix install > /dev/null &&
cd ~/converge &&
HEX_OFFLINE=1 PATH=/root/elixir/bin:\$PATH mix test --no-elixir-version-check --no-deps-check --no-archives-check --trace --color $@"