dive icon indicating copy to clipboard operation
dive copied to clipboard

Test coverage below threshold

Open hack3ric opened this issue 1 year ago • 1 comments

What happened:

Building Dive on Arch Linux's PKGBUILD failed with insufficient test coverage:

==> Starting check()...
/bin/bash: line 1: git: command not found
mkdir -p ./.tmp
Running unit tests
go test -race -coverprofile ./.tmp/unit-coverage-details.txt ./...
go: downloading github.com/sergi/go-diff v1.0.0
        github.com/wagoodman/dive               coverage: 0.0% of statements
        github.com/wagoodman/dive/cmd           coverage: 0.0% of statements
        github.com/wagoodman/dive/dive/image            coverage: 0.0% of statements
        github.com/wagoodman/dive/dive          coverage: 0.0% of statements
        github.com/wagoodman/dive/dive/image/podman             coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/format             coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/view               coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/key                coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui            coverage: 0.0% of statements
        github.com/wagoodman/dive/utils         coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/layout/compound            coverage: 0.0% of statements
ok      github.com/wagoodman/dive/dive/filetree 1.016s  coverage: 58.0% of statements
ok      github.com/wagoodman/dive/dive/image/docker     1.028s  coverage: 41.9% of statements
ok      github.com/wagoodman/dive/runtime       1.214s  coverage: 6.3% of statements
ok      github.com/wagoodman/dive/runtime/ci    1.028s  coverage: 55.4% of statements
ok      github.com/wagoodman/dive/runtime/export        1.027s  coverage: 43.9% of statements
ok      github.com/wagoodman/dive/runtime/ui/layout     1.013s  coverage: 82.6% of statements
ok      github.com/wagoodman/dive/runtime/ui/viewmodel  1.829s  coverage: 50.2% of statements
Coverage: 31.8%
Coverage below threshold of 55.0%
make: *** [Makefile:177: unit] Error 1
==> ERROR: A failure occurred in check().
    Aborting...

What you expected to happen:

Test passes

How to reproduce it (as minimally and precisely as possible):

makepkg -s on Arch Linux's PKGBUILD

Anything else we need to know?:

Environment:

  • OS version: Arch Linux w/ kernel 6.8.5-zen1-1-zen
  • Docker version (if applicable) N/A

hack3ric avatar Apr 16 '24 13:04 hack3ric

I can reproduce it with a fresh git checkout and without Arch's toolchain:

$ git clone [email protected]:wagoodman/dive.git
Cloning into 'dive'...
remote: Enumerating objects: 3519, done.
remote: Counting objects: 100% (601/601), done.
remote: Compressing objects: 100% (215/215), done.
remote: Total 3519 (delta 417), reused 480 (delta 381), pack-reused 2918 (from 1)
Receiving objects: 100% (3519/3519), 6.59 MiB | 2.29 MiB/s, done.
Resolving deltas: 100% (2215/2215), done.
$ cd dive
$ go build
go: downloading github.com/phayes/permbits v0.0.0-20190612203442-39d7c581d2ee
go: downloading github.com/spf13/cobra v0.0.5
go: downloading github.com/docker/docker v24.0.7+incompatible
go: downloading github.com/docker/cli v0.0.0-20190906153656-016a3232168d
go: downloading golang.org/x/net v0.17.0
go: downloading github.com/logrusorgru/aurora v0.0.0-20190803045625-94edacc10f9b
go: downloading github.com/mattn/go-colorable v0.1.2
go: downloading github.com/mattn/go-isatty v0.0.9
go: downloading github.com/pelletier/go-toml v1.4.0
go: downloading github.com/awesome-gocui/keybinding v1.0.1-0.20190805183143-864552bd36b7
go: downloading github.com/lunixbochs/vtclean v1.0.0
go: downloading github.com/docker/distribution v2.8.2+incompatible
go: build output "dive" already exists and is a directory
$ make test
mkdir -p ./.tmp
Running unit tests
go test -race -coverprofile ./.tmp/unit-coverage-details.txt ./...
        github.com/wagoodman/dive               coverage: 0.0% of statements
        github.com/wagoodman/dive/dive          coverage: 0.0% of statements
        github.com/wagoodman/dive/cmd           coverage: 0.0% of statements
        github.com/wagoodman/dive/dive/image            coverage: 0.0% of statements
        github.com/wagoodman/dive/dive/image/podman             coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui            coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/format             coverage: 0.0% of statements
        github.com/wagoodman/dive/utils         coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/key                coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/layout/compound            coverage: 0.0% of statements
        github.com/wagoodman/dive/runtime/ui/view               coverage: 0.0% of statements
ok      github.com/wagoodman/dive/dive/filetree 1.025s  coverage: 58.0% of statements
ok      github.com/wagoodman/dive/dive/image/docker     1.042s  coverage: 43.6% of statements
ok      github.com/wagoodman/dive/runtime       1.308s  coverage: 53.3% of statements
ok      github.com/wagoodman/dive/runtime/ci    1.047s  coverage: 62.1% of statements
ok      github.com/wagoodman/dive/runtime/export        1.050s  coverage: 100.0% of statements
ok      github.com/wagoodman/dive/runtime/ui/layout     1.019s  coverage: 82.6% of statements
ok      github.com/wagoodman/dive/runtime/ui/viewmodel  2.052s  coverage: 55.3% of statements
Coverage: 31.8%
Coverage below threshold of 55.0%
make: *** [Makefile:177: unit] Error 1

felixonmars avatar Nov 12 '24 05:11 felixonmars