Commit Graph
9 Commits
Author SHA1 Message Date
Fintan Halpenny 9d137e5e7d test: add roundtrip::json_value
Adds a roundtrip helper for going to/from a json value. This can have
slightly different semantics in comparison to/from a json string.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-12-08 15:17:19 +00:00
Fintan Halpenny 3284149bd6 radicle-surf: rename serialize to serde
Instead of creating a named feature flag, opt for using the `serde`
package name as the feature flag name. This makes it more clear that
the feature is only enabling serde serialization and nothing else.

This patch also cleans up the testing flags by removing the serialize
flag for testing, as this should just always be tested, and also adds
the syntax flag for future testing.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-30 13:22:44 +00:00
Fintan Halpenny a4ec9e07e1 radicle-surf: organise tests
Reorganise the tests into module files, rather than all being in a
single file. No tests were changed in this patch.

The `serialize` flag was also not enabled in `test/Cargo.toml`. This
is enabled to ensure those tests are run moving forward.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-24 12:25:31 +00:00
Fintan Halpenny 9c80fb06a7 meta: clean up cargo dependencies
The aim of this patch is to solve some of the `cargo deny`
warnings. This required updating some dependencies. Some dependencies
of radicle-surf were not used, so they were outright removed.

The last_commit benchmark in radicle-surf is irrelevant as we use more
efficient methods for getting repository histories, so it has been
removed.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-24 11:26:32 +00:00
Fintan Halpenny 8745e46745 git-commit: introduce git-commit crate
Porting the commit code that is found in heartwood[0]. It represents a
parsed git commit object -- sans the id for the commit itself.

[0]: https://github.com/radicle-dev/heartwood/blob/16b22d9178fa6a1aaf2ecb01ec97e067399c5286/radicle/src/git.rs#L392-L575

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2022-11-04 12:33:17 +00:00
Jorge Iglesias Garcia f6b72dce85 git-storage: add ODB tests
We add tests for ODB functionality, as well as a new `TreeBuilder`
Struct to make building git trees easier (see below).

The `git2::TreeBuilder` can be a pain to use since it has a lifetime
that is tied to the `git2::Repository`. This was causing issues when
trying to write generators for property tests.

Instead, define a custom TreeBuilder which is a defunctionalised list
operations that represent the `insert` and `remove` methods on
`git2::TreeBuilder`.

The implementation of writing a tree then becomes converting the
custom `TreeBuilder` into a `git2::TreeBuilder`.

Signed-off-by: Jorge Iglesias Garcia <me@jorgeig.com>
2022-10-24 16:52:56 +08:00
Han Xu 0c941740c8 radicle-surf: test structure compliance.
The test structure should be that all tests are gathered under a 't'
sub-crate, followed by the 'test' crate depending on this new crate.
2022-09-29 09:37:54 -07:00
Fintan Halpenny ce7dc3890a meta: use long crate names
To help with clarity and potential publishing of the crates, the full
`radicle-` prefix is used for the crate names.

Note that it wasn't chosen got `git-ref-format` and `git-trailers`
since they are truly general libraries (bar the feature flag for link
specific reference names).

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-15 17:58:14 +01:00
Fintan Halpenny 70b571b67b radicle-git init
Port over all git relevant parts of the radicle-link repository[0].
The packages that are kept are:
* git-ext
* git-ref-format
* git-trailers
* link-git
* macros
* std-ext
* test -- only the portions that test the above

The development and testing scripts are also added for local and CI
testing.

[0]: https://github.com/radicle-dev/radicle-link/
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
2022-09-08 12:07:51 +01:00