about summary refs log tree commit diff
path: root/third_party/nix/src/tests/CMakeLists.txt (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-09 r/1627 test(tvix): Cover scanForReferences in a testGriffin Smith1-0/+10
Aded a few test cases covering the scanForReferences function, which had been accidentally broken in 976a36c (which is now partially-reverted). As part of this, since the test needed to generate hashes for store paths, the logic in MakeStorePath to compress a sha256 hash down to 20 bytes and convert it to base32 has been extracted to a member function on the Hash class. Fixes: #34 Change-Id: Ie2d914688a80f42d0234d351a7cc0714fd15709e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1698 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-08-05 r/1596 feat(3p/nix): add tests for BinaryCacheStoreKane York1-0/+9
These tests are in preparation for factoring the Store away from libutil's Callback to absl::StatusOr. They use the newly added MockBinaryCacheStore. Updates: #25 Change-Id: I30c207589ec38254806ebc9a983f35668e353ae9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1595 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-02 r/1548 test(3p/nix): Add test for derivation parse/serializeGriffin Smith1-0/+11
Add a rapidcheck test covering roundtrip parse and serialize for Nix derivations. This covers a bug we discovered in ef54f5d which broke this roundtrip. Change-Id: I72d140334b5f24f79e82e34f98609c695dbfbf93 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1582 Tested-by: BuildkiteCI Reviewed-by: kanepyork <rikingcoding@gmail.com>
2020-07-25 r/1462 refactor(3p/nix): Remove custom base64 implementationGriffin Smith1-0/+8
Replace the custom, rather questionable base64 implementation with absl::Base64{Une,E}scape. To make sure that the custom implementation was doing the same thing I've also added a test covering nix::Hash::to_string, which was one function that used it - the test passed prior to the replacement, and continued to pass afterwards. The previous base64Decode function threw an exception on failure - to avoid going too far down the rabbit hole I've replicated that functionality at all call sites, but this should be replaced with more sensible error handling such as StatusOr eventually. Also, before this change: ❯ nix eval -f . users.tazjin.emacs.outPath "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs" And after: ❯ ./result/bin/nix eval -f . users.tazjin.emacs.outPath "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs" Change-Id: Id292ffbb82fe808f3f1b34670afbe7b8c13ad615 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1385 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI
2020-07-19 r/1395 test(3p/nix): Add property tests for attribute setGriffin Smith1-0/+10
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 Ambo1-0/+9
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-18 r/1369 test(3p/nix): Set up scaffolding & fix up tests for value-to-{json|xml}Vincent Ambo1-0/+11
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>