about summary refs log tree commit homepage
path: root/t/test-lib.sh
DateCommit message (Collapse)
2013-02-04tests: "wc -l" portability for *BSDs
On FreeBSD 9.0, "wc -l" emits leading whitespace, so filter it through tr -d '[:space:]' to eliminate it.
2013-02-01tests: "wc -c" portability for *BSDs
On FreeBSD 9.0, "wc -c" emits leading whitespace, so filter it through tr -d '[:space:]' to eliminate it.
2013-02-01tests: replace non-portable "date +%s" with ruby equivalent
"date +%s" is not in POSIX (it is in GNU, and at least FreeBSD 9.0, possibly earlier). The Ruby equivalent should be sufficiently portable between different Ruby versions. This change was automated via: perl -i -p -e 's/date \+%s/unix_time/' t/*.sh
2011-05-30test-lib: enable splice(2) for Linux 3.x
The latest Linux series is now 3.x, not 2.6.x
2011-05-16tests: unify checks for copy_stream and threaded app dispatch
This makes things easier to maintain as we add more concurrency options.
2011-05-16add "copy_stream" config directive
This allows using IO::Splice.copy_stream from the "io_splice" RubyGem on recent Linux systems. This also allows users to disable copy_stream usage entirely and use traditional response_body.each calls which are compatible with all Rack servers (to workaround bugs in IO.copy_stream under 1.9.2-p180).
2010-12-27test-lib: fix bug in setting worker_connections
We need to be able to set this with keepalive_timeout simultaneously.
2010-12-27initial cool.io support
Cool.io is the new name for Rev. We'll continue to support Rev until Cool.io breaks backwards compatibility. Rev may not be supported if Cool.io is.
2010-10-28tests: avoid race conditions on reload tests
We need to ensure the old worker is really dead before sending requests after reloading.
2010-06-11update test infrastructure to support Rubinius
Rubinius still has a few issues that prevent 100% support, but it basically works if log rotation or USR2 upgrades aren't required. Tickets for all known issues for Rubinius have been filed on the project's issue tracker. * rbx does not support -i/-p yet, so rely on MRI for that * "io/nonblock" is missing * avoiding any optional Gems for now (EM, Rev, etc..)
2010-06-04test-lib: set NO_PROXY to counter http_proxy
Some testers (like myself) use http_proxy when isolating gems to avoid wasting bandwidth, but we don't proxy requests to localhost.
2010-06-03test-lib: remove ancient wait_for_pid() function
It hasn't been used since the first month of development when we started using FIFOs
2010-05-20tests: chunked client_body_max_size fails with old curl
curl < 7.18.0 did not check for errors when doing chunked uploads. Unfortunately some distros are slow moving and bundle ancient versions of curl.
2010-05-20tests: fix sha1sum usage
non-random_blob arguments weren't being taken into account correctly :x
2010-05-14test: do not let async-response run with Base
2010-05-03add client_max_body_size config directive
Since Rainbows! is supported when exposed directly to the Internet, administrators may want to limit the amount of data a user may upload in a single request body to prevent a denial-of-service via disk space exhaustion. This amount may be specified in bytes, the default limit being 1024*1024 bytes (1 megabyte). To override this default, a user may specify `client_max_body_size' in the Rainbows! block of their server config file: Rainbows! do client_max_body_size 10 * 1024 * 1024 end Clients that exceed the limit will get a "413 Request Entity Too Large" response if the request body is too large and the connection will close. For chunked requests, we have no choice but to interrupt during the client upload since we have no prior knowledge of the request body size.
2010-02-20test-lib: make FIFO start check an after_fork hook
enabling ready_pipe in Unicorn 0.96.0 breaks this.
2010-02-20test-lib: remove needless fd closing
too dangerous with the ready_pipe feature in Unicorn 0.96+
2009-11-28tests: more stringent error checking in logs
If we logged "ERROR", we should know about it.
2009-11-18make keepalive_timeout configurable
And change the default to 2 seconds, most clients can render the page and load all URLs within 2 seconds.
2009-11-09tests: ensure we process "START" from FIFO when starting
Avoid the chances of misfiring when waiting on the master process to start in case something bad happens or we're sharing the FIFO for other purposes.
2009-11-07tests: allow use of alternative sha1 implementations
sha1sum(1) is only common GNU systems, and it may be installed as gsha1sum on *BSDs. We'll also try using the openssl sha1 implementation, too. And finally, we'll provide our own Ruby sha1sum.rb implementation as a last resort. We go to great lengths to avoid our own Ruby version because we want to avoid putting too much trust in ourselves, our Ruby skills, and even the Ruby implementations. This is especially with regard to our knowledge and correct usage of Ruby 1.9 encoding support. It would actually be *easier* to only use sha1sum.rb and call it a day. We just choose to support SHA1 implementations provided by third parties if possible. Performance is not a factor since sha1sum.rb performance is very close to the C implementations.
2009-10-27test-lib: DWIM handling of temp UNIX sockets
2009-10-26tests: gracefully exit if EventMachine is not available
2009-10-24tests: remove symlinks and small files, use Make
This will make it easier to enable and manage tests for new concurrency models.
2009-10-24tests: port all existing tests to TAP library
Everything passes, and "set -e" prevents us from making any stupid mistakes...
2009-10-24tests: common setup and wait_start functions
Instead of sleeping and waiting for a PID file to appear, just use a named-pipe and block on it in the test scripts since we know Unicorn won't attempt to fork until sockets are already bound.
2009-10-24tests: prefer "RUBY" to lowercased "ruby"
It's more common form for externally-visible/modifiable variables in Makefiles and shell scripts.
2009-10-19test-lib: avoid stalling due to bad FIFO handling
Don't try to clobber FIFOs at startup since sometimes traps may not fire. And while we're at it, avoid trying to unlink them twice.
2009-10-18tests: predictable and simpler tempfile management
Instead of using completely random names, we'll use predictable ones since we already depend on them for exit codes and such. This drops our ability to run the same test for the same version of Ruby in the same working tree, but that's an unlikely scenario. While we're at it, avoid remove tempfiles if a test failed. This should make debugging easier.
2009-10-18tests: DWIM FIFO creation
If we're going to name a variable "fifo", it'll be for descriptive reasons...
2009-10-18tests: more reliable error checking
We now check for SIGKILL, too
2009-10-17tests: for log reopening for all concurrency models
2009-10-17tests: DRY require tests for Rev/Revactor
2009-10-17test-lib: quiet down pipefail error message
We'll spit out a proper warning later anyways...
2009-10-17tests: DRY Ruby requires based on model
2009-10-17tests: DRY setting of the "model" environment var
2009-10-17tests: fix issues with non-portable shell constructs
At least these tests all run with dash now, but ksh93 or bash is still recommended for pipefail
2009-10-17tests: introduce require_for_model function
This makes it easier to write/share code for multi-model tests.
2009-10-17test-lib: dbgcat adds headers with key name
Makes it easier to track down empty files this way
2009-10-14preliminary Rev support
There is no TeeInput (streaming request body) support, yet, as that does not seem fun nor easy to do (or even possible without using Threads or Fibers or something to save/restore the stack...)
2009-10-10tests: enable pipefail shell option if possible
pipefail is extremely useful for detecting bad exits _anywhere_ in pipelines, not just the last command. Combined with "set -e", pipefail leads to very unforgiving scripts that bail out at the first sign of error, exactly what we want in tests.
2009-10-08tests: add dbgcat() utility method
Useful for prefixing individual lines of a temporary file while catting it to stdout. This helps make tests easier to write and test.
2009-10-08tests: simplify temporary file management
Since we rely heavily on temporary files in tests, make sure management of them is easy and reliable.
2009-10-05Avoid naming names in LICENSE/README files
Everything is logged in git anyways and it'll be easier to hand off to somebody else.
2009-10-04Add new test suite and basic cases
I'd rather write shell scripts in shell than shell scripts in Ruby like was done with Unicorn. We're a *nix-only project so we'll embrace *nix tools to their fullest extent and as a pleasant side-effect these test cases are immune to internal API changes.