-
Notifications
You must be signed in to change notification settings - Fork 11
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
Using mock-server instead of the built-in mock for msteam #513
Conversation
authClient := &http.Client{ | ||
Transport: &http.Transport{ | ||
Proxy: http.ProxyURL(proxyUrl), | ||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
Check failure
Code scanning / CodeQL
Disabled TLS certificate check High
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.
Do we want to pay attention to this?
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.
Actually, we don't, that is totally expected for testing :)
@jespino I was looking into https://github.com/microsoft/dev-proxy for mocking.. it has many other things not just mocking responses. The idea was to use that for the load tests.. in your opinion what do you think is best
Let me know |
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.
A couple of comments but this looks great
authClient := &http.Client{ | ||
Transport: &http.Transport{ | ||
Proxy: http.ProxyURL(proxyUrl), | ||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
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.
Do we want to pay attention to this?
I don't know much about the dev-proxy, but one thing I like about the mock-server is that it is fully open-source and generalistic, so we can make it behave however we want. We can modify the mocks on the fly with the API, reset them, make assertions... I think it is very powerful. Maybe dev-proxy is equally powerful, but I don't know it. Also, mock-server is already an official testcontainers module. Also, depending on the dev-proxy capabilities, we can try to use dev-proxy instead of mock-server, I can create a testcontainers module for dev-proxy without much effort (I guess), and if that works as a proxy, probably it would be as easy to use as the one that we are using now. |
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.
Thanks, @jespino! A few questions below, but nothing strictly blocking.
@lieut-data I addressed all your concerns, I think, PTAL. |
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.
Thanks, @jespino!
This PR replaces the built-in mock server, that required a specific compilations and mocked the whole msteams client, with one that is external (mock-server). This allows to do a full test of 100% of our code, without testing the MSTeams side.