RetrieveCertificate: add mocked HTTP tests using real TPP responses#270
Merged
luispresuelVenafi merged 3 commits intoVenafi:masterfrom Dec 1, 2022
Merged
RetrieveCertificate: add mocked HTTP tests using real TPP responses#270luispresuelVenafi merged 3 commits intoVenafi:masterfrom
luispresuelVenafi merged 3 commits intoVenafi:masterfrom
Conversation
8114c66 to
2b6a3d5
Compare
2b6a3d5 to
1c6825f
Compare
marcos-albornoz
approved these changes
Nov 29, 2022
luispresuelVenafi
approved these changes
Nov 30, 2022
e7851ab to
c01ee2e
Compare
Signed-off-by: Maël Valais <mael@vls.dev>
We still use Go 1.17. Signed-off-by: Maël Valais <mael@vls.dev>
c01ee2e to
550dd07
Compare
Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
550dd07 to
ef68626
Compare
Contributor
|
@luispresuelVenafi This PR should be ready to merge now (all commits are signed). |
This file contains hidden or 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
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.
There are no tests that would allow us to "see" and discuss the issue reported in #171. Having tests, even statically mocked HTTP ones, would also allow us to prevent breakage (as much as possible) when changing RetrieveCertificate in #269.
I used
curland a 20.1 TPP VM to capture each individual HTTP response. At some point, I wish to document further how I produced these response samples.The reason I went for a mocked HTTP server is because making the live TPP server return all of these messages is tricky; most 500 errors aren't easily reproducible unless we set up the e2e TPP VM to have e.g. one of its CA templates broken on purpose.
This "mocked HTTP server" approach isn't ideal because a drift may appear between earlier versions of TPP and these mocked responses, but I still think it is important to have them to prevent breakage when trying to refactor
RetrieveCertificate.