Add unit test for the validator #63
Merged
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.
This is the unit test for the
parser/validator.go. My apologies that it took so long to finish it. However, there are a few problems.Because validation basically panics and logs messages when data are invalid, my tests are divided into 2 types:
But should the test for validation be too detailed as written in my code or should it be a little bit less? I might have been overthinking and ended up writing 500 lines worth of code to test
validator.go, which is only 150 lines.The test somehow passed both tests on Ubuntu and Windows but failed on deployment because Google Cloud wasn't able to generate some types of keys. How can I fix this?
Thank you.