Commit Graph
6 Commits
Author SHA1 Message Date
Fintan Halpenny 3edb0ed017 chore: rountrip property test for EventFilter
Introduce the use of the `qcheck` crate to generate examples of `EventFilter`,
so that a YAML roundtrip test can be added.
2025-01-30 15:00:54 +02:00
Fintan Halpenny d31347d179 fix: fix (de)serialization of EventFilter
The `EventFilter::Not` variant would not correctly deserialize, resulting in the
following error:

    deserializing nested enum in EventFilter::Not from YAML is not supported yet

This can be fixed by using `#[serde(with = "serde_yml::with::singleton_map")]`
on that variant.

A test case is provided to show that a `Not` case can be deserialized correctly.

The change also includes some improvements to `EventFilter`:
- Add `PartialEq` and `Eq` for testing equality in testing
- The `And` and `Or` variants do not need the `Box`, since the `Vec` acts as a
  size pointer for the recursive `Self` – unlike the `Not` variant.
2025-01-30 15:00:54 +02:00
Fintan Halpenny da7971ada3 chore: add cargo audit
Add a check for auditing the project via `cargo audit`.

Note that a RUSTSEC is ignored due to it not affecting the project – this is
recoreded in `.cargo/audit.toml`.
2025-01-24 10:24:44 +00:00
Fintan Halpenny 8d67442766 chore: add cargo deny
Adds `deny.toml` for running `cargo deny` on the project.

As well as adding a `deny` check in the Nix flake.
2025-01-24 10:24:33 +00:00
Fintan Halpenny ddac7386c9 chore: add Nix Flake
Adds a `flake.nix` for building and testing the radicle-ci-broker using Nix.

Auditing and license denial configurations are also added as part of the `nix
flake check`s.

Note that one of the tests is ignore as part of the nextest check, since it
relies on using the Git repository itself. This is discouraged, since the check
runs in a sandboxed environment.
2025-01-24 10:24:17 +00:00
Fintan Halpenny 8cbc1fe313 refactor: change test shell commands
While setting up a Nix flake, a series of tests were failing due to shell
invocations. The falling were the changes required:

- Use `!#/bin/sh` instead of `!#/bin/bash`
- Use `$$` instead of `$BASHPID`
- Use `true` and `false` instead of `/bin/true` and `/bin/false`

It was also noted that the `git-remote-helper` is needed alongside the `rad`
binary for some of the acceptance tests to work.
2025-01-24 10:23:49 +00:00