-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: make subdomain testing possible #9
Conversation
62439ea
to
b7037fc
Compare
cc @galargh this is the subdomain with custom resolver trick.
|
66ca0ba
to
0818bfe
Compare
bf819f6
to
9e911d8
Compare
9e911d8
to
f94c7e9
Compare
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.
Nicely done @laurentsenta 🏅 👏
I left some comments, but I don't want to block this. It might be worth agreeing on the param name before the merge, but even that isn't something that we can't tackle later.
subdomain-url: | ||
description: "The Subdomain URL of the IPFS Gateway implementation to be tested." | ||
default: "http://example.com" | ||
required: false |
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.
Are we being clear enough with the name/description here? I'm afraid this creates an impression that I, as an implementer, should set up something accessible at http://example.com
. I think I'd assume I have to set up another gateway instance that supports the subdomain gateway spec and expose it at subdomain-url
.
Also, do we think we might have non-subdomain-related tests benefitting from the proxying in the future?
Wouldn't something like local-gateway-proxy-url
or internal-gateway-proxy-url
reflect the intention better?
I don't want to block this, but I wanted to raise my concerns with you.
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.
I'll add a comment in the README, there's no real proxying anymore, we use that value to overwrite the request sent to the gateway, it's really subdomain-related.
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.
I see. Thanks for adding the comment. It makes things clearer. Few more thoughts that it sparked with me.
Wouldn't it make sense to always use what we now call subdomain-url
. As in, all the test should talk to gateway-url
in a way that thinks it's called subdomain-url
? Theoretically, wouldn't that be more correct? So really, every test case should be executed 3 times (with host header, proxy, proxy with tunneling) as long as subdomain-url
and gateway-url
are different.
Looking more closely at how we execute the test cases with host header, I think we're not using the protocol part of gateway-url
. Is that correct?
If so, isn't what we really need from the user these two pieces of info:
- What are you calling/want to call your gateway? Please give us the full URL with a domain name. That would be https://dweb.link for example or http://example.com. You could give us http://127.0.0.1:8080 here as well BUT there's no way for you to support sudomains on that URL so you'll have to disable subdomain-gateway spec.
- Where is your gateway hosted? Please give us the host we should contact when we're making requests to the URL you provided in the previous step. If you don't, we're just going to use the host from the URL. It's fine if you give us a host with IP or a host with domain. This would be 127.0.0.1 for example or 127.0.0.1:8080 or foo.bar.example.com.
That would come together to something like this - main...gateway-host (note that I intentionally skipped modifying test/config code; I just wanted to get the idea across).
There's absolutely no rush with replying to this. And it's completely possible that I'm missing the point a bit - still trying to wrap my head fully around this. I just want to understand what might be most straight-forward way for those running the tests to provide us all the information we need.
Makefile
Outdated
@@ -8,6 +8,10 @@ test-cargateway: provision-cargateway | |||
provision-kubo: | |||
find ./fixtures -name '*.car' -exec ipfs dag import {} \; | |||
|
|||
test-kubo-subdomains: provision-kubo gateway-conformance | |||
./ipfs-config.example.sh | |||
./gateway-conformance test --json output.json --gateway-url http://127.0.0.1:8080 --subdomain-url http://example.com:8080 --specs +subdomain-gateway |
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.
We can skip the --specs arg.
./gateway-conformance test --json output.json --gateway-url http://127.0.0.1:8080 --subdomain-url http://example.com:8080 --specs +subdomain-gateway | |
./gateway-conformance test --json output.json --gateway-url http://127.0.0.1:8080 --subdomain-url http://example.com:8080 |
And I think this makes it obsolete since test-kubo
would run those tests already anyway. Should we add the Kubo init to the test-kubo command?
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.
I think the makefile should be seen as a runnable quickstart / documentation.
I wouldn't mess with the users' ipfs config by default. I'll refactor the Makefile to make it more clear.
This PR adds support for subdomain testing. We port the test from sharness 114 into the conformance test suite.
Tasks