-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathintegrationtest.sh
More file actions
executable file
·38 lines (28 loc) · 1.04 KB
/
integrationtest.sh
File metadata and controls
executable file
·38 lines (28 loc) · 1.04 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
36
37
38
#!/bin/bash
set -e
echo Integration Tests ...
TEST_PACKAGE_1=node-red-contrib-data-view
TEST_PACKAGE_2=node-red-contrib-alasql
#TEST_PACKAGE_3=node-red-contrib-modbus
TEST_DIR=./test
COVERAGE_DIR=./coverage
# Clean
rm -rf $TEST_DIR
mkdir -p $TEST_DIR
rm -rf $COVERAGE_DIR
mkdir -p $COVERAGE_DIR
# Build binary with coverage to test dir
go build -cover -o $TEST_DIR -v ./cmd/node-packager
# Test: Execute binary with command arguments
GOCOVERDIR=$COVERAGE_DIR $TEST_DIR/node-packager $TEST_PACKAGE_1
GOCOVERDIR=$COVERAGE_DIR $TEST_DIR/node-packager --no-audit $TEST_PACKAGE_2
#GOCOVERDIR=$COVERAGE_DIR $TEST_DIR/node-packager --verbose --no-audit $TEST_PACKAGE_3
# ...
# Print coverage in % format
go tool covdata percent -i $COVERAGE_DIR
# Convert coverage to legacy text format
go tool covdata textfmt -i $COVERAGE_DIR -o $COVERAGE_DIR/coverage.txt
# Convert coverage to HTML format
go tool cover -html $COVERAGE_DIR/coverage.txt -o $COVERAGE_DIR/coverage.html
# Print function coverage in % format
go tool cover -func $COVERAGE_DIR/coverage.txt