Skip to content

tests: fix tests by enabling wrapRc#2076

Merged
mergify[bot] merged 2 commits intonix-community:mainfrom
MattSturgeon:fix_tests
Aug 26, 2024
Merged

tests: fix tests by enabling wrapRc#2076
mergify[bot] merged 2 commits intonix-community:mainfrom
MattSturgeon:fix_tests

Conversation

@MattSturgeon
Copy link
Copy Markdown
Member

@MattSturgeon MattSturgeon commented Aug 24, 2024

Since cbd1003 I'm able to add some invalid config definitions to modules the tests are using and get no build error.

For example extraConfigLua = null; should produce an invalid type error, but doesn't.

One less visible change in that commit is the move away from using the "standalone" wrapper (makeNixvimWithModule), which implicitly sets wrapRc = true.

Adding back wrapRc to the tests seems to fix the issue, however this makes me wonder if there's an underlying issue with wrapping/not-wrapping?

Perhaps we've simply uncovered a long-standing eval issue that is masked over by using wrapRc?

@MattSturgeon
Copy link
Copy Markdown
Member Author

MattSturgeon commented Aug 24, 2024

EDIT: resolved in #2078

Details

A ton of tests are failing with error: writing to file: Transport endpoint is not connected. This seems unrelated?

"mkTestDerivationFromNixvimModule: the `dontRun` argument is deprecated. You should use the `test.runNvim` module option instead."
{ config.test.runNvim = !dontRun; }
))
{ wrapRc = true; }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be included in the .extend {} in mkTestDerivationFromNvim above?

We don't use that function internally, and anyone downstream should already have a wrapped RC because their nvim will have been built by the standalone wrapper, so it's probably not strictly necessary there...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see how you would be able to call that function without having a standalone module

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They could use evalNixvim, if if they're really fancy they could manually call evalModules.

More reasonably, a home-manager user could decide to use the config.programs.nixvim.test.derivation from their home-manager configuration.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my mistake, I was talking about how they could get the test without using either of these functions...

You're right, regarding my original comment. It's very unlikely they'd get a standalone nixvim derivation without using the standalone wrapper!

Since cbd1003 I'm able to add _some_
invalid config definitions to modules the tests are using and get no
build error.

For example `extraConfigLua = null;` should produce an invalid type
error, but doesn't.

One less visible change in that commit is the move away from using the
"standalone" wrapper (`makeNixvimWithModule`), which implicitly sets
`wrapRc = true`.

Adding back `wrapRc` to the tests seems to fix the issue, however this
makes me wonder if there's an underlying issue with wrapping/not-wrapping?

Perhaps we've simply uncovered a long-standing eval issue that is masked
over by using `wrapRc`?
@MattSturgeon
Copy link
Copy Markdown
Member Author

@Mergifyio queue

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Aug 26, 2024

queue

✅ The pull request has been merged automatically

Details

The pull request has been merged automatically at 9af4c39

@mergify mergify bot merged commit 9af4c39 into nix-community:main Aug 26, 2024
@mergify mergify bot temporarily deployed to github-pages August 26, 2024 21:05 Inactive
@MattSturgeon MattSturgeon deleted the fix_tests branch August 26, 2024 21:06
MattSturgeon added a commit to MattSturgeon/nixvim that referenced this pull request Aug 27, 2024
Adds a regression test for nix-community#2076. This test ensures that
`extraConfigLua` is used in `finalPackage` and that the test will fail
correctly when running `nvim` results in unexpected output.
my7h3le pushed a commit to my7h3le/nixvim that referenced this pull request Sep 1, 2024
Adds a regression test for nix-community#2076. This test ensures that
`extraConfigLua` is used in `finalPackage` and that the test will fail
correctly when running `nvim` results in unexpected output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants