-
Notifications
You must be signed in to change notification settings - Fork 7
/
pr.sh
executable file
·93 lines (79 loc) · 2.51 KB
/
pr.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
88
89
90
91
92
93
#!/bin/bash
set -e
set -x
PROJECT_ROOT=$(realpath ./)
CONTROLLER_DIR=$(realpath $PROJECT_ROOT/controller)
WASM_LIB_DIR=$(realpath $PROJECT_ROOT/lib/hdr-histogram-wasm)
WASM_OUTPUT_CONTROLLER_DIR=$CONTROLLER_DIR/lib/hdr-histogram-wasm
mkdir -p "$WASM_OUTPUT_CONTROLLER_DIR"
cargo build
# cargo install cross
# cargo build --target x86_64-unknown-linux-musl
# cross build --target aarch64-unknown-linux-musl
# cross build --target armv7-unknown-linux-musleabihf
cargo build --bin test-server
# cargo fmt --all
cargo fmt --all -- --check
cargo clippy --all -- -D warnings
TZ=UTC cargo test --all
cargo test --all --doc
# cargo install cargo-deny
cargo deny check --hide-inclusion-graph license sources advisories
CWD=$(pwd)
cd "$CWD/lib/config-wasm"
# cargo install wasm-pack
wasm-pack build --release -t nodejs --scope fs
# ~/.cache/.wasm-pack/wasm-opt-4d7a65327e9363b7/wasm-opt pkg/config_wasm_bg.wasm -o pkg/config_wasm_bg.wasm -Oz
cd tests/
npm ci
npm test
cd "$CWD/lib/hdr-histogram-wasm"
wasm-pack build --release -t nodejs --scope fs
wasm-pack build --release -t bundler -d $WASM_OUTPUT_CONTROLLER_DIR --scope fs
# ~/.cache/.wasm-pack/wasm-opt-4d7a65327e9363b7/wasm-opt pkg/hdr_histogram_wasm_bg.wasm -o pkg/hdr_histogram_wasm_bg.wasm -Oz
cd tests/
npm ci
npm test
cd "$CWD"
npm ci
npm run linterror
npm run build:common
npm run build:react
NODE_ENV=test npm test
read -e -p "Run Coverage Tests y/N: " choice
if [[ "$choice" == [Yy]* ]]; then
npm run testcleanup
# npm run coverage
# read -e -p "Grab screenshot then hit enter to continue." choice
npm run coverage:common
read -e -p "Grab common screenshot then hit enter to continue." choice
npm run coverage:agent
read -e -p "Grab agent screenshot then hit enter to continue." choice
set +e
clean_result="1"
while [[ "$clean_result" != "0" ]]; do
(npm run testcleanup)
clean_result=$?
echo "clean_result: $clean_result"
done
set -e
npm run coverage:controller
read -e -p "Grab controller screenshot then hit enter to continue." choice
npm run testmerge
read -e -p "Grab overall screenshot then hit enter to continue." choice
fi
read -e -p "Run Acceptance Tests y/N: " choice
if [[ "$choice" == [Yy]* ]]; then
set +e
clean_result="1"
while [[ "$clean_result" != "0" ]]; do
(npm run testcleanup)
clean_result=$?
echo "clean_result: $clean_result"
done
set -e
echo Hit Ctrl-C when acceptance tests finish
export ACCEPTANCE_AWS_PERMISSIONS=true
npm run acceptance:all
read -e -p "Grab screenshot then hit enter to continue." choice
fi