Skip to content
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

[poc] tests/plugins: test package options #2121

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

khaneliman
Copy link
Contributor

Just a little POC from a discussion about testing options functionality working, as expected for when we add or don't add packages.

@khaneliman khaneliman force-pushed the pkgtest branch 2 times, most recently from 59e1a02 to 97b5737 Compare August 31, 2024 03:00
@khaneliman khaneliman changed the title tests/plugins/packer: test package unset tests/plugins: test package options Aug 31, 2024
@khaneliman khaneliman changed the title tests/plugins: test package options [poc] tests/plugins: test package options Aug 31, 2024
@khaneliman khaneliman force-pushed the pkgtest branch 2 times, most recently from 7756618 to 23a9196 Compare August 31, 2024 03:10
{
plugins.bufferline.enable = true;

assertions = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

would it make more sense to test the package existence in our existing empty test cases?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's nice to keep the "empty" case simple.

Maybe we should consider adding test.runNvim = false to these assertion-based tests though, since we don't actually need to run neovim if all we care about is the assertion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, don't need to waste processing time that way if it's just evaluation time testing.

Copy link
Member

Choose a reason for hiding this comment

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

Makes me think we could do with a test.build toggle to completely disable building finalPackage, although we'd probably still want to ensure it is evaluated somehow (just not built)

assertion =
config.extraPlugins != [ ]
&& lib.any (
x: lib.trace "${x.pname or ""}" x.pname or null == "bufferline.nvim"
Copy link
Member

Choose a reason for hiding this comment

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

Looking on noogle, there's also lib.getName, although I think that could fail when encountering submodule-type plugin definitions...

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