* always run with a clean cache
* in the future we should structure the tests so they run twice, once with a clean cache and then again with a populated one, but for now a clean cache should catch more bugs
* stop requiring a file cache path for tests; just use
* fix exit codes to match documentation at the top of the file: 1 is a test failure, 2 is bad args
Squash-merge of my #198.
We are going to need some nginx-specific system tests, and this seemed like a
good place to start. This adds two tests, as well as some infrastructure. With
Squash-merge of my #194 and #195
Makes sure we use the LoopbackRouteFetcher, and also wires up AddHeadersFetcher.
Note that this pulls in loopback_route_fetcher.cc from svn revision r2649
The LoopbackRouteFetcher is applied unconditionally, while in mod_pagespeed it
is not applied when one of these configuration settings is true:
* disable_loopback_routing
* slurping_enabled, or
* test_proxy is set
I added a TODO for that.
(Sqash-merge of Otto's #193.)
This wires up cleanup code shared memory segments.
It uses slightly modified copies of pthread_shared_mem.cc/h, containing a change
proposal to support our ordering of events during a configuration reload.
It can be tested and reviewed through this branch.
I did some extensive tests, it seems segment cleanup is not perfect yet
(segments for named locks, per vhost statistics segments). I think we need to
fix that in the trunk-tracking branch or in a separate pull though. It seems the
current trunk of psol has improvements that may fix this, and fixing it in this
pull will make it larger and more complex then I would like it to be.
Squash-merge of Otto's #179.
This allows viewing the last few messages written to the SharedCircularBuffer in
NgxMessageHandler through url /ngx_pagespeed_message
Related issue: https://github.com/pagespeed/ngx_pagespeed/issues/153
Squash-merge of Otto's #180.
This adds /ngx_pagespeed_statistics. It also uses SharedMemoryStatistics instead
of the SimpleStatistics currently used, and sets them as the default. It also
adds support for tracking per server{} statistics.
Cleaning up of shared segments is disabled, because the current psol version we
link in has a problem with the ordering of nginx's events during a configuration
reload.
The referrer statistics will be ported in a separate pull.
Related to issue #133
Squash-merge of Otto's work in #176.
This adds an NgxMessageHandler, that uses ngx_log_error to output messages. It
is heavily based on apache_message_handler from mod_pagespeed.
It falls back to an internal GoogleMessageHandler if the required initialisation
has not been performed yet.
It can also install a crash handler, that will try to log a backtrace upon
receiving certain signals. In preparation of us porting /ngx_pagespeed_messages,
it also keeps the last few messages in a SharedCircularBuffer
(Squash-merge of Otto's #163)
We need to have the NgxRewriteDriverFactory available at configuration parse
time to set options on it. This change moves instantiation of the factory in
front of configuration parsing. Afterwards, a check is done to see if we where
enabled anywhere. If we where not enabled / do not have any active server
contexts, the NgxRewriteDriverFactory is deleted. It's not very elegant, but we
can't think of anything better currently.
Squash merge of Otto's #165.
This is the ngx_pagespeed half of a refactor morlovich made:
Split out the settings that can be shared between
mod_pagespeed and ngx_pagespeed into a separate class.
This is step 1 out of ??? of refactors to reduce code dupe
between mod_pagespeed and ngx_pagespeed and make some
things more testable.
(Step 2 will be to share some of the configuration parsing
code).
-- https://code.google.com/p/modpagespeed/source/detail?r=2443
A normal .pagespeed. url looks like:
256x192vPuzzle.jpg.pagespeed.ic.alA0AdlR-2.jpg
If someone turns on RunExperiment, however, we generate urls like:
256x192vPuzzle.jpg.pagespeed.a.ic.alA0AdlR-2.jpg
256x192vPuzzle.jpg.pagespeed.b.ic.alA0AdlR-2.jpg
The new section is always a single letter between a and z. We need to catch
these and pass them through to PageSpeed.