stylix: testbed names are excessively long
The front page of the documentation has the following example:
nix run github:danth/stylix#testbed:gnome:default:dark:image:scheme
- This is out of date and should have
:cursorlessappended to it - the current naming scheme is fragile and changes whenever a new feature is added. - The long name is difficult to remember, and not friendly for users to type into their terminal.
We should improve this by assigning memorable names to each test configuration, to reduce the command to something like
nix run github:danth/stylix#testbed:gnome:default:abc
where abc is the name of the configuration.
Tasks:
- [ ] Decide a theme for the names (e.g. zodiac signs, geographical locations, characters from pop culture).
- [ ] Implement by replacing this code with a hardcoded name for each testbed.
- [ ] As the settings are no longer listed in the name, create a page which shows the expected settings for each configuration. This could be visual for easy reference, something like what we generate for
$XDG_CONFIG_HOME/stylix/palette.html:But also showing the wallpaper, font, cursor and so on.
- [ ] The implementation created for the previous point can replace
$XDG_CONFIG_HOME/stylix/palette.html.
Related: #319
The front page of the documentation has the following example:
nix run github:danth/stylix#testbed:gnome:default:dark:image:scheme
- This is out of date and should have
:cursorlessappended to it
This is fixed by https://github.com/danth/stylix/pull/1013.
the current naming scheme is fragile and changes whenever a new feature is added.
Since new features making it into the testbed naming scheme are limited and fairly rare, this should not really be a problem.
- The long name is difficult to remember, and not friendly for users to type into their terminal.
I believe the best workflow is to nix flake show and copy-paste the testbed name into nix run, instead of remembering testbed names.
We should improve this by assigning memorable names to each test configuration, to reduce the command to something like
nix run github:danth/stylix#testbed:gnome:default:abcwhere
abcis the name of the configuration.
Although convenient, this introduces a level of indirection. Once we have more abc configuration names than can be reasonably remembered, this problem is no different from "remembering" the testbed:«module»:«testbed»:«polarity»:«image»:«scheme»:«cursor» naming scheme. In that case, the full name is more descriptive, if anything.
we could programatically name the testbeds the shortest possible name by removing the default "default" and specifying either what the test case has or what it doesn't:
| current | proposal |
|---|---|
testbed:alacritty:default:dark:image:scheme:cursor |
testbed:alacrity:dark:all |
testbed:alacritty:default:dark:image:scheme:cursorless |
testbed:alacritty:dark:cursorless |
testbed:alacritty:default:light:image:scheme:cursorless |
testbed:alacritty:light:cursorless |
testbed:alacritty:default:dark:image:schemeless:cursorless |
testbed:alacritty:dark:image or testbed:alacritty:dark:imageonly |
| testbed:alacritty:default:dark:imageless:scheme:cursorless | testbed:alacritty:dark:scheme or testbed:alacritty:dark:schemeonly |
we can also consider not specifying the polarity in every one and instead having the following testbeds:
testbed:alacrity:all:dark
testbed:alacrity:all:light
testbed:alacritty:cursorless
testbed:alacritty:image
testbed:alacritty:scheme
note that this also changes the light:cursorless test case to a light:all test case.
on a side-note, we may want to have a way to omit certain test cases from the github action as tests only changing color scheme (such as light:all) generally won't raise any novel errors and are just useful for their VM functionality
i am beginning to question having a test case which sets both the image and the scheme but not the cursor, though. maybe we could remove that test case and just have these four:
testbed:alacrity:all:dark
testbed:alacrity:all:light
testbed:alacritty:image
testbed:alacritty:scheme
for modules with multiple targets, i think that we don't really need the module folder name because any prospective contributor or person using a testbed should hopefully either have the sense to find "vesktop" under the "discord" module or do a quick search of the repo for "vesktop"
if we want fully arbitrary test case names, #857 was a functional solution; i closed it because i could not come up with a way to be able to use both arbitrary and generated test case names and did not deem it worth the effort. though i deleted the branch (a mistake i don't plan to make again), i can recreate and reopen if you would like, though it would likely still be best that only arbitrary or only generated test case names are supported.
Once we have more
abcconfiguration names than can be reasonably remembered, this problem is no different from "remembering" thetestbed:«module»:«testbed»:«polarity»:«image»:«scheme»:«cursor»naming scheme.
That's true.
we could programatically name the testbeds the shortest possible name by removing the default "default" and specifying either what the test case has or what it doesn't:
We could have shortcuts to the most featureful configuration, for where we use it as a "preview" in the documentation, and then use the longer name for automated tests. Only showing the items which are set to null would conveniently implement this.
We should also note that once every item supports being set to null, then there will be at least these things which are varied in the testbed:
- Polarity
- Colors
- Wallpaper
- Fonts
- Icons
- Cursors
To test every possible combination, we would need $$2^6 = 64$$ configurations per testbed. That's obviously not feasible to build for every pull request, given that there are also many testbeds. So keeping a small number of memorable, named configurations may be the only feasible option.
Alternatively, there is some discussion in #1009 about hiding option values from targets, except when we know they're using it safely (inside mkIf (value != null)), which may reduce the need to test every combination.
i am beginning to question having a test case which sets both the image and the scheme but not the cursor, though. maybe we could remove that test case and just have these four:
testbed:alacrity:all:dark testbed:alacrity:all:light testbed:alacritty:image testbed:alacritty:scheme
Yes, it might be better to do the opposite of what we currently have: all testbeds have a cursor and only one does not. In that case the cursor specific testbed validates the cursor = null scenario.
for modules with multiple targets, i think that we don't really need the module folder name because any prospective contributor or person using a testbed should hopefully either have the sense to find "vesktop" under the "discord" module or do a quick search of the repo for "vesktop"
Do you mean that testbed:discord:{vencord,vesktop} should be replaced with testbed:{vencord,vesktop}? In that case, how would we detect this case, unless the /modules/<MODULE>/testbeds/default.nix default testbeds are simply renamed to /modules/<MODULE>/testbeds/<MODULE>.nix?
though i deleted the branch (a mistake i don't plan to make again), i can recreate and reopen if you would like, though it would likely still be best that only arbitrary or only generated test case names are supported.
GitHub never deletes commits (unless in extreme cases), including PR commits. This is both a compatibility safety and security nightmare. Either way, your PR is therefore technically not lost and trivially restorable from the GitHub UI.
we could programatically name the testbeds the shortest possible name by removing the default "default" and specifying either what the test case has or what it doesn't:
We could have shortcuts to the most featureful configuration, for where we use it as a "preview" in the documentation, and then use the longer name for automated tests. Only showing the items which are set to
nullwould conveniently implement this.
Good idea. In that case, it should probably not have the testbed: prefix since it is not meant to be used as a testbed, although it is internally an alias to an existing testbed.
We should also note that once every item supports being set to
null, then there will be at least these things which are varied in the testbed:
- Polarity
- Colors
- Wallpaper
- Fonts
- Icons
- Cursors
To test every possible combination, we would need $$2^6 = 64$$ configurations per testbed. That's obviously not feasible to build for every pull request, given that there are also many testbeds. So keeping a small number of memorable, named configurations may be the only feasible option.
Good point. For reference, here are some numbers putting this into context. Considering we currently have 25 testbeds and that each testbed takes around 100 seconds in the GitHub CI, and assuming that testbeds do not run in parallel, it would take (100 / (60 * 60 * 24)) * 25 * 2^6 = 1.851852 days to run one CI. Even running 16 testbeds fully parallel on the CI would still take 2.8 hours. Clearly, we cannot afford to test everything.
We definitely, want one testbed where all optional values are disabled (set to null) and one testbed where all values are set to some value (potentially a non-default value, if we bother or care enough). The state explosion comes from all possible 2^6 = 64 option permutations. What combinations are worth testing is to be decided. Computing some theoretical upper bound, similar to my previous formula (my parallization factor is likely not realistic and it does not take potential future caching optimizations into account as discussed in https://github.com/danth/stylix/pull/749), might be a good first approach. It should be taken into consideration that we will have at least 100 testbeds in the somewhat near future.
for modules with multiple targets, i think that we don't really need the module folder name because any prospective contributor or person using a testbed should hopefully either have the sense to find "vesktop" under the "discord" module or do a quick search of the repo for "vesktop"
Do you mean that
testbed:discord:{vencord,vesktop}should be replaced withtestbed:{vencord,vesktop}? In that case, how would we detect this case, unless the/modules/<MODULE>/testbeds/default.nixdefault testbeds are simply renamed to/modules/<MODULE>/testbeds/<MODULE>.nix?
yes. we can treat the file testbeds/default.nix differently, or we can rename existing default testbeds to their module name.
We should also note that once every item supports being set to
null, then there will be at least these things which are varied in the testbed:
- Polarity
- Colors
- Wallpaper
- Fonts
- Icons
- Cursors
To test every possible combination, we would need 64 configurations per testbed. That's obviously not feasible to build for every pull request, given that there are also many testbeds. So keeping a small number of memorable, named configurations may be the only feasible option.
We definitely, want one testbed where all optional values are disabled (set to
null) and one testbed where all values are set to some value (potentially a non-default value, if we bother or care enough). The state explosion comes from all possible2^6 = 64option permutations. What combinations are worth testing is to be decided.
the only options that i know to affect each other are polarity, colors, and wallpaper, and polarity's impacts are generally negligible from a pure evaluation testing standpoint. test cases with image only, scheme only, all set, and all null are the only tests i can imagine possibly yielding different errors and successes from one another, and i believe that checking evaluation is the main purpose of the test cases right now (until handmade schemes are added).
The --arg flag could also be used to pass optional preferences
I'm also pretty sure that packages can take arguments when using nix run.
This was fixed by #1094, right?