Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test coverage below threshold #518

Open
hack3ric opened this issue Apr 16, 2024 · 1 comment
Open

Test coverage below threshold #518

hack3ric opened this issue Apr 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hack3ric
Copy link

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 hack3ric added the bug Something isn't working label Apr 16, 2024
@felixonmars
Copy link

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

$ git clone git@github.com: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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants