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
[BUG] Test failure related to terminal environment #342
Comments
Hmmm. This is a bit tricky. Comfy-table looks at the current TTY and checks its width to determine how to fit the content into the table. We could then inject that environment variable into the client's env when running the tests. Normal user's wouldn't need to know about it. I'll have a look at it soon :) |
Can you test whether your test run works with the |
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. |
I'm sorry I accidentally misled you about the terminal width. In theory it can be a factor, but I don't think it's leading to these test failures. After digging into it, there are two causes that lead to almost all of these failures.
|
NixOs Ticket for reference: NixOS/nixpkgs#185747 |
The linked MR should fix the second source of failures :) branch: |
When I apply this patch and set I am now worried about setting |
Nice. I'll merge that MR first and I'll think about a solution to hack around the table formatting problem :) |
The idea behind these tests is to have a visual check that the expected output looks the same as the actual output. The expected output is defined by some templates, which is pretty handy.
However, when working with formatted tables, the lenght of the table depends on the table's content. I'll take a look, if we can somehow template the length of the table |
@tjni I have an idea. Do you have read permissions to These directories should be a common denominator on all unix systems. I created a POC MR which changes the cwd of all tasks in our client tests to Could you take a look if the new commit on #343 fixes your issues? |
Thank you for the proposal and proof-of-concept. I haven't tried it yet because I started reading more about the sandbox that packages can be built with in Nix. It seems that sandboxing is enabled on the build infrastructure that This could be a situation where it's not worth the effort to support this non-standard setup in the test. In To support, I guess it would be possible to create some sort of context variable representing "length of path" prefix and use that in all of the other cells of that column in the table. |
I wasn't able to get to this tonight (in my timezone), but I want to offer to take a stab at the idea I gave in my last comment tomorrow, with a placeholder for the length of the path. I feel it's not worth much more of your time on this unless it really piques your interest. You can take a look at the attempt and determine if it's too complicated for the project or not. |
Oh yuck, I started trying to do this and realize it's impossible. 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 Please feel free to close this issue if you think so. I'm sorry I led you down this convoluted path. |
I had the same idea, but this kind of misses the point. We would basically test two identical pieces of logic against each other.
No worries :D 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 going to close this issue for now, as I'm out of ideas as well. Feel free to re-open if you have another idea on how to solve this problem! I'll do the same! Thanks again for the report and the quick response times! Cheers |
This will most likely be addressed by #390 The same test issues appeared on the apple platform and I'm planning to restructure the client testing approach a bit, to prevent such things in the future :) |
I look forward to it. Thank you! |
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 ----".
The text was updated successfully, but these errors were encountered: