Documentation for Federation Test Cases#2000
Conversation
mythsunwind
left a comment
There was a problem hiding this comment.
Thanks for marking me in the PR. I was able to include the test cases in the current state of this PR into the certification document.
Since all security functions are currently case sensitive please replace @SF.FEDERATION with @SF.Federation.
e48b4e5 to
6dee431
Compare
services/federator/test/integration/Test/Federator/IngressSpec.hs
Outdated
Show resolved
Hide resolved
services/federator/test/integration/Test/Federator/InwardSpec.hs
Outdated
Show resolved
Hide resolved
fisx
left a comment
There was a problem hiding this comment.
@mdimjasevic could you take another look at my changes and see if you think we've covered everything?
if ci is green this is good to merge IMO.
|
@fisx , sure, I will take a look! |
|
ci passes locally. |
It looks good to me. I cannot approve via the GitHub interface since I created the PR. |
looks like concourse is running things differently, leading to different errors in this test case. :-( @mdimjasevic i suppose it's ok for you to post your typo corrections then... |
|
I forgot earlier, but the federation error documentation in swagger (https://github.com/wireapp/wire-server/blob/develop/services/brig/docs/swagger.md) should be updated to reflect any changes to status codes. |
Thank you for pointing this out! It's been taken care of in a7123fac2e52d524ac0e920060348d60f53bb481. |
I updated the test case to use a non-existing domain, which should make it consistent with running the test locally.
Done! |
This reverts commit c902bb18f0200ed0744f90e6cb7d61dead139c87.
45ff2c4 to
1e528da
Compare
| - **Federation unavailable** (status: 500, label: `federation-not-available`): Federation is configured for this backend, but the local federator cannot be reached. This can be transient, so clients should retry the request. | ||
| - **Federation not implemented** (status: 500, label: `federation-not-implemented`): Federated behaviour for a certain endpoint is not yet implemented. | ||
| - **Federator discovery failed** (status: 500, label: `discovery-failure`): A DNS error occurred during discovery of a remote backend. This can be transient, so clients should retry the request. | ||
| - **Federator discovery failed** (status: 400, label: `discovery-failure`): A DNS error occurred during discovery of a remote backend. This can be transient, so clients should retry the request. |
There was a problem hiding this comment.
hum, why isn't this generated? (just wondering, please don't do anything about this in this PR :))
There was a problem hiding this comment.
We decided to document the federation errors at the beginning of this Swagger document and then any endpoint that can throw a federation error can throw one of these. This is to avoid repeating the lengthy enumeration of federation errors over and over again at every endpoint that can throw it.
services/federator/test/integration/Test/Federator/InwardSpec.hs
Outdated
Show resolved
Hide resolved
| -- (This is also tested in unit tests; search for | ||
| -- 'validateDomainCertInvalid' and 'testDiscoveryFailure'.) | ||
| it "shouldRejectMissmatchingOriginDomainInward" $ | ||
| runTestFederator env $ pure () |
There was a problem hiding this comment.
| runTestFederator env $ pure () | |
| pure () |
There was a problem hiding this comment.
I did not look thoroughly as to why, but just pure () doesn't type-check. I think that's because other it "blocks" in the spec use the runTestFederator env test values, which then GHC infers a type from, which then forces us to have the same type here, but I'd have to look deeper to confirm this.
There was a problem hiding this comment.
ah, you're almost right: pure () can have the right type, it's an inference problem because both it and pure are polymorphic, and nothing determines any concrete type for m. you could write:
it "..." $ (pure () :: Assertion)
this would be much better if runTestFederator would set up expensive schaffolding (which is what I thought earlier), but since it's just Reader+IO, I would say just leave it as is.
…/Federator/InwardSpec.hs Co-authored-by: fisx <mf@zerobuzz.net>
| -- (This is also tested in unit tests; search for | ||
| -- 'validateDomainCertInvalid' and 'testDiscoveryFailure'.) | ||
| it "shouldRejectMissmatchingOriginDomainInward" $ | ||
| runTestFederator env $ pure () |
There was a problem hiding this comment.
ah, you're almost right: pure () can have the right type, it's an inference problem because both it and pure are polymorphic, and nothing determines any concrete type for m. you could write:
it "..." $ (pure () :: Assertion)
this would be much better if runTestFederator would set up expensive schaffolding (which is what I thought earlier), but since it's just Reader+IO, I would say just leave it as is.
Documents and provides federation test cases per https://wearezeta.atlassian.net/browse/SQCORE-1198.
@mythsunwind