mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-03 15:27:57 +08:00
fix(ci): move client/rpc tests to cli-tests job
client/rpc tests use test/cli/harness which requires the ipfs binary. Move them from test_unit to test_cli where the binary is built. also: - update gotestsum to v1.13.0 - simplify workflow step names
This commit is contained in:
parent
d1ee8d308b
commit
2571b5d56f
4
.github/workflows/gotest.yml
vendored
4
.github/workflows/gotest.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
||||
go-version-file: 'go.mod'
|
||||
- name: Install missing tools
|
||||
run: sudo apt update && sudo apt install -y zsh
|
||||
- name: Run unit tests 👉️ Summary (top left) → «Failures/Errors» table
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
make test_unit &&
|
||||
[[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]]
|
||||
@ -131,7 +131,7 @@ jobs:
|
||||
go-version-file: 'go.mod'
|
||||
- name: Install missing tools
|
||||
run: sudo apt update && sudo apt install -y zsh
|
||||
- name: Run CLI tests 👉️ Summary (top left) → «Failures/Errors» table
|
||||
- name: Run CLI tests
|
||||
env:
|
||||
IPFS_PATH: ${{ runner.temp }}/ipfs-test
|
||||
run: make test_cli
|
||||
|
||||
@ -44,18 +44,19 @@ endef
|
||||
# Only disable colors when running in CI (non-interactive terminal)
|
||||
GOTESTSUM_NOCOLOR := $(if $(CI),--no-color,)
|
||||
|
||||
# Unit tests with coverage (excludes test/cli which has separate target)
|
||||
# Unit tests with coverage (excludes packages that need ipfs binary)
|
||||
# Produces JSON for CI reporting and coverage profile for Codecov
|
||||
test_unit: test/bin/gotestsum $$(DEPS_GO)
|
||||
rm -f test/unit/gotest.json coverage/unit_tests.coverprofile
|
||||
gotestsum $(GOTESTSUM_NOCOLOR) --jsonfile test/unit/gotest.json -- $(go-flags-with-tags) $(GOTFLAGS) -covermode=atomic -coverprofile=coverage/unit_tests.coverprofile -coverpkg=./... $$($(GOCC) list ./... | grep -v '/test/cli')
|
||||
gotestsum $(GOTESTSUM_NOCOLOR) --jsonfile test/unit/gotest.json -- $(go-flags-with-tags) $(GOTFLAGS) -covermode=atomic -coverprofile=coverage/unit_tests.coverprofile -coverpkg=./... $$($(GOCC) list ./... | grep -v '/test/cli' | grep -v '/client/rpc')
|
||||
.PHONY: test_unit
|
||||
|
||||
# CLI integration tests (requires built binary in PATH)
|
||||
# CLI/integration tests (requires built binary in PATH)
|
||||
# Includes test/cli and client/rpc (which uses test/cli/harness)
|
||||
# Produces JSON for CI reporting
|
||||
test_cli: cmd/ipfs/ipfs test/bin/gotestsum
|
||||
rm -f test/cli/cli-tests.json
|
||||
PATH="$(CURDIR)/cmd/ipfs:$(CURDIR)/test/bin:$$PATH" gotestsum $(GOTESTSUM_NOCOLOR) --jsonfile test/cli/cli-tests.json -- -v ./test/cli/...
|
||||
PATH="$(CURDIR)/cmd/ipfs:$(CURDIR)/test/bin:$$PATH" gotestsum $(GOTESTSUM_NOCOLOR) --jsonfile test/cli/cli-tests.json -- -v ./test/cli/... ./client/rpc/...
|
||||
.PHONY: test_cli
|
||||
|
||||
# Build kubo for all platforms from .github/build-platforms.yml
|
||||
|
||||
@ -15,7 +15,7 @@ require (
|
||||
github.com/ipfs/iptb-plugins v0.5.1
|
||||
github.com/multiformats/go-multiaddr v0.16.1
|
||||
github.com/multiformats/go-multihash v0.2.3
|
||||
gotest.tools/gotestsum v1.12.3
|
||||
gotest.tools/gotestsum v1.13.0
|
||||
)
|
||||
|
||||
require (
|
||||
|
||||
@ -985,8 +985,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gotest.tools/gotestsum v1.12.3 h1:jFwenGJ0RnPkuKh2VzAYl1mDOJgbhobBDeL2W1iEycs=
|
||||
gotest.tools/gotestsum v1.12.3/go.mod h1:Y1+e0Iig4xIRtdmYbEV7K7H6spnjc1fX4BOuUhWw2Wk=
|
||||
gotest.tools/gotestsum v1.13.0 h1:+Lh454O9mu9AMG1APV4o0y7oDYKyik/3kBOiCqiEpRo=
|
||||
gotest.tools/gotestsum v1.13.0/go.mod h1:7f0NS5hFb0dWr4NtcsAsF0y1kzjEFfAil0HiBQJE03Q=
|
||||
gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=
|
||||
gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=
|
||||
honnef.co/go/tools v0.6.1 h1:R094WgE8K4JirYjBaOpz/AvTyUu/3wbmAoskKN/pxTI=
|
||||
|
||||
Loading…
Reference in New Issue
Block a user