naersk/test
Patryk Wychowaniec 88cd223801 Fix detection of symlinked Cargo.tomls
This commit fixes a bug introduced in #276 where symlinked Cargo.tomls
wouldn't get detected due to readDir() reporting them as - well -
_symlinks_ instead of regular files.

Note that we continue to keep the `if type == "directory"` condition for
recursion which means that we'll fail to detect "nested" Cargo.tomls if
someone decides to go wild and create workspace with symlinked crates.

That I'm not 100% sure on how to approach, but fortunately cases like
those seem to be practically non-existent (and Crane apparently not
supporting them builds a bit of confidence here as well).

Closes #280.
2023-03-23 11:29:54 +01:00
..
fast Fix detection of symlinked Cargo.tomls 2023-03-23 11:29:54 +01:00
slow Improve Cargo.toml discovery algorithm 2023-03-21 07:54:44 +01:00
default.nix refactor: Refactor tests into separate files 2022-05-03 12:41:13 +02:00
README.md refactor: Refactor tests into separate files 2022-05-03 12:41:13 +02:00

Tests

This directory contains a handful of naersk's tests; you can run them locally with:

# First, you have to be in the naersk's top-level directory:
$ cd ..

# Then:
$ ./script/test

Caveats

Dynamically-built Git repositories

Some tests (their READMEs will tell you which ones) utilize dynamically-built Git repositories (i.e. repositories built ad hoc during the testing through pkgs.runCommand).

Those tests' Cargo.toml and Cargo.lock contain variables (e.g. $depPath, $depRev etc.) that are substituted through our Nix code before the test is run.

Because of that, it's not possible to execute those tests via cargo test (for whatever the reason you'd like to).