neovim: add a checkPhase in the wrapper#352727
Conversation
39e2a8e to
3a9dd69
Compare
There was a problem hiding this comment.
Is this supposed to stay ? I see how it can be an example.
There was a problem hiding this comment.
I was not sure how to test for a build failure. So I added this to be able to check. Happy to remove it or you have another suggestion
There was a problem hiding this comment.
I was not sure how to test for a build failure.
You can use pkgs.testers.testBuildFailure to make a test that passes when the derivation you pass to it fails.
We use this in nixvim: https://github.com/nix-community/nixvim/blob/main/tests/failing-tests.nix
There was a problem hiding this comment.
Is that related to enabling the check phase ?
There was a problem hiding this comment.
instead of adding inherit doCheck I thought I could remove all the inherit withPython, etc by directly reusing the removeAttrs. Except I haven't removed the other withXX so it's a bit redundant :/ Had to remove everything that is a function from attrs since nix cant serialize it
There was a problem hiding this comment.
Ok I see... Feels a bit hacky no ?
There was a problem hiding this comment.
that's how most builders work so I am not sure. It's a style tradeoff. Anyhow I've reverted it since it seems confusing and might have some unforeseen consequences
|
|
@MattSturgeon thanks for the pkgs.testers.testBuildFailure tip. @Artturin seems like you touched expect-failure.sh last. Is it because of which fails with Should I wrap the call in as presented in the doc ? |
No problem 😁
🤔 Is it a build failure or an eval error you're testing for?
That's what we do in nixvim; pass the failing derivation into another test that can assert it failed in the expected way. |
PerchunPak
left a comment
There was a problem hiding this comment.
If nixpkgs-review passes, LGTM. Nice and simple feature
Though maybe document it somewhere?
There was a problem hiding this comment.
| ''; | |
| ''; |
add a checkPhase (if doCheck == true, disabled by default) that tries to start neovim and fails in case of errors. It allows to catch small misconfiugurations before switching to a new config.
b9b4b2a to
564a284
Compare
it would be better but this should work as is, without needing to check for the failure.
Issue is this appears only in the unstable wrapper. Neovim being popular we've tried to maintain compatibility with the old wrapper to not break configs. I think the new wrapper is better enough than the old one so we can switch. It is something to approach carefully though so let it be for 25.04. I would like to use this PR feature to update the neovim tests so I am going to merge even if it means disabling the doCheck test. I've opened #355953 for a fix to enable the test. |

add a checkPhase (if doCheck == true, disabled by default) that tries to start neovim and fails in case of errors. It allows to catch small misconfiugurations before switching to a new config.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.