tests: import pipeline config

This is a problem when running only one database test, as the pipeline
code might not be imported before, and overriding the option might not
work.

Change-Id: I0a0ba3b66419f45c2cc0a12d798b49a70a97673e
add more test cases to improve the test code coverage #2

In this patch, the following modules test coverage improved to 100%

1. ceilometer/storage/sqlalchemy/models

Change-Id: Ie8a12ea07cb6c406f82cb29e8743fe67110c94c8
Don't publish samples if resource_id in missing

In swift API, the user can call uri without the resource_id.
This patch skip the samples publishing instead of raising the
exception:

Traceback (most recent call last):
File "ceilometer/objectstore/swift_middleware.py", line 109, in iter_response
    bytes_sent)
File "ceilometer/objectstore/swift_middleware.py", line 160, in publish_sample
    resource_id=account.partition('AUTH_')[2],
AttributeError: 'NoneType' object has no attribute 'partition'

It print the exception of the samples publishing failure instead of
raising a exception to never break the swift API.

Fixes bug #1223259

Change-Id: I5d90fa620c8f8ea82e86524b9703049257ca0345
Avoid imposing alembic 6.0 requirement on all distros

Related-to: LP 1224666

Two of the alembic-based migrations use the new 'type_' kwarg in calls
to op.drop_constraint(), even though the old 'type' form was retained
for backward compatability:

  https://alembic.readthedocs.org/en/latest/ops.html

  "Changed in version 0.5.0: The type parameter is now named type_.
  The old name type will remain for backwards compatibility."

To avoid needlessly imposing the alembic 6.0 on distros for which this
version is not yet packaged, we revert these migrations to use the older
form.

The corresponding change to the global requirements is proposed here:

  https://review.openstack.org/48227

Change-Id: I3796ffa3de0e0f558f368d7ebf8e55c87657753d
Add example with return values in API v2 docs

Add a "real" example of a groupby statistics query with return
values in API v2 documentation.

The example is taken from an actual query run on a machine
running Devstack and Ceilometer.

Addresses bug # 1228465

Change-Id: I0414fdaf31ca365f0404c77504d4106de7c17f74
Merge "tests: import pipeline config"
Allow to get a disabled alarm

This change allow to get a disabled alarm.

To do this, it:
* add the ability to query the alarm-list API with the 'enabled' fields.
* change the default visibility of alarm-list API from enabled only to all.

Fixes bug #1231328

Change-Id: I80cd691696f7630d2ac9e9b2a69b5b0ae5ee7968
Merge "add more test cases to improve the test code coverage #2"
Merge "Add example with return values in API v2 docs"
Remove MANIFEST.in

pbr is able to generate the file listing for us, and this file is bugged
as it misses files like alembic.ini. Let's remove it.

Fixes-Bug: #1231503

Change-Id: I95204db0752a10138d3e3d7bc1fa9a271145bf67
Don't load into alarms evaluators disabled alarms

With this patch, alarm evaluators query the ceilometer API with only
enabled alarms inteads of loading all alarms and skip the disabled one.

Related to bug #1231328

Change-Id: I7121c1d2703f2f82a7d910431696aa31cbf7fbe6
Merge "Don't publish samples if resource_id in missing"
Merge "Avoid imposing alembic 6.0 requirement on all distros"
add more test cases to improve the test code coverage #3

In this patch, the following module test coverage improved to 100%

ceilometer/agent.py

Change-Id: I06ac05d8b3e77f67e0f25df08db25ddcb1f087ac
remove locals() for stringformat

When renames variable, locals() brings bug.

Change-Id: I273ca9f71c0f4d37354bd90a43ce758baf2aeebe
Merge "Allow to get a disabled alarm"
Merge "Don't load into alarms evaluators disabled alarms"
Merge "add more test cases to improve the test code coverage #3"
add coverage config file to control module coverage report

Ceilometer copies oslo common code into its code stream. When run
unit tests with coverage option, the overall test code coverage
percentage is low due to the enclosure of the common libraries.
Adding the coverage config file will exclude these modules in
the code coverage report so that developers can easily see if
new test cases has increased or decreased the code test coverage.

to see the code coverage report, following the following steps:

1. In ceilometer root directory, execute the following command
   ./run-tests --coverage
2. Once the test run completed successfully, open up the follwoing
   file in your browser and scroll down to the bottom to see the
   total number. (this patch makes that number to be 90%)
   <ceilometer_root_dir>/cover/index.html

To keep up with this effort, whenever you add new code, please
run the test code with coverage option and make sure your new
code and test won't decrease the total percentage. If it did,
that means you may have new code un-tested :-)

Change-Id: I277c243b6aadb0e8524915452326ed875e14ce9c
Merge "remove locals() for stringformat"