Commit Graph

87 Commits

Author SHA1 Message Date
sorki
7dc5c596aa tests: add/move Test.Hspec.Nix.forceRight from json 2023-12-07 16:35:16 +01:00
sorki
b8294ffb74 core: split parseNameText from mkStorePathName
so it can be used for `OutputName` as well
2023-12-07 16:35:16 +01:00
sorki
70443c884b core: improve mkStorePathName and its errors, add test 2023-12-07 16:35:16 +01:00
sorki
a8077c5031 prefix Metadata fields 2023-12-07 16:35:16 +01:00
sorki
265d25256d core: split signature/narSignature parser/builder 2023-12-06 16:25:38 +01:00
squalus
ac7184be2c core: add fingerprints 2023-11-26 11:36:18 -08:00
Richard Marko
e9a7bbc107 core: add comment for test credits
Related to #240
2023-11-23 06:14:35 +01:00
squalus
3710c6a445 add signature decoding
- add NarSignature decoding
- use cryptonite instead of saltine for signature
- remove saltine dependency
- add signature decode and verify tests taken from tvix
- start decoding signatures in queryPathInfoUncached

Closes #240 and #246
2023-11-22 15:19:03 -08:00
Richard Marko
cce2c98426 move getStoreDir to remote, drop mtl from core 2023-11-22 11:30:10 +01:00
Richard Marko
69a02d3066 init hnix-store-nar
Closes #233
2023-11-22 11:16:17 +01:00
Richard Marko
72524cfc09 init hnix-store-readonly
Closes #235
2023-11-22 10:44:46 +01:00
Richard Marko
8ac46de0bd Recursive -> FileIngestionMethod, remove Bools
Actually the same thing, now with prefixed constructors
for extra clarity.

Closes #238
2023-11-22 09:07:14 +01:00
Richard Marko
f6b06e0005 Add tests for ReadOnlyStore 2023-11-22 09:07:14 +01:00
Richard Marko
541abd1e20 core: Base, wrap comment, trim whitespace 2023-11-20 09:22:05 +01:00
Richard Marko
17d20b5417 core: derivation test, use Text.Lazy.IO 2023-11-20 09:22:05 +01:00
Richard Marko
42f56f504f hnix-store-tests: init
Split from `-core` so it doesn't depend on quickcheck,
generic-arbitrary and quickcheck-instances that could propagate downstrem.
Also allows users to defined their own.

With all roundtrip property tests.

Later this should also absorb test nix-store/daemon harness from
`-remote` so it can be reused by others.
2023-11-20 09:22:05 +01:00
Richard Marko
e8474eebf7 core: add roundtrip prop for DerivedPath 2023-11-19 07:07:41 +01:00
Cale Gibbard
a187937be4 rework ContentAddress
Co-Authored-By: Richard Marko <srk@48.io>
2023-11-18 19:02:30 +01:00
Richard Marko
fc0133f5a1 core: add System.Nix.StorePath.parsePathFromText 2023-11-18 11:19:07 +01:00
Richard Marko
bb2184f5e0 ContentAddressableAddress -> ContentAddress, separate module 2023-11-18 11:19:07 +01:00
Richard Marko
ea03ee9b08 core: revert tests/Hash to its original neat state 2023-11-18 09:22:34 +01:00
Richard Marko
894db979db core: move extensions to common stanza
Sensibly
2023-11-17 19:59:34 +01:00
Richard Marko
86a7b58620 core: drop relude
I prefer explicit imports vs magic and this causes
an unused packages warning to pop (with no workaround or fix in sight).
2023-11-17 19:55:26 +01:00
John Ericson
a2f35861da Squash away internal
Closes #234
2023-11-17 19:55:26 +01:00
Richard Marko
2e1cab22b3 move ContentAddressableAddress builder and parser to core, add roundtrip prop 2023-11-17 08:03:40 +01:00
Richard Marko
b80ee47f6a Add Default StoreDir instance 2023-11-16 13:25:20 +01:00
Richard Marko
ef9fb46f89 core: Fix unused warnings in Nar 2023-11-16 07:05:05 +01:00
Richard Marko
3e26a0dd2f core: add GenericArbitrary derived instances
for `Build` and `Derivation` modules.

Switch derivation path parser to use
`Nix.Derivation.textParser` like `nix-derivation` does.
2023-11-15 18:36:28 +01:00
Richard Marko
5dc1802665 core: move Arbitrary instances near their types
This allows us to use them in remote serialization
round trip props.

Couple of them are not needed anymore (`NixLike` is the
default now) so whole `tests/Arbitrary` is gone.
2023-11-15 08:29:49 +01:00
Richard Marko
3b3752d758 core: don't (re)export StorePathHashPart constructor 2023-11-15 08:29:49 +01:00
Sander
c68762f8d7
Test the case hack against a NAR fixture with case conflicts 2023-11-13 17:13:44 +04:00
John Ericson
5727827dcb Store dir like nix 2023-06-16 11:27:39 -04:00
Andrei Borzenkov
2f1bae89c8 [#198] Make nar implementation compatible with the original one
Problem: this implementation of nar made non-identical archives with the
original implementation

Solution: doesn't treat to directory symlinks as they are directories
2022-12-28 12:13:13 +04:00
Anton Latukha
9a9ebb5434 core: test: NarFormat: m doc 2021-11-04 14:27:05 +02:00
hololeap
b0ee7fd6a2 Add GHC.Stats import to NarFormat test
This is needed for the tests to compile on my system.
Without the import, `max_live_bytes` and `getRTSStats` are undefined.
2021-11-04 14:21:19 +02:00
Anton-Latukha
916624b373
Core: tests: Hash: spec_hash: refactor 2021-08-07 02:51:08 +03:00
Anton-Latukha
2bf02a92d8
Core: tests: Hash: spec_nixhash: refactor 2021-08-07 01:56:06 +03:00
Anton-Latukha
6318ff163b
Remote: (Right -> pure) 2021-08-06 19:52:52 +03:00
Anton-Latukha
5b1b51306a
Core: clean-up imports 2021-08-06 19:29:02 +03:00
Anton-Latukha
a93cba03c9
treewide: hlint refactor 2021-08-06 19:29:02 +03:00
Anton-Latukha
75c810423a
treewide: hlint refactor 2021-08-06 19:29:02 +03:00
Anton-Latukha
54a7c92791
treewide: use WriteMode 2021-08-06 19:29:02 +03:00
Anton-Latukha
d2970b9f01
treewide: use ReadMode 2021-08-06 19:29:02 +03:00
Anton-Latukha
8f932bd6ee
treewide: use decodeUtf8 2021-08-06 19:29:01 +03:00
Anton-Latukha
99da38fa83
treewide: use withFile 2021-08-06 19:29:01 +03:00
Anton-Latukha
5d22b9450a
treewide: use pass 2021-08-06 19:29:01 +03:00
Anton-Latukha
c00dedcd3a
treewide: use toText 2021-08-06 19:29:01 +03:00
Anton-Latukha
e350ee4f60
Core: tests: NarFormat: (data -> newtype) Nar 2021-08-06 19:29:01 +03:00
Anton-Latukha
c4183d22d2
treewide: (LANGUAGE -> language) 2021-08-06 19:29:01 +03:00
Anton-Latukha
8e3955f6a1
Core: cabal: declare default-extensions 2021-08-06 19:29:01 +03:00