← Back to team overview

launchpad-dev team mailing list archive

Re: url weirdness in tests??

 

On Tue, Nov 23, 2010 at 5:58 PM, Ian Booth <ian.booth@xxxxxxxxxxxxx> wrote:

> So, what to do? It seems to me that there is a legitimate issue in that
> key runtime classes - CanonicalConfig and AllVirtualHostsConfiguration -
> provide different information from different config files and which
> version of root_url you get depends on who you ask. browser.url (via
> canonical_url()) gets its value by asking AllVirtualHostsConfiguration
> and BaseLayer.appserver_root_url() gets its value by asking
> CanonicalConfig. I think we need one true answer for root url etc
> provided by one class? So CanonicalConfig should delegate to
> AllVirtualHostsConfiguration or I think preferably visa versa. This
> would mean that the root urls from the testrunner-appserver config files
> would be used for tests, and presumably the correct values from
> elsewhere for running Launchpad?
>
> Am I way off base here? Any clarification much appreciated. I need to
> get this sorted out so that I can complete the work to remove hard coded
> urls from all tests.

So I think the core difference is this:
 - what we're listening on is not
 - what we're serving on

e.g. we're serving conceptually on code.launchpad.dev, but we're
listening on code.launchpad.dev:8085

So we can't *connect* to the former (unless apache is active) but we
can to the latter.

I think this implies:
 - in tests we want to serve conceptually where we are listening
 - in production we want to server conceptually where we are configured

And this implies:
 - in tests we want to configure our serving location to match our
listening configuration.

Hope this teaser helps!

[Note that the transient config stuff is already present so you should
not be seeing testrunner, rather testrunner_PID, as the config - and
you can change the testrunner_PID config as the code in layers.py does
- or in my [unlanded, I think I'm going to have to hand them off]
databasefixture and librarian branches.

-Rob



References