about summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-02-14T11·41+0100
committersterni <sternenseemann@systemli.org>2021-02-14T12·40+0000
commitbeed354904133f5ea823df92d6a0e52c2fb48e3b (patch)
treead79ce09ded02844b415f04f448c6e26bce2e097 /default.nix
parentabbc538ef348f4faa31c93d145193a38b2af9bf9 (diff)
feat(users/Profpatsch/writers): testRustSimple to test rust crates r/2215
testRustSimple is intended to wrap rustSimpleLib and rustSimpleBin and
theoretically pkgs.buildRustCrate with { buildTests = false; } while
building and running their tests, making them fail if the tests don't
succeed.

This is implemented using nix.drvSeqL which is a perfect fit here:

* { buildTests = true; } only returns an output with the test binaries
  and does not actually run the tests. With drvSeqL we can easily wrap
  this derivation.
* { buildTests = true } doesn't contain anything other derivations want
  to depend on, so it is an derivation output we don't want to have.
  drvSeqL hides the tests derivation away and only requires us to build
  it once.
* Usually drvSeqL has the issue that tests (or advantage) are not rebuilt
  if the test derivation changes. This is no question in this case as
  due to the embedded nature of Rust's test, both the derivation with
  and without tests change anyways regardless of which part was changed.

Future work: Allow injecting other tests?

Change-Id: If6ecfb3a360ce059320dbb05642b391b617aede7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2529
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Diffstat (limited to 'default.nix')
0 files changed, 0 insertions, 0 deletions