about summary refs log tree commit diff
path: root/tvix/glue/src/tests/tvix_tests
AgeCommit message (Collapse)AuthorFilesLines
2024-04-23 r/7996 feat(tvix/glue/fetchers): support file:// URLsFlorian Klink2-3/+5
Nix supports file:// - URLs for `fetchurl` and `fetchTarball`. Convert the enums and function arguments to hold a URL type. reqwest::Url is a re-export of the url crate, but they don't re-export the parsing errors, and as we want to hold these in our Error types, add it to Cargo.toml explicitly. The Fetcher::download function now checks on the scheme, and either opens the file locally, or does do a HTTP request as before. Fetch gets its custom debug impl, removing potentially sensitive username and password out of URLs. Change-Id: I777db1fe487370e822cbfec4624034aca5e08045 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11504 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
2024-04-23 r/7995 test(tvix/glue): add tests for fetchurl and fetchTarballFlorian Klink4-0/+67
Change-Id: I53a0590ecf4e5fcb1bfd1d127824211338e28256 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11503 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz> Reviewed-by: Connor Brewster <cbrewster@hey.com>
2024-04-13 r/7899 feat(tvix/eval): contextful JSON operationsRyan Lahfa4-2/+35
`toJSON` transform a Nix structure into a JSON string. For each context in that Nix structure, the JSON string must possess it. Thus, it is necessary to take the union of all contexts and attach it to the final structure. Unfortunately, the return type of `into_json` is a serde's JSON object, not a string. Therefore, it is not possible to reuse `NixString` machinery. Context tests are reinforced as Nix does not test those behaviors. Fixes b/393. Change-Id: I5afdbc4e18dd70469192c1aa657d1049ba330149 Signed-off-by: Ryan Lahfa <tvl@lahfa.xyz> Reviewed-on: https://cl.tvl.fyi/c/depot/+/11266 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-04-03 r/7850 fix(tvix/glue): produce context for `builtins.(path|filterSource)`Ryan Lahfa2-1/+9
Fixes b/392. Output paths were created, depending on a plain store path but no context string was attached to track that plain dependency. Context string propagation tests are strengthened to prevent any regression on this. Change-Id: Ifd6671aeba6949324b0bb9f0f766b87db728d484 Signed-off-by: Ryan Lahfa <tvl@lahfa.xyz> Reviewed-on: https://cl.tvl.fyi/c/depot/+/11351 Reviewed-by: Alyssa Ross <hi@alyssa.is> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-01-22 r/7439 fix(tvix/glue/tests): resolve logic error in hasContextInAttrKeyssterni1-1/+2
Change-Id: I7aa09c10f803c2b79363fe3eb52c1127276a333b Reviewed-on: https://cl.tvl.fyi/c/depot/+/10676 Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
2024-01-17 r/7404 feat(tvix/glue): introduce test suite for context stringsRyan Lahfa4-0/+162
This is an additional test suite on the top of the Nix ones for context strings matters. It already smoked out multiple mistakes and potential bugs and non-deterministic result from the evaluator. It uses a similar technology as the one in the tvix-eval albeit we instantiate a fully fledged evaluator with in-memory store. We copy the files instead of symlinking them because crates are built in isolation, so symlinks cannot work. Change-Id: I63ae225ce4f83c6e2c8ccd60d779c2f8eb9d08fb Reviewed-on: https://cl.tvl.fyi/c/depot/+/10619 Autosubmit: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>