functional2: provide a configured config.nix #849

Open
opened 2025-06-08 19:03:27 +00:00 by commentatorforall · 1 comment

Current situation

many of the test from the functional test-suite use/import a config.nix file, similar to the lib.nix file within functional/lang.
Different to the lib.nix file, confix.nix is not fully configured by default (being a config.nix.in file within tests) and being configured on just install by meson.

Resulting Issue

To be able to migrate tests using the config.nix file, would need the test template it. As it is required by multiple tests, there should be a way to auto import/use it, without needing to template it (which could lead to inconsistencies if it is done differently somewhere) and to also reduce boilerplate and code duplication.

Potential Solutions

  • create a session wide fixture somehow providing the config.nix file
  • make the config.nix accessible in testlib/utils.py, providing the according Fileish object to be used in the files fixture parameters

Reaseach

  • for a session wide fixture, one can use tmp_path_factory, as tmp_path is only session scoped
    • one could put the finished templated in the session-wide path
    • files could then pull the file from said folder/fixture
## Current situation many of the test from the `functional` test-suite use/import a `config.nix` file, similar to the `lib.nix` file within `functional/lang`. Different to the `lib.nix` file, confix.nix is not fully configured by default (being a `config.nix.in` file within tests) and being configured on `just install` by meson. ## Resulting Issue To be able to migrate tests using the `config.nix` file, would need the test template it. As it is required by multiple tests, there should be a way to auto import/use it, without needing to template it (which could lead to inconsistencies if it is done differently somewhere) and to also reduce boilerplate and code duplication. ## Potential Solutions - create a session wide fixture somehow providing the config.nix file - make the config.nix accessible in `testlib/utils.py`, providing the according `Fileish` object to be used in the `files` fixture parameters ## Reaseach - for a session wide fixture, one can use `tmp_path_factory`, as `tmp_path` is only session scoped - one could put the finished templated in the session-wide path - `files` could then pull the file from said folder/fixture
Member

This issue was mentioned on Gerrit on the following CLs:

  • comment in cl/3266 ("tests/functional2: migrate why-depends.sh")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/3266", "number": 3266, "kind": "comment"}], "cl_meta": {"3266": {"change_title": "tests/functional2: migrate why-depends.sh"}}} --> This issue was mentioned on Gerrit on the following CLs: * comment in [cl/3266](https://gerrit.lix.systems/c/lix/+/3266) ("tests/functional2: migrate why-depends.sh")
helle self-assigned this 2025-06-08 21:16:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#849
No description provided.