-
Notifications
You must be signed in to change notification settings - Fork 176
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
[Code Quality]: Unit tests for yaml loader #324
Merged
joshfried-aws
merged 8 commits into
aws-cloudformation:custom_writer
from
joshfried-aws:main
Jan 27, 2023
Merged
[Code Quality]: Unit tests for yaml loader #324
joshfried-aws
merged 8 commits into
aws-cloudformation:custom_writer
from
joshfried-aws:main
Jan 27, 2023
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
akshayrane
approved these changes
Jan 27, 2023
joshfried-aws
added a commit
that referenced
this pull request
Jan 31, 2023
…n test framework, and adding initial tests for all commands (#325) * Origin/custom writer (#319) * Added build targets to release workflow * Added build targets to release workflow * Moved TARGETS env variable * Removed JSON variable * Added OS-specific runs * Removed external dependency * Added braces to target in path * Reverting to OS-specific runs * Fixed indent * temp commit with temp fix for DI on execute method * small fix + implementing poc for a test * Added initial tests for verbose output validation * Refactoring to add Writer across all commands * Minor refactoring, removed unused imports * rename from_utf8 to into_string due to clippy warning * fixed bug from renaming from_utf8 Co-authored-by: Akshay Rane <raneaks@amazon.com> Co-authored-by: Josh Fried <joshfri@amazon.com> * Set all field in rules file to serialize with recursive singleton map (#320) * testing rust-fmt action with incorectly formatted file * reverting previous commit * testing rust-fmt action with incorectly formatted file * reverting previous commit * fixed serialization issues for enums * cleanup * Refactored resources and tests directory (#321) Co-authored-by: Akshay Rane <raneaks@amazon.com> * [Code Quality]: Improve test coverage (#322) * testing rust-fmt action with incorectly formatted file * reverting previous commit * testing rust-fmt action with incorectly formatted file * reverting previous commit * create test runners for validate, parse-tree, and test. refactored tests in validate to use rstest + added new test cases. added parse-tree test cases * removed unneeded cargo_test2 fn * removing unused cargo_test fn * rust fmt * more parse-tree tests * fixes as per comments * rustfmt * Custom writer (#323) * Adding license info for indoc * Added tests for migrate and rulegen, added constants for status codes, incorporated writer into test command * Formatting changes * Corrected typos in resource file paths * Added license info for strip-ansi-escapes library --------- Co-authored-by: Akshay Rane <raneaks@amazon.com> * [Code Quality]: Unit tests for yaml loader (#324) * testing rust-fmt action with incorectly formatted file * reverting previous commit * testing rust-fmt action with incorectly formatted file * reverting previous commit * more parse-tree tests * fixes as per comments * added tests for laoder and fixed some bugs found while writing tests * removed unneeded use --------- Co-authored-by: Akshay Rane <aks.rane@gmail.com> Co-authored-by: Akshay Rane <raneaks@amazon.com>
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.
Issue #, if available:
Description of changes:
As part of #208, this PR increase test coverage. I have added some unit tests for the yaml loader. I also changed some of the rust code, applying clippy lints, and refactoring some of the code so its idiomatic.
In addition to these unit tests, this PR also adds some bug fixes I noticed along the way.
Bug Fixes
loader.rs
Code Cleanup
eval_test.rs
assert_eq!(predicate, true)
. This is not needed, we can simply rewrite this as `assert!(predicate)loader.rs
!!float
totag:yaml.org,2002:float
I changed the check on the suffix to look for any string that is prefixed withtag:yaml.org,2002:
, and i changed the function that we call to match ontag:yaml.org,2002:float
,tag:yaml.org,2002:int
,tag:yaml.org,2002:null
, etc... instead of how we did it before.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license