-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config and challenge parsing tests via Figment::Jail #31
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Robert Detjens <[email protected]>
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Robert Detjens <[email protected]>
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 <[email protected]>
Signed-off-by: Robert Detjens <[email protected]>
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 <[email protected]>
detjensrobert
force-pushed
the
dr/parsing-tests
branch
from
November 16, 2024 22:39
9309be9
to
8c4ae6a
Compare
Signed-off-by: Robert Detjens <[email protected]>
detjensrobert
force-pushed
the
dr/parsing-tests
branch
from
November 16, 2024 22:40
8c4ae6a
to
f9f88ea
Compare
Signed-off-by: Robert Detjens <[email protected]>
Signed-off-by: Robert Detjens <[email protected]>
cacama-valvata
approved these changes
Dec 6, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andchallenge.yaml
s 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.