Browse Source

update makefile targets and gitlab-ci.yml for unittest patch (#75)

* update makefile targets and gitlab-ci.yml for unittest patch

* remove tags that do nothing for gitlab on fork

* golang alpine latest is not valid in docker executor

* add sqlite3 package

* add sqlite package

* it's building from integration test that has bug sqlite is not issue
service_pr
Marshall Gaucher 5 years ago
committed by GitHub
parent
commit
57128c12d7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      .gitlab-ci.yml
  2. 20
      Makefile

29
.gitlab-ci.yml

@ -20,8 +20,6 @@ stages:
before_script:
- apk update && apk add make git gcc musl-dev
- export GO111MODULE=on
- export CGO_ENABLED=1
# ************************************************************************/
# BUILD
@ -40,9 +38,6 @@ build-linux:
stage: build
script:
- make
only:
- merge_requests
- master
.build-windows:
stage: build
@ -62,33 +57,31 @@ build-linux:
- make
allow_failure: true
# Likely don't need a nightly in always deployable model; will revisit after requirement gathering
.build-nightly:
stage: build
script:
- make
allow_failure: true
# ************************************************************************/
# TEST
# ************************************************************************/
test-coverage:
test-unittest:
stage: test
script:
- make coverage
allow_failure: true
- make test
allow_failure: true
test-coverage-report:
test-race-conditions:
stage: test
script:
- make coverage_report
- make race
allow_failure: true
test-coverage-report-html:
test-coverage:
stage: test
script:
- make coverage
- make coverage_report
- make coverage_html
allow_failure: true
artifacts:
paths:
- ./coverage.html
# ************************************************************************/
# DEPLOY

20
Makefile

@ -6,6 +6,7 @@
# Usage: make <target_name>
#
# Known bugs/missing features:
# 1. make msan is not stable as of 9/20/2019
#
# ************************************************************************/
PROJECT_NAME := "lightwalletd"
@ -13,9 +14,6 @@ GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v '*_test.go'
GO_TEST_FILES := $(shell find . -name '*_test.go' -type f | rev | cut -d "/" -f2- | rev | sort -u)
GO_BUILD_FILES := $(shell find . -name 'main.go')
#PKG_LIST := $(shell go list | grep -v /vendor/)
#GO_COV_REPORTS :=
.PHONY: all dep build clean test coverage coverhtml lint
all: build
@ -29,19 +27,19 @@ show_tests:
# Run unittests
test:
@go test -v -short ${GO_TEST_FILES}
@go test -v ./...
# Run data race detector
race: dep
@go test -v -race -short ${GO_TEST_FILES}
race:
@go test -v -race -short ./...
# Run memory sanitizer (need to ensure proper build flag is set)
msan: dep
msan:
@go test -v -msan -short ${GO_TEST_FILES}
# Generate global code coverage report
coverage:
@go test -coverprofile=coverage.out ${GO_TEST_FILES}
@go test -coverprofile=coverage.out ./...
# Generate code coverage report
coverage_report:
@ -49,7 +47,7 @@ coverage_report:
# Generate code coverage report in HTML
coverage_html:
@go tool cover -html=coverage.out
@go tool cover -html=coverage.out -o coverage.html
# Generate documents
docs:
@ -65,8 +63,8 @@ dep:
# Build binary
build:
@go build -i -v ./cmd/ingest
@go build -i -v ./cmd/server
GO111MODULE=on CGO_ENABLED=1 go build -i -v ./cmd/ingest
GO111MODULE=on CGO_ENABLED=1 go build -i -v ./cmd/server
# Install binaries into Go path
install:

Loading…
Cancel
Save