-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[WIP] Unit tests for haproxy connect #7637
[WIP] Unit tests for haproxy connect #7637
Conversation
fb72932
to
8dbed31
Compare
This will allow to have the same code in: hashicorp/consul#7637 And will fix haproxytech#19
This will allow to have the same code in: hashicorp/consul#7637 And will fix haproxytech#19
This will allow to have the same code in: hashicorp/consul#7637 And will fix #19
8dbed31
to
5d61088
Compare
@i0rek @banks Do you already have suggestions, is that approach Ok for you (aka, copy files from https://github.com/haproxytech/haproxy-consul-connect/tree/master/consul in Consul's repo and keep it in sync) or do you have other guidelines? |
862c2aa
to
92b9905
Compare
Hello @pierresouchay, sorry for the late response! We talked internally and we are a little skeptical about how this will test suite will play out in the future. How much updating it needs, how to keep the implementation in sync with what you have in the actual integration. Looking forward to hear what you think! |
Also cleanup go modules
92b9905
to
d5fcf15
Compare
@i0rek agree, it will be hard to maintain on the long term because files have to be kept in sync. The best is probably not to test Consul's APIs but implementation only:
@dcorbett-haproxy @bedis @NickMRamirez @ShimmerGlass @aiharos Do you have any opinion on the matter? |
ping @dcorbett-haproxy @bedis @NickMRamirez @ShimmerGlass @aiharos |
I read that @i0rek does suggest to have consul API tests there, and that there are reservations about the actual functional tests that are currently being worked on in haproxy-consul-connect In that case, perhaps we could make 2 groups of tests, (keep the current ones as they are and keep expanding on them), and add a 2nd suite of tests just for making sure the Consul API we are relying upon is still valid? Then only the Consul API tests could be included/run by Consul upstream. |
@aiharos I think that sounds good, but let me restate, to make sure we are saying the same thing. 1) API TestsConsul has tests for its API at two levels:
All of the API endpoints used by haproxy-connect should already be covered by tests, but I have not done an exhaustive search. If you (or really anyone!) is interested in contributing more tests in that style, it would be very much appreciated. These tests generally setup an agent, make an API call, and check the response. If there are particular states or special cases that are not well covered we should absolutely add more tests to cover those cases. If you have a list of all the API endpoint used by haproxy-connect, I'd also be happy to pair with someone to review the test coverage of those endpoints. If there are any gaps in our coverage we can write up an issue with the list and make sure that tests are added for those cases. 2) System Integration Tests (End-to-end Testing)We have a CI workflow which runs end-to-test tests to verify the integration of Consul with: Envoy, Nomad, and Vault. You can see an example of this workflow here: workflow test-integrations. If haproxy-connect has an end-to-end test suite, we can have our CI run that suite with a copy of Consul that is built from the current commit. That should catch any functional issues with the integration before any release. This is exactly what we do with Nomad (we run some of the Nomad tests in the nomad-integration job). My understanding is that this end-to-end test suite doesn't exist yet, but when it does we would add it to the I think the only requires are:
That only leaves the question of what to do with this PR. Since it doesn't follow either of the established patterns for testing Consul, I don't think we can accept this change. The established patterns should provide excellent coverage both of the specific endpoints, and deeper integration testing of features, so I don't think we want to accept another type of test, unless it is filling a gap in our existing testing strategy. I hope that all makes sense. Let me know if anything is not clear, or you have any other questions! |
I believe these tests have moved to the https://github.com/haproxytech/haproxy-consul-connect repo. Thank you everyone for your work on this! I'm going to close this PR. |
This unit tests ensure changes in Consul won't break haproxy-consul-connect
TODO: