Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
- 'ztoc/**' # Includes flatbuf + C files
- '!benchmark/**'

env:
GOTESTSUM_VERSION: 1.13.0

jobs:
setup:
Expand Down Expand Up @@ -64,6 +66,8 @@ jobs:
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: Install gotestsum
run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }}
- name: Install zlib static on AL2 ARM instances
if: matrix.os == 'al2-arm'
run: dnf install zlib-static.aarch64 -y
Expand Down
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,19 @@ test-cmd:
@echo "$@"
@cd ./cmd; GO111MODULE=$(GO111MODULE_VALUE) go test $(GO_TEST_FLAGS) $(GO_LD_FLAGS) -race `go list ./...` -args $(GO_TEST_ARGS); cd ../

show-test-coverage: test-with-coverage
show-test-coverage: $(COVDIR)/unit
go tool covdata percent -i $(COVDIR)/unit

show-test-coverage-html: test-with-coverage $(COVDIR)/html
go tool covdata textfmt -i $(COVDIR)/unit -o $(COVDIR)/unit/unit.out
go tool cover -html=$(COVDIR)/unit/unit.out -o $(COVDIR)/html/unit.html

test-with-coverage: $(COVDIR)/unit
@echo "$@"
GO_TEST_FLAGS="$(GO_TEST_FLAGS) -cover" \
GO_TEST_ARGS="-test.gocoverdir=$(COVDIR)/unit" \
GO_BUILD_FLAGS="$(GO_BUILD_FLAGS) -coverpkg=$(SOCI_LIBRARY_PACKAGE_LIST)"\
$(MAKE) test

$(COVDIR):
@mkdir -p $@
Expand All @@ -169,31 +174,28 @@ $(COVDIR)/html:

$(COVDIR)/unit: $(COVDIR)
@mkdir -p $@
GO_TEST_FLAGS="$(GO_TEST_FLAGS) -cover" \
GO_TEST_ARGS="-test.gocoverdir=$(COVDIR)/unit" \
GO_BUILD_FLAGS="$(GO_BUILD_FLAGS) -coverpkg=$(SOCI_LIBRARY_PACKAGE_LIST)"\
$(MAKE) test

integration: build
@echo "$@"
@echo "SOCI_SNAPSHOTTER_PROJECT_ROOT=$(SOCI_SNAPSHOTTER_PROJECT_ROOT)"
@GO111MODULE=$(GO111MODULE_VALUE) SOCI_SNAPSHOTTER_PROJECT_ROOT=$(SOCI_SNAPSHOTTER_PROJECT_ROOT) ENABLE_INTEGRATION_TEST=true go test $(GO_TEST_FLAGS) -v -timeout=0 ./integration
@GO111MODULE=$(GO111MODULE_VALUE) SOCI_SNAPSHOTTER_PROJECT_ROOT=$(SOCI_SNAPSHOTTER_PROJECT_ROOT) ENABLE_INTEGRATION_TEST=true gotestsum --rerun-fails --format standard-verbose --packages ./integration -- -timeout 0 $(GO_TEST_FLAGS)

show-integration-coverage: integration-with-coverage
show-integration-coverage: $(COVDIR)/unit
go tool covdata percent -i $(COVDIR)/integration

show-integration-coverage-html: integration-with-coverage $(COVDIR)/html
go tool covdata textfmt -i $(COVDIR)/integration -o $(COVDIR)/integration/integration.out
go tool cover -html=$(COVDIR)/integration/integration.out -o $(COVDIR)/html/integration.html

integration-with-coverage: $(COVDIR)/integration

$(COVDIR)/integration: $(COVDIR)
@mkdir -p $@
@echo "$@"
GO_TEST_FLAGS="$(GO_TEST_FLAGS)" \
GO_BUILD_FLAGS="$(GO_BUILD_FLAGS) -coverpkg=$(SOCI_CLI_PACKAGE_LIST),$(SOCI_GRPC_PACKAGE_LIST)" \
$(MAKE) integration

$(COVDIR)/integration: $(COVDIR)
@mkdir -p $@

release:
@echo "$@"
@$(SOCI_SNAPSHOTTER_PROJECT_ROOT)/scripts/create-releases.sh $(RELEASE_TAG)
Expand Down
Loading