-
Notifications
You must be signed in to change notification settings - Fork 71
/
runTests.sh
87 lines (76 loc) · 1.82 KB
/
runTests.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
set -ex
TEST_PACKAGES=".*"
extract_archive()
{
ARCHIVE=$1
case $ARCHIVE in
*.zip)
unzip $ARCHIVE -d .
;;
*.*gz)
tar -xvvzf $ARCHIVE
;;
*.*bz2)
tar -xvvjf $ARCHIVE
;;
*)
echo "Extraction of VM archive $ARCHIVE is unsupported."
exit 1
;;
esac
}
fetch_image()
{
case $APPNAME in
*)
wget -O - https://get.pharo.org/64/80 | bash
echo 80 > pharo.version
TEST_IMAGE_NAME=$(ls Pharo*.image)
;;
esac
}
case $(uname) in
Linux)
TEST_VM_STAGE_NAME="unix64"
if test "$APPNAME" = ""; then
APPNAME="Pharo"
VM_EXECUTABLE_NAME="pharo"
fi
TEST_VM_EXECUTABLE="./$VM_EXECUTABLE_NAME"
VM_ARCHIVE=../artifacts/${APPNAME}VM-*-linux*-bin.zip
;;
Darwin)
TEST_VM_STAGE_NAME="osx"
if test "$APPNAME" = ""; then
APPNAME="Pharo"
VM_EXECUTABLE_NAME="Pharo"
fi
TEST_VM_EXECUTABLE="./$VM_EXECUTABLE_NAME.app/Contents/MacOS/$VM_EXECUTABLE_NAME"
VM_ARCHIVE=../artifacts/${APPNAME}VM-*-mac*-bin.zip
;;
CYGWIN*)
TEST_VM_STAGE_NAME="win64"
if test "$APPNAME" = ""; then
APPNAME="Pharo"
VM_EXECUTABLE_NAME="Pharo"
fi
TEST_VM_EXECUTABLE="./${VM_EXECUTABLE_NAME}Console"
VM_ARCHIVE=../artifacts/${APPNAME}VM-*-win*-bin.zip
;;
*)
echo "Unsupported operating system $(uname) for running tests"
exit 0
;;
esac
mkdir -p runTests
cd runTests
# Fetch VM
extract_archive $VM_ARCHIVE
# Fetch the image
fetch_image
# Run the tests
PHARO_CI_TESTING_ENVIRONMENT=true $TEST_VM_EXECUTABLE $TEST_IMAGE_NAME test --junit-xml-output --stage-name=$APPNAME-$TEST_VM_STAGE_NAME "$TEST_PACKAGES" || echo "Warning, some tests are failing"
# Copy the test results.
mkdir -p ../test-results
cp *.xml ../test-results