functional2: add expect-test support #595
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#595
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This will require some adjustment of the expect-test library for python to support parameterization and maybe add slightly better pytest support, since the current way it works is kind of ugly.
Also of note, there is a pytest-expecttest thing; please do not use it; it captures stdout/stderr for the expectations (why?!), whereas the unittest one it was taken from has a much more reasonable design.
The point of this is that we can have really nice inline test-cases for one-liners that snapshot the exact output, sort of like repl characterization.
(n.b. hmm, repl characterization could have totally been a python thing. maybe it will become one later. maybe not. it is not a big deal regardless)
Upstream bug: https://github.com/pytorch/expecttest/issues/25
This issue was mentioned on Gerrit on the following CLs:
ok, reading through different packages of snapshot/exepct testing, i have concluded the following opinion(s):
assert snapshot == some_file_or_value
oversnapshot.assert_match(some_file_or_value)
looking at more existing plugins and their repos, most of them are either not maintiained or barely (latest release i saw of any one was >=1year old)
and then they are either missing features or are just not configurable in the slightest
i'd almost argue to hack something ourselves with the basic functionallity we need
fyi https://github.com/pytorch/expecttest/issues/25 is now fixed and that library looks generally very good now
I'd like to merge https://gerrit.lix.systems/c/lix/+/3145 soon-ish, if nobody opposes. It adds a custom snapshot test runner, but at 90 lines of code including docs I don't see the maintenance costs as too high. Of course, it is limited to file-based comparison and won't be able to update Python strings and stuff, but maybe that's a feature.
That's why I'd like to move forward with that implementation for now to unblock at least functional/lang, and we can always add a more fully-featured
expecttest
library later on should we need more advanced features for certain tests.