about summary refs log tree commit diff
path: root/third_party/nix/src/tests (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-07-19 r/1399 chore(3p/nix): Enable clang-format check in derivation buildVincent Ambo1-1/+0
This is the easiest way to get the checks up and running for now, but we will probably want to separate out things like this into a separate build step in the future. Change-Id: I8e1a1095aef09b1eee97abad5b6240bc64d14b8c Reviewed-on: https://cl.tvl.fyi/c/depot/+/1287 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-19 r/1398 test(3p/nix): Enable output comparison for evaluator success testsVincent Ambo15-364/+35
Enables loading of the expected output of evaluator tests from the corresponding .exp files, and checks that the output matches. This again leaves some tests behind in the disabled folder, but we now have almost the entire suite up and running so I can get around to cleaning up the disabled ones. Other note: Some tests had XML output, despite not being related to XML testing at all - I'm not sure why they chose to do this, but have converted those test outputs to normal Nix instead. We have a separate test suite for JSON & XML serialisation already, which was contributed by andi-. Change-Id: Id7c42c836edfec4c22db9d893e35489f3e6dd559 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1285 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-19 r/1397 test(3p/nix): Partially enable evaluator success testsVincent Ambo7-0/+28
Enables the `eval-okay-` test suite, with some caveats: * The output is not yet checked against the expected value, so the tests only check that pure evaluation succeeds * A handful of tests have been disabled as they are causing failures that may be related to the DummyStore implementation. Both of these will be addressed in followup commits, but there is already some value in having the pure evaluation tests pass. Change-Id: I62236c95ebffb06dc64a45455a8ee04344c400b7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1284 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-19 r/1395 test(3p/nix): Add property tests for attribute setGriffin Smith2-0/+169
Add a set of property tests for the attribute set (Bindings) class checking that the Merge operation satisfies the monoid laws. This will hopefully become useful to make sure we're not breaking the language semantics as we work towards optimizing or replacing the implementation, but also serves as a test bed for adding rapidcheck-based property tests to the codebase. Change-Id: I1b4b7b6503d08d80c1c5a8f9408fd4b787d00e8e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1283 Reviewed-by: isomer <isomer@tvl.fyi> Tested-by: BuildkiteCI
2020-07-19 r/1390 test(3p/nix): Port language test suite to GoogletestVincent Ambo3-0/+200
This moves the language test suite into Googletest by constructing parameterised tests out of the same language snippets used for the previous lang.sh evaluation. So far this includes support for about 3/4 of all tests, specifically: * all parser success/failure tests * all evaluator failure tests The evaluator success tests will be implemented in a subsequent commit, because the output comparison contains a whole bunch of additional logic that I did not want to cram in here. Change-Id: Icec9f368366cdbaa53b4c7e4472b8b6e8dd72eba Reviewed-on: https://cl.tvl.fyi/c/depot/+/1278 Reviewed-by: glittershark <grfn@gws.fyi> Reviewed-by: isomer <isomer@tvl.fyi> Tested-by: BuildkiteCI
2020-07-19 r/1389 fix(3p/nix/tests): Fail DummyStore::addToStore on non-existent srcPathVincent Ambo2-3/+8
Unfortunately, to guarantee correct behaviour of some evaluation (!) tests, addToStore needs to actually check whether passed in source files exist and fail appropriately. There is a chance that the dependency on this behaviour is actually a bug in the upstream test suite, but my attempts at finding out more about this from, say, the git history have so far been unsuccessful. Change-Id: I311999ea28fcedf5da13a4e627b1c1c8e4e59cbd Reviewed-on: https://cl.tvl.fyi/c/depot/+/1276 Reviewed-by: isomer <isomer@tvl.fyi> Reviewed-by: glittershark <grfn@gws.fyi> Tested-by: BuildkiteCI
2020-07-19 r/1387 chore(3p/nix/tests): Move language test files to src/testsVincent Ambo236-0/+2151
These files will be integrated into the evaluator unit tests instead of running separately via a shell script. Change-Id: I1d229e73b1d862777f5108c86891689900edefbe Reviewed-on: https://cl.tvl.fyi/c/depot/+/1275 Tested-by: BuildkiteCI Reviewed-by: Kane York <rikingcoding@gmail.com> Reviewed-by: isomer <isomer@tvl.fyi>
2020-07-18 r/1378 refactor(3p/nix/tests): Move DummyStore into a separate fileVincent Ambo2-33/+44
This store implementation is required in all unit tests that use the evaluator. Change-Id: I1cfe8cecab8722cd66dc803747821a2be2b2619f Reviewed-on: https://cl.tvl.fyi/c/depot/+/1269 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-18 r/1369 test(3p/nix): Set up scaffolding & fix up tests for value-to-{json|xml}Vincent Ambo2-45/+57
Configures the CMake build to load & run the GoogleTest tests. I (grfn) also updated this to get the tests running as part of the nix derivation, which required defining our own manual configurePhase and installCheckPhase, rather than depending on the one provided by stdenv. Not doing this would cause cmake to attempt to *run* the tests as part of the buildPhase, which wouldn't work because the dynamic libraries hadn't been put into a place where the test executables knew where to find them. We're not sure *why* this fixes it, and for some reason fixing this also breaks the automatic behavior of nixpkgs of passing -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES to make, but that's eaasy enough to fix manually in a preBuild Paired-With: Griffin Smith <grfn@gws.fyi> Change-Id: I79d61854a3ff47301cdce8a40c76820a97bdf901 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1240 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-18 r/1368 test(3p/nix/libexpr): add json/xml testsAndreas Rammhold1-0/+287
Backported from: https://github.com/andir/nix/commit/c1371b6fbb91caf53ebc94d3ae0250dbe7eb7eae Change-Id: Ida326cf1567081a56d747c4a72f036f55cfdea37 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1239 Tested-by: BuildkiteCI Reviewed-by: Kane York <rikingcoding@gmail.com>