Commit Graph
89 Commits
Author SHA1 Message Date
rootileandpiegames 7bd3202175 lix/code-generation: add timeline information to deprecated features
Change-Id: I5d5cf28c62cea116cb01bf433eb69a8c859809a8
2026-01-31 15:32:27 +01:00
Commentator2.0andpiegames 8c857790a3 lix/code-generation: clean up code properly
The code within the code-generation had tons of code-duplicates and was
overall quite meh to read, understand and expand.

This commit refactors the code-generation to make it more readable and
comprehensible, while also unifying its usage a bit more

Change-Id: I3a5df8b7d8d9b6c76e02ef47dfb151c7dab7d0ab
2026-01-31 15:32:27 +01:00
rootile 2f7644c420 tests/functional2: fix wrong usage of env var
Change-Id: I37580e0d74e26e064261c98a1162fbd9e23a9d46
2026-01-23 16:15:55 +01:00
Commentator2.0 eca222c7ca tests/functional2: migrate dump-db.sh
Change-Id: Ife8ff62add37f50867f55a5eaa26f7a68fad1c78
2026-01-20 10:08:36 +00:00
Commentator2.0 cdd8508bc9 tests/functional2: Provide a shortcut to clear a store
Change-Id: Ic28fb8a81ef95a1b83fa8099f5337e89f630f8e1
2026-01-20 10:08:14 +00:00
Commentator2.0andeldritch horrors 8f474399f5 tests/functional2/nix: only convert path to physical if it isn't already
Change-Id: I88e5079ef01872302aade365444d9b028088ff95
2026-01-15 16:06:59 +01:00
Commentator2.0 042a147aff f2/lang: rename the test functions to be selectable using their expected names
one would expect the lang tests to be selectable (using `-k`) using
`eval_okay` `eval_fail` etc though this was not the case so far.

This commit renames the functions to reflect the expected names

Change-Id: I4cd340c093d774feeb4d96820d28e49c665b159f
2026-01-15 15:30:34 +01:00
Commentator2.0 455724d9dc tests/functional2: rename binary cache directory for easier debugging which (cache) cache is being used
Change-Id: Id5a446422a8e1535ada723115bb2d8a10b0f2b8a
2026-01-15 11:37:02 +00:00
Commentator2.0 8f9ed687da code-generation: run ruff
Change-Id: I591247ed56f89feba5daf3cbb94211d72a3ba99c
2026-01-10 00:07:33 +00:00
Commentator2.0 8798cdcd30 tests/functional2: migrate compression-levels.sh
Change-Id: I4a0257f6c0dd7df9b0ec82d0164a3bae7e978c9c
2026-01-04 15:57:36 +01:00
Commentator2.0 1c42640347 tests/functional2: fix build-shell not working properly on darwin when running tests outside of meson
Change-Id: If5068ad5460d08de69f64f924c4e86e56ac0559c
2025-12-29 21:06:28 +01:00
Commentator2.0 ac1b8e91d6 maintainers: run ruff
additionally, the issue_import has been removed, as our mirror has been
disconued

Change-Id: I8cb4c807db6c415b0fd340ead58be341a05e6a34
2025-12-29 17:55:16 +00:00
Commentator2.0 c0f177081b fix: tests/functional2/lang: remove empty file
apparently this file slipped through the code review (the actual test
does exist, no worries) but this empty file and init py exist, sitting
here empty. This commit drops them as they serve no purpose

see commit 1b7ad3a7ad

Change-Id: I64c4e03cd3ceedf9e430ae014127966bd8e4269d
2025-12-23 14:38:23 +01:00
Commentator2.0 c1debca36b tests/functional2: migrate tarball.sh
Change-Id: I8fb889a5723e34453597fbce2e027fb49a859319
2025-12-19 20:44:25 +01:00
Commentator2.0 fc0073f540 tests/functional2: provide an empty repository as a global asset (needed for flake tests)
Change-Id: Icef02d7ae9594aa73a1679bed8f98be053fb693c
2025-12-16 11:15:51 +00:00
Commentator2.0 b2ee6c36a0 tests/functional2: paritally migrate test_fixed.sh
Change-Id: I3e4479b3ca718f24f604b52a6717ce18f793553b
2025-12-16 08:31:50 +00:00
Commentator2.0 a078462013 tests/functional2: refactor global assets
make the global_assets folder more readable by placing asset pack files
within a dedicated folder instead of building up a mess similar to f1

Change-Id: Ia2c16f38eb6da96e1e73584bd91391ee56acb410
2025-12-16 08:31:40 +00:00
Commentator2.0andQyriad 0bcaffa640 functional2: add a hash_path shortcut to Nix
Co-authored-by: Qyriad <qyriad@qyriad.me>

Change-Id: If0b9213d264b60e687ceb2d4d232d23f6a6a6964
2025-12-07 15:34:03 +01:00
Commentator2.0 07dccd67d6 treefmt/ruff: remove EM rules as they cause unnecessary work with no real upside
As discussed in the F2 matrix channel, not being able to put the error
message inside of the thrown exception just results in one assigning an
additional variable to immediatly throw it. The original reason for
these rules to exist are that the message isn't printed twice, though
the line above the thrown exception is printed anyways in the
stacktrace, so we still get the error message twice but now with
additional work.

Hence this commit removes the said rules

Change-Id: I0b37c0b0861334703a5772c36353d31441f19dcd
2025-12-05 13:45:59 +00:00
Commentator2.0 f65b83df3b treefmt/ruff: extract ruff config from f2 to global state
So far, our ruff config was confined to the f2 package. This meant, that
when one added additional paths to the ruff formatter, those wouldn't
get the same rules applied as f2, resulting in inconsistent styling
thoughout the project.

Due to how configs are resolved, only the "closesed" pyproject toml is
considered. This means, we need to tell f2 to extend its configuration
with the base level one. Though no change is required for other parts of
the project, as long as they don't have their own pyproject.toml

Change-Id: I145c764e7b850194020b5560e1025f4aa80411ae
2025-12-05 13:45:47 +00:00
Commentator2.0andQyriad 85443e0fd8 tests/functional2: migrate completions.sh
Change-Id: I186a1ddd8d56386f9d1308430f517cdec483af14
2025-12-05 13:33:20 +01:00
Commentator2.0 8f5bf1e905 libstore/machines: add enable flag for toml machines
Provide a way to statically disable a machine.
This is fully static and not dynamic.

Change-Id: I394433ad533bca5dbf6a2f7fea22b8aa0f5aad3f
2025-12-04 12:11:23 +01:00
Commentator2.0andQyriad 3fcfedc216 libstore/machines: add toml parser
implements #854

Co-authored-by: Qyriad <qyriad@qyriad.me>
Change-Id: I958d082ccdf03179b35d5ab8a810ebafcff3b6c5
2025-12-03 21:36:53 +01:00
Commentator2.0 23c341d76d libstore/machines: move legacy parser to own namespace
Change-Id: I4ecf1e56e713cd32b6a443f9d195c1beb0cb2f7f
2025-12-03 20:10:35 +01:00
Commentator2.0 d0a655fc8a libstore/machines: refactor machine parsing
Change-Id: I216592e089328d68f9ca48203a19fd964356249b
2025-12-03 20:10:35 +01:00
Commentator2.0 8353b3cc6a tests/functional2: fix non-working failsafe and resulting warning
Silly me forgot to add the dependency responsible for handling
`@pytest.mark.timeout` failsafes to kill a test if it takes too long,
which results in a warning when running f2.
This commit adds the required dependency and hence removes the warning

Change-Id: I281cad05bb0cf50208f72080cb2bfd8cbfb09d0c
2025-12-02 19:52:38 +00:00
Commentator2.0 3661f34aba tests/functional2: fix --accept-tests not propagating to infra tests correctly
gotta make sure to do things in the correct order next time -_-

Change-Id: I84ba6495100e658aa35fac0a0917fae9363fe4dd
2025-11-25 13:43:01 +01:00
Commentator2.0 b707403a30 tests/functional2: migrate eval.sh
Change-Id: Ib5fb9e3b5d76612e7259ec17fb890298198fc885
2025-11-21 17:35:47 +00:00
Commentator2.0 40416d103f tests/functional: remove the now fully migrated lang framework
We have done it!
The functional/lang framework has fully been migrated to functional2 :D

closes: #856

Change-Id: I63ad8d7dbcd9b5267ca04af68df73b1ffa3d6461
2025-11-21 17:02:35 +00:00
Commentator2.0 9be0c2ee15 releng: issue references are now lix issues by default
After multiple cycles of deprecation, we now use the lix repositorty as
a default, when no prefix is defined

Change-Id: I29b445fee39fb20c0ff024e3b95402f459144b62
2025-11-20 18:03:45 +00:00
Commentator2.0 1b7ad3a7ad tests/functional2: Migrate symlink-resolution
the newly added f1/lang tests is required for the f1/lang framework
dismanteling to happen in a separate commit

Change-Id: Ic419c515262294c51a46d1513daa7848e4b71405
2025-11-18 20:01:23 +01:00
Commentator2.0 2497e0101e tests/functional2/lang: Migrate builtins.pathExists
Change-Id: Ib31b7dddc71ae36924822f300b028bf354f63874
2025-11-18 20:01:23 +01:00
Commentator2.0 3eeb5d10ba tests/functional2/lang: fix warnings
While the err file should always be empty, we prefer not have (easily
avoidable) warnings in the log, in order for actual warnings to be
spotted more easily.
Additionally this way no additional changes are required in case they
make use of some depreacted features in the future.

Change-Id: Ie078e2a851b2035d839f6b95d4188e475eb96b2d
2025-11-18 20:01:23 +01:00
Commentator2.0 c589a95546 tests/functional2/lang: Migrate builtins.getEnv
Change-Id: I9e30d9bf897854e8843194779034fd98d172bcf1
2025-11-18 19:52:17 +01:00
Commentator2.0 4da70ab3bd tests/functional2/lang: Migrate eval-okay-xml
Change-Id: Ib626c3f4ca38b618bab368f0d23829debc5ec38b
2025-11-18 19:52:17 +01:00
Commentator2.0 68a39b1d6e tests/functional2/lang: Migrate builtins.derivationStrict
Change-Id: I42781af8b5b4a2352e867a07712a752ddfdeaa35
2025-11-18 19:45:15 +01:00
Commentator2.0 86964fb440 tests/functional2/lang: Migrate path-string-interpolation
Change-Id: I6f5d1830363c8dff4fa6b368550c8c4247766609
2025-11-18 19:45:15 +01:00
Commentator2.0 8d75a61f73 tests/functional2/lang: Migrate builtins.addDrvOutputDependencies
This also marks the end of eval-fail-* migrations

Change-Id: If06a60cd9d222bba5fc4f9a9b93de125e7fa2994
2025-11-18 19:45:15 +01:00
Commentator2.0 89a9d6e529 tests/functional2/lang: Migrate string coersion for integers
Change-Id: I428c8935119b3184109b3e3f760ed72054b0cd00
2025-11-18 19:45:15 +01:00
Commentator2.0 acf6e1c6b7 tests/functional2/file_helper: add a way to interpolate environment variables into files
So far it was impossible to put absolute paths into files, as one
wouldn't know whre the test would be placed.
This commit adds a new Fileish variant called `EnvTemplate` which uses
the given string as a template and replaces the `@ENV_VARIABLE_NAME@`
placeholders with the according value of the environment variable.
This way one can use `@HOME@` or `@TEST_ROOT@` to build absolute paths

Change-Id: I425cb6408dceb8d7f26d136ace4ac98b1ca31ec3
2025-11-03 12:58:37 +00:00
Commentator2.0 9ed75192ec tests/functional2: fix crash on empty nix.nix([]) calls on darwin
Calling `nix.nix` with an empty argument list, would crash on darwin due
to a Index Out Of Range Error, as the build="auto" functionallity would
try to access the first element of the provided arguments (second
element at the place of call) resulting in a crash

Change-Id: Ia678109808b3f75a30182114baa421cedaa8759b
2025-10-30 18:53:11 +00:00
Commentator2.0 73c019c57b tests/functional2/lang: allow adding requiring of global assets like config.nix
Change-Id: Ia740b91fb3d18f7d01c0d551196b71e7f3e46384
2025-10-27 17:07:47 +01:00
Commentator2.0 2541db5321 tests/functional2/lang: fix expected skip message
it seems like pytest is updating the message printed when skipping a set
due to no parametrization
which leads to breakage on staging-next.
this commit changes the expected message to allow both old and new skip
message

Change-Id: I34d11ad84d7075911d8229fbc89889bb880a27c9
2025-10-18 17:19:01 +02:00
Commentator2.0 0ac71ea1cc tests/functional2/lang: fix wrong unused file error for generic test group collection
Change-Id: I1c548fcebe45d2a6621987091e3a852b8a9b5765
2025-10-18 11:24:00 +00:00
Commentator2.0 4fcfdc66fe tests/functional2: migrate debugger.sh
Change-Id: I82c5b739db09530ff216c91608be2f70a2036e11
2025-10-18 11:23:43 +00:00
Commentator2.0 844feb17b5 tests/functional2/lang: fix duplicate collection when both err and out are provided
When providing both a `.err.exp` and a `.out.exp` for a lang test
**not** containing a toml, the test was collected twice and hence threw
a duplicate id error.
This commit adresses this issue

Change-Id: Ia781d69e0f1db2809a30192d6cd0a98861e6cc32
2025-10-13 14:33:25 +00:00
Commentator2.0 d9c1c0925c unify version string between lix and nixos-module
Currenlty `lix` and `nixos-module` have slightly diverging version
numbering. This commit fixes the lix side of things, in accordance to
the format proposed in
https://git.lix.systems/lix-project/lix/issues/585#issuecomment-7336
which allows for better use of `builtins.compareVersions`

fixes #585

Change-Id: I2072b701f9fadf780e7aab67b62fbcd2ec5df76d
2025-10-11 18:47:46 +00:00
Commentator2.0 5e2412ea7e tests/functional2: migrate add.sh
Change-Id: I699929b61db19a4ab7bea8281df830de9fea6d04
2025-10-08 13:09:17 +02:00
Commentator2.0 1e69b17f0a tests/functional2: migrate timeout.sh
Change-Id: Ieb12c46bc987c74a6adda07e6c6ed33aebf8a96c
2025-09-21 17:56:19 +02:00
Commentator2.0 e0739afb42 tests/functional2: migrate build.sh
Change-Id: Iac3f3dc021436fc693a3729ba522d4bf1f124220
2025-09-21 13:58:26 +02:00
Commentator2.0 3a4f9488f0 tests/functional2: migrate nix_path.sh
Change-Id: Ibc4f848721d4da628c44aa074faf009c87af165d
2025-09-19 20:51:49 +02:00
Commentator2.0 fc2eedf9db tests/functional2: migrate why-depends.sh
Make builds work on darwin and migrate the first building test :D

Change-Id: Ia301c78d3bc771cd826d93dc114b098167043e97
2025-09-19 20:51:49 +02:00
Commentator2.0 a25a5739c7 tests/functional2: migrate search.sh
Change-Id: Id0f47fc72191d913442ff35d47df1b87ceb9f0be
2025-09-19 15:09:22 +02:00
Commentator2.0 a9f28622c8 tests/functional2: migrate pure-eval.sh
Change-Id: Ieadb54a27b1cedcf3a4ce65e024a68440759ce7e
2025-09-16 20:06:07 +02:00
Commentator2.0 9cdc2bf61c tests/functional2: migrate hash.sh
Change-Id: I5061479b972088c904ca1db4d9004e738c2b5a57
2025-08-25 21:29:27 +02:00
Commentator2.0andCommentator2.0 7b6a85982b tests/functional2: provide a way to easily access often used assets
Change-Id: I461ee08d9752d972e7485e15186426f98e68ba13
2025-08-24 10:38:39 +02:00
Commentator2.0andCommentator2.0 7553d0a983 tests/functional2/lang: don't throw unused file errors on invalid configurations
Currenlty, when a test group is invalid already, we also throw unsued
file errors.
This leads to clutter as more often than not, the unused files are
caused by an invalid configuration, making the debug stack bigger
without reason.

With this commit the behavior is changed to only error about unused
files, when no other configuration issues were found

Change-Id: I92a819753f13b8ed5a07dae53ecaee5d84b5ce64
2025-08-22 07:50:20 +02:00
Commentator2.0andCommentator2.0 0a3e43590c tests/functional2: improve files ux
Currenlty one is required to always write the bulky `mark.parametrize`
with indirect and things

This commit adds a custom decorator for usage of files, which hides the
parametrization complexity from the user.

Change-Id: I526e016d12006669dc302dfc5af619735399c503
2025-08-22 07:50:20 +02:00
Commentator2.0 d8b1fb7799 tests/functional2/lang: replace toml with tomllib
currenlty we use the external package `toml`, this just adds an
unnessecary dependency, as python ships its own toml as `tomllib`

Change-Id: Ia63fa7558973e853ada20cbfa21d897d700444f8
2025-08-18 20:08:09 +02:00
Commentator2.0andRutile 7869385b98 tests/functional2: Make Command Environment actually declarative
So far, the environment used by `command` was completely leaky and the
one used by `nix` was very leaky despite it trying to be a "hermetic"
environment.
This commit moves the hermaticity to `command` and changes its
implementation to be not leak anything.

To achieve this, the following changes were also nessecary:
- the `files` and `snapshot` fixture now use the folder `test-home`
within the tmp_path directory by default, as the `HOME` environment
variable is set to there. (extraction not possible due to dependencies
of command etc also using this directory)

Fixes: #847, #848

Change-Id: I55f86ee0e1615e73fcf442ee2f28f3b89893bbb4
2025-08-15 06:56:07 +00:00
Commentator2.0andCommentator2.0 8bbd5e1d0d tests/functional2: do not copy testlib tests to internal environment
When testing specific internal functionallity while needing things from
the testlib, so far, the tests for the testlib have always been copied
too.
To reduce the amount of additional program required when later making
the env of the pytest_command declarative, and to not test the same
tests a multitude of times (and potentially reaching infinite recursion)
those tests will no longer be copied

Change-Id: I36ec3824a21ed30f9b8ff19948031d1edbf6c76c
2025-08-07 14:25:51 +02:00
Commentator2.0 35c3bfdacb tests/functional2/lang: require all files to be used
Added an additional check that all files present within a folder must be
used/referenced. Otherwise an InvalidLangTest will be created.
This ensures that there weren't any mishaps while migrating tests
resulting in files being ignored and hence some tests not being run.

Fixes: #852

Change-Id: Ie096c5670bc20325ba72c7d6ce33c06667c66ab1
2025-06-20 11:36:13 +02:00
Commentator2.0 d1afc83676 tests/functional2/lang: improve toml design
Redesigns the test.toml to use a list instead of a directory
additionally it is now possible to do toml and matrix tests on singular
files as well as on a subset of files.

Fixes: #851

Change-Id: If8635109c6274f406ad68fe35315b9125f45f67d
2025-06-20 11:36:13 +02:00
Commentator2.0 f2eb920e46 tests/functional2/lang: improve assertion failure message
Currently when a lang test fails, (or any snapshot assertion for that
matter) the error message is rather bulky.
This is due to both sides being printed fully, using escaped newlines
(i.e. everything is one line)

This is awful to read and check what the actual difference is. Also
there is no indication that one can update the golden files using the
cli flag.

This commit changes the error message when comparing snapshots against
something
a list of lines is shown, where the output differed. An additional note
about how to update the files automatically was added too

Change-Id: Ibedcf48018c27f924b807fbd42362fb608d27441
2025-06-20 11:26:03 +02:00
Commentator2.0 004a505dc6 tests/functional2/nix: fix config serialization
Currently, the typecheck for the config values is only done
half-heartedly only checking if something is either a list or non-list
item, but not checking what type the list items are

this commit fixes the typecheck and adds test for proper serialization

Change-Id: Ifd93842b19b1dd870bdb3af0c000243b4380e7aa
2025-06-07 00:14:57 +02:00
Commentator2.0 0625e69912 tests/functional2: fix bad error message when merging files
The error message used to only contain the last key of the merge failure
this commit changes the message to contain the full path to the merge
conflict, resolving ambiguity

Change-Id: I9848a559b1b888e50a548eef8609bf34506040de
2025-06-07 00:14:57 +02:00
Commentator2.0 afa5b924cd tests/functional2: improve type checking util
currently, there is a small helper funciton in lang_util to check if
something is of a list type generic

to improve re-usability, this function is moved to utils and improved to
be also check for nested iterables and such

Change-Id: I92984daa4c4decf13d340a2ea5e52f724cee800e
2025-06-07 00:14:57 +02:00
Commentator2.0 530b40ac8e tests/functional2: fix overly broad xfail test passing
By default, xfail tests will always "pass" when the test fails,
disrecsarding any restrictions put on them via their parameters.

By enabling the `xfail_strict` option, xfails won't pass anymore when
the failstate is different from what is described in their parameters.

Change-Id: Ifea6e27d716d91f60210e6ba24175074fa39c304
2025-06-02 16:33:46 +02:00
Commentator2.0 8c528529fc docs/functional2: overhaul documentation
Add Documentation for usage and development within functional2
including common fixtures and where to find them

This is done to make the migration from functional easier and give devs
a reference for how one writes tests

Change-Id: I6ee73e654d245fd4ad43e495d1172e406313cb23
2025-06-01 20:19:37 +02:00
Commentator2.0 c63ba3c485 tests/functional2/lang: migrated first tests
Change-Id: I4b5755a63d9454db20f63f751f5f33564a2ee5be
2025-06-01 20:19:37 +02:00
Commentator2.0 f7914e89e6 tests/functional2: add framework for lang tests
This creates a framework similar to the old lang.sh from functional.
Some notable changes:
- instead of having a .flags file, a test.toml can declare flags
- additionally the test.toml can also declare extra files and multiple
runners for the given input file.
- there won't be any old tests hanging around anymore which weren't
deleted properly in the installation
- all files for a single test are defined decleratively and there won't
be any residues

Tests can be placed within the functional2/lang folder
most migrations should be rather clean

Implements: #825

Change-Id: I5f9149903ec5b078008969a4ae77305417c11475
2025-06-01 20:19:37 +02:00
Commentator2.0 696efc58e7 tests/functional2: mark tests as skipped when snapshot updates golden files
Currently, tests are marked as "passed" when golden files are updated.
With this change, the tests are marked as skipped instead.

Additionally finally introduces tests to check if the snapshot behaves
as expected

Change-Id: I438eed70e0b94d561e99cc1e0363092809da827e
2025-06-01 20:19:37 +02:00
Commentator2.0 761a4f544c tests/functional2: add utils for files and paths; add pytest_command fixture
Add utils for general-use functions and paths

Additionally introduces a pytest_command fixture, which creates a
testing environment for pytest within the tmp_path. This allows for
encapsulated testing of our frameworks (i.e. snapshot, lang etc)

Change-Id: Ic0a5bc4bfc0b0bfbac15bc51dd4a94fae6ee6f26
2025-06-01 20:19:37 +02:00
Commentator2.0 80ea9c682a tests/functional2/files: allow absolute paths as origin
allow to pass absolute paths or similar Path entries to declaration of
files instead of just string paths relative to the requesting file

Change-Id: I616da6abbb73d1d63ead370e9ae37a401d85f42d
2025-06-01 20:19:37 +02:00
Commentator2.0 5a6bb0fb50 tests/functional2: add runner to justfile
Due to how meson works with the current justfile options, it is not
possible to pass additional arguments into the functional2 test
suit/pytest.
Due to that, it isn't possilbe to narrow down what tests to execute or
add output options or similar.

This commit adds an additional recipe, calling pytest directly ensuring
arguments are handed through

Change-Id: I3748d1cd5fddc16b11fff11c0f1a77195e37c837
2025-06-01 20:19:37 +02:00
Commentator2.0 dbff52bfbc tests/functional2: improve commands ux
with_env now overrides the environment, similar to with_stdin
an additional function update_env was created to mirror the prior
functionality of with_env, updating the env

This was changed as previously it was impossible to delete variables
from the env

replaced the code of .ok() with a call to .expect, to remove the code
duplication

Change-Id: I83933893c7f2ccfdc7bd4933b7592b475c435e76
2025-05-25 16:21:28 +02:00
Commentator2.0 438cb4cb31 tests/functional2: move commands to own lib file
Currently the Command and CommandResult classes are mixed into the nix
fixture file.
This commit moves them out into their own lib file, to make it more
obvious that they can be used standalone for other applications too

Additionally improved documentation of said classes
and bumped log level of stdout and err on unexpected exitcodes, as it is
within an error context

Change-Id: If2d554acde86fd54f2445fc46453f06923af5fe9
2025-05-24 14:38:56 +02:00
Commentator2.0 5daddad39a tests/functional2: Fix pytest garbage collection
Due to nix-store making its paths read-only, pytest was unable to remove
the test files and hence the entire temporary directory, screaming all
over the place in stderr about that, getting worse for each test run.

By making the nix fixture first yield nix and then, after the test
finished running, changing the file permissions to include read on all
files and directories within the temp folder, pytest is able to properly
remove old test runs again

Additionally added more clear instructions for file deletion to the
pytest configuration

Change-Id: Ia7e3d195665968ac80a57d0e525691b28be7f503
2025-05-22 13:51:23 +02:00
Commentator2.0andLix Systems Gerrit dbfb85ab18 Merge "tests/functional2: add snapshot fixture" into main 2025-05-21 19:29:31 +00:00
Commentator2.0 573788f75a tests/functional2: add snapshot fixture
Add a snapshot fixture, which allows comparing and updating strings
against external files

resolves #595

Change-Id: I518f594c601eb7805c6492c0352fca753fda04c9
2025-05-21 20:36:20 +02:00
Commentator2.0andLix Systems Gerrit 1da9c0261e Merge changes I6830c2fc,Ib88565a1,I0b280587 into main
* changes:
  functional2: Added ruff formatter
  functional2: use loggers
  fix codestyle of functional2
2025-05-10 20:49:43 +00:00
Commentator2.0 b17502088d functional2: Added ruff formatter
Ruff is used to enforce our code-style for the python parts of the
reposity, similar to clang-tidy for the cpp parts.

This includes a pre-commit hook to format code before it is committed
When "unfixable" - i.e. no autoformatting is available - the commit is
rejected

resolves #812

Change-Id: I6830c2fc29ae86337ec18f2b0e3565fac66c5523
2025-05-10 22:14:10 +02:00
Commentator2.0 01985e5add functional2: use loggers
Use logger in favor over print statment.
This is explicitly supported and encuraged by pytest, which also allows
for capturing logs separate from stdout calls, which is handy for when
e.g. lix code calls out to stdout to keep those differentiated from test
output

Change-Id: Ib88565a1663da3b77ca6b95f8edf644eafb4a99d
2025-05-10 21:13:45 +02:00
Commentator2.0 427696a58d fix codestyle of functional2
Fixing up codestyle issues found within functional2 for later adding
ruff formatter

Change-Id: I0b280587c8243137184091a6d36df3dfe7568eb7
2025-05-10 21:13:45 +02:00
Commentator2.0andLix Systems Gerrit 8e832006eb Merge "move nix fixture to own file" into main 2025-05-09 11:15:52 +00:00
Commentator2.0andLix Systems Gerrit 1fba1eec58 Merge "Added functions for copying files into tempdir for declarative testing without side effects" into main 2025-05-09 11:15:11 +00:00
Commentator2.0 d22b8bd613 move nix fixture to own file
separating the nix fixture from the __init__.py file to increase
readability and overview over the existing fixtures

Change-Id: I7a86cb729942e83a95b9eabbb09563822f3f9e54
2025-05-07 20:02:32 +02:00
Commentator2.0 8fe8147850 Added functions for copying files into tempdir for declarative testing without side effects
Resolves: #601

Change-Id: I79661e96149fa133fe003c698efb47f4c54bbf1a
2025-05-07 16:04:06 +02:00
Commentator2.0 fb0ef6ca6b Made parser warnings use Error info
no other warn calls were found, which have position information

Change-Id: If9773b86a756e5b2e4096d3f6b3a5114bfed5bee
2025-04-08 10:21:53 +02:00