pueue: [BUG] Test failure related to terminal environment

Describe the bug

I’m working on updating pueue in nixpkgs and observed that it seems the table output does not match because the terminal size or environment in the nixpkgs test environment does not match. I can see that the width seems to be larger in the nixpkgs setup.

If the tests assume a certain environment that I can emulate, I can set that up in the nixpkgs test suite.

Logs/Output

You can see the error in the following:

https://logs.nix.ci/?key=nixos/nixpkgs.185175&attempt_id=594588bf-51e5-4a45-84d3-a71697764db1

by searching for, for example, “---- client::status::full_status stdout ----”.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

I now think maybe a way to fix this is to approach it by creating the expected output not as a Handlebars template but by building it using comfy-table directly. This might make the test logic itself too complicated to be palatable.

I had the same idea, but this kind of misses the point. We would basically test two identical pieces of logic against each other. The idea behind those template tests was to have a manual check of the expected output. With this approach, any changes in the rendered output will be detected. This includes changes in libraries such as comfy-table.

Please feel free to close this issue if you think so. I’m sorry I led you down this convoluted path.

No worries 😄 I didn’t expect the client tests to cause this many problems in different environments^^. It was an interesting bug hunt!

Besides, we managed to get the daemon tests up and running, which tests pretty much all of the critical internal and API logic.

I’m seeing some new failures when I pull in this commit along with the other commits since v2.1.0. You’ve done more than enough already. I will do some investigation tomorrow to see if I can find out more.