NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.11k stars 14.15k forks source link

Userfriendly test output #171404

Closed davidak closed 2 years ago

davidak commented 2 years ago

Issue description

It would be great to have userfriendly output when running tests. It can be like other unit testing tools.

Currently it looks like this:

$ nix-build nixpkgs/ -A seaweedfs.tests
this derivation will be built:
  /nix/store/nvx3bqa6c4rpvwzmv6a9l6j3xzpdv88m-seaweedfs-2.91-test-version.drv
this path will be fetched (13.78 MiB download, 65.64 MiB unpacked):
  /nix/store/fgvw6rrj3dl0sx4ylk5xnzgc3hbz31lf-seaweedfs-2.91
copying path '/nix/store/fgvw6rrj3dl0sx4ylk5xnzgc3hbz31lf-seaweedfs-2.91' from 'https://cache.nixos.org'...
building '/nix/store/nvx3bqa6c4rpvwzmv6a9l6j3xzpdv88m-seaweedfs-2.91-test-version.drv'...
version 30GB 2.91  linux amd64
/nix/store/9nbx3l7ancfpz25a53nfk62dr9cshn0w-seaweedfs-2.91-test-version

There is a lot of clutter and the information that i want is hidden (which tests was run) or not there (where the tests successful?).

It should look like this:

$ nix-build nixpkgs/ -A seaweedfs.tests
✔ seaweedfs-2.91-test-version
✘ seaweedfs-2.91-test-foo
   "foo" expected, got "bar"
✔ seaweedfs-2.91-test-bar

2 of 3 tests where successful.

✘ should be red ✔ should be green there can be a yellow symbol for timeout or similar status where the test did not run for some reason

This is how a tool i made for my company looks like: https://raw.githubusercontent.com/davidak/test/master/demo.svg

Of course every output of Nix should look user friendly like this, so it does not scare users away.

Related:

Lassulus commented 2 years ago

this is more of a nix, then a nixpkgs issue. also maybe piping it to https://github.com/maralorn/nix-output-monitor is enough

davidak commented 2 years ago

I have not much hope they make anything userfriendly, but moved the issue there: https://github.com/NixOS/nix/issues/6475