@@ -18,18 +18,61 @@ jobs:
1818 with :
1919 go-version : 1.15
2020
21- - name : Analyze
21+ - name : Static analysis of code for errors
2222 run : make analyze
2323
24+ # - name: Build
25+ # run: go build -v ./...
26+
2427 - name : Build
2528 run : make build
2629
27- # - name: Test
28- # run: make test
29-
30- # - name: Build
31- # run: go build -v ./...
30+ - name : Test - go test
31+ env :
32+ PM_CONF_FILE : ${{ github.workspace }}/sample/pm.config.yaml
33+ INTEGRATION_TEST : START
34+ INTEG_TEST_BIN : ${{ github.workspace }}
35+ run : |
36+ mkdir -p ${{ github.workspace }}/cover
37+ go test -mod=vendor -v ./...
38+
39+ # - name: Test - make test
40+ # env:
41+ # TOP: ${{ github.workspace }}
42+ # GOSRC: ${{ github.workspace }}
43+ # GOCOVER: ${{ github.workspace }}/cover
44+ # GOTOOLSBIN: ${{ github.workspace }}/tools/go
45+ # run: make test
3246
33- - name : Test
34- run : go test -mod=vendor -v ./...
35-
47+ - name : Test - contents of make test!
48+ run : |
49+ set -x
50+ echo "Running Plugin Manager Go Unit Tests...";
51+ GOSRC=${{ github.workspace }}
52+ GOCOVER=${{ github.workspace }}/cover
53+ TOOLSBIN=${{ github.workspace }}/tools
54+ GOTOOLSBIN=${{ github.workspace }}/tools/go
55+ mkdir -p ${GOCOVER};
56+ export INTEG_TEST_BIN=${GOSRC};
57+ mkdir -p ${INTEG_TEST_BIN};
58+ export PM_CONF_FILE=${GOSRC}/sample/pm.config.yaml;
59+ export INTEGRATION_TEST=START;
60+ cd ${GOSRC};
61+ test_failed=0;
62+ d=pm;
63+ go test -mod=vendor -v --cover -covermode=count -coverprofile=${GOCOVER}/${d}.out ./... | ${GOTOOLSBIN}/go-junit-report > TEST-${d}.xml;
64+ ret=${PIPESTATUS[0]};
65+ if [ ${ret} -ne 0 ]; then
66+ echo "Go unit test failed for ${d}.";
67+ test_failed=1;
68+ fi ;
69+ cat TEST-${d}.xml
70+ awk -f ${TOOLSBIN}/gocoverage-collate.awk ${GOCOVER}/* > ${GOCOVER}/cover.out;
71+ go tool cover -html=${GOCOVER}/cover.out -o go-coverage-${d}.html;
72+ ${GOTOOLSBIN}/gocov convert ${GOCOVER}/cover.out | ${GOTOOLSBIN}/gocov-xml > go-coverage-${d}.xml;
73+ rm -rf ${GOCOVER}/*;
74+ export INTEGRATION_TEST=DONE;
75+ if [ ${test_failed} -ne 0 ]; then
76+ echo "Go unit tests failed.";
77+ exit 1;
78+ fi
0 commit comments