Skip to content
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

Add support for tests to use fiddler proxy #89

Merged
merged 1 commit into from
Jun 17, 2015

Conversation

mconnew
Copy link
Member

@mconnew mconnew commented Jun 16, 2015

With this change, you can specify /p:UseFiddler=true to build.cmd and the special hostname
localhost.fiddler will be used. This causes the localhost proxy bypass to be skipped and the
requests will be put through the defined proxy server. Fiddler then strips off the .fiddler
from the hostname and passes on the request with the Host being just localhost.
Some tests fail when using fiddler as the failure mode changes and there's not a lot we can
do about that, but this does give greater flexibility to debugging product/test issues.

With this change, you can specify /p:UseFiddler=true to build.cmd and the special hostname
localhost.fiddler will be used. This causes the localhost proxy bypass to be skipped and the
requests will be put through the defined proxy server. Fiddler then strips off the .fiddler
from the hostname and passes on the request with the Host being just localhost.
Some tests fail when using fiddler as the failure mode changes and there's not a lot we can
do about that, but this does give greater flexibility to debugging product/test issues.
@@ -5,6 +5,29 @@

public static class BaseAddress
{
#if USE_FIDDLER
// Base address for testing nonexistent endpoints
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach is really a special case of what I intended in #29. So if we do this approach, we will need to back it out when we do it right -- which I think consists of propagating an MSBuild property ("WcfBaseURL"?) into the build. It also is affected by the Bridge conversations, because the URI's will be provided by Bridge. So it probably means we need to be able to specify the URL of the Bridge itself, as well as the base address we want Bridge to prepend if it chooses localhost. This means we should really drive this requirement into the Bridge discussion, so that we can best choose how Bridge gets configured.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, my thinking went something like this -- using the new lightweight name-value pair config API's, write an MSBuild task that generates code at build time to populate the name-value pairs directly from available MSBuild properties. Tests could them poll these name-value pair for things like Bridge URL, Fiddler prefix, etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely agree we need a general solution to this problem. The test Bridge host will be driving the hostname used so long term it makes sense to have this problem solved via the config mechanism we use there. I had an itch I needed to scratch today which was get fiddler working on localhost for our existing outer loop tests so figured I would generalize the solution so others could easily benefit (and I wouldn't need to keep a local copy of these changes in sync 😃 .) I have no problem with this being a stop-gap solution. I would like to see us not need to use fiddler in the long run as I would eventually like to have some inspection mechanism built into either the bridge or the client.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fiddler is very helpful when debugging issues related to requests. I'd vote we check this in now and modify it when we have the long term solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @hongdai, @mconnew - it's a stopgap solution to deal with an issue for now. I think the bridge discussion could take a while, so in the meantime, let's make the tests more debuggable for all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the Bridge bug to request configurability of base address to allow things like this. Also please update #29 to remove this code when we do it right.

@iamjasonp
Copy link
Member

This looks like it'd be a good addition to our current (very minimal) arsenal of tools we can use to diagnose issues - it seems self-contained enough too that we could back it out pretty easily when the bridge comes into play.

LGTM.

@roncain
Copy link
Contributor

roncain commented Jun 17, 2015

LGTM, subject to my replacing this shortly with #29

roncain added a commit that referenced this pull request Jun 17, 2015
Add support for tests to use fiddler proxy
@roncain roncain merged commit 8e98a14 into dotnet:master Jun 17, 2015
@mconnew mconnew deleted the fix-test-proxy-usage branch July 15, 2015 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants