Add missing indexes on catalog_resources
(#15645) Daemon should terminate upon OOM error

Though we can potentially catch an OOM error and do something about it,
it’s not guaranteed that the error will occur in a thread in which we
can interpose our own logic. But certainly we shouldn’t keep the process
going if an OOM renders it effectively inoperative...better to just kill
the process altogether than to leave a zombie around.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #269 from grimradical/bug/master/15645-die-on-oom

(#15645) Daemon should terminate upon OOM error
Use the correct operator for tag array comparison

This was previously using an incorrect operator. Using the correct
operator seems better.
Merge pull request #270 from nicklewis/add-missing-indexes

Add missing indexes on catalog_resources
Add support for a test configuration file

This commit adds support for a configuration file to be used
during unit test runs.  At present, the only thing that you
can define in the config file is a function that returns
a map of database settings.  There is a default configuration
file provided, which simply returns the same database settings
that we were using before (an in-memory hsql database with
a random UUID).  However, it also provides instruction for
creating a local override of the default config file, including
an example of how to configure your tests to run against
postgres instead of hsql.

This commit also tweaks the with-test-db fixture to call
a database-cleanup function prior to running the database
migration.  This cleanup function drops all of the tables
if they exist, so that each test can start with a fresh db.
Autoformat test/scf/storage.clj for indentation fixes

The previous commit changed a lot of the nesting of the
code in this file because it introduced several new
"deftest" calls, in order to work properly with the
with-test-db fixture.  This commit simply attempts to
clean up the whitespace / indentation of the file.
Fix some order-dependent test failures

The way we set up the class variables for
Util::Puppetdb#server/port allows the possibility of some
order-dependent test failures.  This fixes the tests, but
we might want to look for a way to get rid of those
variables to avoid additional occurrences of this problem.

Conflicts:

	puppet/lib/puppet/util/puppetdb.rb
Acceptance: Don't set up dev package repo for source installs

Prior to this commit, the acceptance setup suite would always
configure a machine to add the puppetlabs dev package repos, even
if the acceptance run was being done from source code instead of
packages.  This caused 'apt-get update' to fail if you tried to
run the tests on a machine that was not connected to the puppetlabs
LAN or VPN.

This change causes the acceptance setup to only add the puppetlabs
dev package repos if you are installing from packages; this allows
runs from source to succeed w/o being connected to the VPN or LAN.
Renamed http/resources.clj to resource.clj for consistency
Initial implementation of puppetdb report processor

Needs more tests.  Currently, the server side does nothing
but log a pretty-printed version of the report.  I believe
that the data structure that is being sent up for the report
is complete, though--I've doublechecked it (by hand) against
several YAML reports on disk and I believe that all of the
fields are present.
Initial (naive) implementation of report storage

This includes:

* schema for event groups and resource events
* SQL-related scaffolding for event groups and resource events
* HTTP endpoints for querying events and event groups.

Does not yet support:

* Querying via any other means besides "group-id"
* Any other kind of event besides "resource" events