Skip to content

Conversation

@detjensrobert
Copy link
Contributor

@detjensrobert detjensrobert commented Nov 16, 2024

The config parsing library introduced in #20 includes a sandboxed test mechanism for testing its parsing results. This PR adds a decently comprehensive suite of tests to make sure the rcds.yaml and challenge.yamls parse or do not parse as expected. This replaces the couple of existing parsing tests that were done directly with Serde.

This also includes a few tweaks to the ChallengeConfig structs to make the parsed result more ergonomic to use --inlining enum fields to remove unnecessary nested objects, coercing envvar lists to map form at parse time.

Signed-off-by: Robert Detjens <github@detjens.dev>
This field is used to check against the enabled/disabled challenges in the
deploy profile, and was not being set when parsed. This got removed in a
rebase somewhere(?) and broke the validate command. Now fixed!

Signed-off-by: Robert Detjens <github@detjens.dev>
Since we only are looking for two levels of folders to find challenge
directories, rust_search's recursive search isn't needed and it cannot be
restricted to only search at a specific depth. The glob library can, and is
much more concise for this case.

Signed-off-by: Robert Detjens <github@detjens.dev>
Signed-off-by: Robert Detjens <github@detjens.dev>
This simplifies the caching layer in configparsing/mod.rs and allows tests
to bypass the caching for building config files.

Signed-off-by: Robert Detjens <github@detjens.dev>
Signed-off-by: Robert Detjens <github@detjens.dev>
The separate types do not need a sub-field as the enum already signifies
what the desired expose type is.

Signed-off-by: Robert Detjens <github@detjens.dev>
Signed-off-by: Robert Detjens <github@detjens.dev>
Signed-off-by: Robert Detjens <github@detjens.dev>
Signed-off-by: Robert Detjens <github@detjens.dev>
Copy link

@cacama-valvata cacama-valvata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@detjensrobert detjensrobert merged commit eafecc3 into main Dec 6, 2024
3 checks passed
@detjensrobert detjensrobert deleted the dr/parsing-tests branch December 6, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants