-
Notifications
You must be signed in to change notification settings - Fork 515
/
Copy pathtesting.sh
executable file
·72 lines (51 loc) · 1.34 KB
/
testing.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
#!/usr/bin/env sh
# Script equivalent of .github/workflows/testing.yml -> test
set -e
echo "-------------------------"
echo "Install all yarn packages"
echo "-------------------------"
yarn --frozen-lockfile
echo "-------------------"
echo "Unit testing client"
echo "-------------------"
yarn test:client
echo "----------------------"
echo "Build and start server"
echo "----------------------"
export ENV_FILE=".env.testing"
yarn build:prepare
yarn build:docs
yarn render:html
nohup yarn start:static-server > testing.log 2>&1 &
PID=$!
sleep 1
{
curl --fail --retry-connrefused --retry 5 http://localhost:5042 > /dev/null
echo "------------------"
echo "Functional testing"
echo "------------------"
yarn test:testing
yarn test:headless
echo "-----------"
echo "Stop server"
echo "-----------"
kill $PID
rm client/.env
rm testing.log
echo "----------"
echo "Result: ✅"
echo "----------"
} || {
kill $PID
rm client/.env
cat testing.log
rm testing.log
echo "----------"
echo "Result: ❌"
echo "----------"
}
echo "----------------------"
echo "Basic m2h tool testing"
echo "----------------------"
yarn m2h markdown/tool/m2h --locale en-US
diff -s testing/content/files/en-us/markdown/tool/m2h/index.html testing/content/files/en-us/markdown/tool/m2h/expected.html