This repository has been archived on 2022-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
DevOpsOpenHack/apis/trips/buildtest.sh
2022-11-03 16:41:13 -04:00

26 lines
714 B
Bash

#!/bin/bash
# clean the output of the previous build
go clean
# get & install dependencies
go get
# build the project
go build
# run unit tests
go test -v ./tripsgo -run Unit -coverprofile=unittest_coverage.out -covermode=count
# run integration tests
go test -v ./tripsgo
# setup gotestsum
chmod +x install_gotestsum.sh
./install_gotestsum.sh
# run unit tests using gotestsum and generate junit report
./gotestsum --format standard-verbose --junitfile unittest_results.xml -- ./tripsgo -run Unit -coverprofile=unittest_coverage.out -covermode=count
# run integration test susing gotestsum and generate junit report
./gotestsum --format standard-verbose --junitfile integrationtest_results.xml -- ./tripsgo