Commit Graph

202 Commits

Author SHA1 Message Date
Stephen Finucane 63c3466f29 Migrate to stestr
This is effectively os-testr but maintained.

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I97183318f715b03f31145fa3d0f00bb7bc8a0c82
2022-03-23 10:23:00 +00:00
gord chung 6005f80f9b fix gate
new ostestr is different and is breaking gate. i don't think we
really need ostestr since we don't use it in any of the projects
under Telemetry. so to remain consistent and simple, just follow
similar pattern.

Change-Id: I742de2107cf56ef8b223fa1431529e706cc52377
2017-09-11 17:21:06 +00:00
Mehdi Abaakouk cf15d5a9de tests: simplify tox config
This runs most of the functional tests in the normal tox target.
(all except those tagged live).

Change-Id: Icf69ff743ba223c1b08abe858f567babfaaa64cf
2017-04-28 20:08:02 +02:00
Julien Danjou 4570e42803 Remove deprecated non-SQL drivers
Change-Id: I1eb890fe422718e986bb92139a023868bace7d96
2016-10-13 15:21:58 +02:00
LiuNanke 9f525c098f Test: make enforce_type=True in CONF.set_override
Each config option has limitation for type and value.
In production code, oslo.conf can ensure user's input
is valid, but in unit test, test methods can pass if
we use method CONF.set_override without parameter
enforce_type=True even we pass wrong type or wrong
value to config option. This commit makes sure calling
method CONF.set_override with enforce_type=True.
Closes-bug: #1517839

Change-Id: If01841b30c10e994028dcdefbb389425cb0facb1
2016-01-06 22:42:00 +08:00
liusheng b5d02e6739 Fix an minor error in test_hbase_table_utils.py
Change-Id: I707914abb4cf94ea47aeb46be32659c4d111b58b
2015-12-25 09:29:48 +08:00
Julien Danjou 59e3389655 tests: remove testscenarios usage
We actually do not run the tests with different backend at the same
time, so there's no need for scenarios.

Change-Id: I2cc7aaee04834d1949bdb3c547f0d5b893d13aef
2015-11-10 09:10:16 +01:00
Julien Danjou f2708b4ad2 storage: always use get_connection_from_config()
There's no way to connect to a backend only using an URL, because of
parameters such as mongodb_replicaset, etc. So we just remove
get_connection(url) function and always relies on
get_connection_from_config(conf).

Change-Id: I39fabbc78325709150dc7f4edb474c7bd9501205
2015-07-28 12:34:59 +02:00
Julien Danjou 7a5bddd6d9 Move 'alarm_connection' to 'connection'
- Removes the specific alarm_connection option
- Simplify get_connection*() functions and hardcode the namespace

Change-Id: I9ac13c6e9356867a815e0b8afec4815916bf3a65
2015-07-03 11:45:00 +02:00
Julien Danjou 8372f48b7a Rename to aodh
Change-Id: Ibd4c9811daa6e9e692457ce480a58c964fef7cb9
Signed-off-by: Julien Danjou <julien@danjou.info>
2015-06-25 14:46:39 +02:00
Julien Danjou 9ba3ef0ee6 Remove code unrelated to alarming
This commit removes everything that is not related to alarming.

Change-Id: Iec63d8ad00e253e962d8525080125ae4e1cc468e
2015-06-25 14:46:39 +02:00
Ilya Tyaptin 57a9fc5bce Add running functional scripts for defined backend
This CR allows running "functional" tox job for different backends.
Short description about expected workflow:
1. Gate job run ceilometer/ceilometer/tests/functional/hooks/post_test_hook.py
with <backend> parameter.
2. This script run "tox -efunctional" command with defined variable
CEILOMETER_TEST_BACKEND
3. After in "run-functional-tests.sh" setup script for the backend
and testr are runned.

In this CR running testr with pretty_tox.sh script added because
it allows to use subunit-trace output which developed in tempest-lib
and improve useful of testr output.

Partially implements: blueprint ceilometer-functional-tests
Change-Id: Idb66aca0b46779516db2baec856df8223dbe5c13
2015-06-04 16:29:02 +03:00
Jenkins 348c2263b6 Merge "Stop importing print_function" 2015-05-26 15:43:47 +00:00
Julien Danjou 7559424765 Stop importing print_function
We don't support Python 2.6 anymore so there is no use for that.

Change-Id: Ic1f8aefc4946752b03b25cac7a900f70c68133a5
2015-05-25 10:59:31 +02:00
Julien Danjou 5ac545e356 Remove useless release script in tools
This is not used anymore and can be used from openstack-release-tools anyway.

Change-Id: I4a7820bbef302fc6683b8aa3743f50383869d19f
2015-05-25 08:20:57 +02:00
Victor Stinner de9c4891e7 Python 3: generalize the usage of the six module
* Replace itertools.ifilter() with six.moves.filter()
* Replace itertools.imap() with six.moves.map()
* Replace map(_compare, statistics)
  with [_compare(statistic) for statistic in statistics]
* Replace obj.iterkeys() with six.iterkeys(obj)
* Replace obj.iteritems() with six.iteritems(obj)
* Replace xrange() with six.moves.xrange(), or with range() for small
  ranges
* Replace the repr module with six.moves.reprlib

Change-Id: Iaaa328cc15355182bde444a1aeaa4385691c8f90
2015-05-15 22:41:52 +02:00
gordon chung 7fc0d1e6c7 add event listener to collector
enable a listener in collector that listens to events queue. this
patch also renames 'metering_*' options which are now used by both
events and samples.

Change-Id: I6250c91e913864c3973e2d93022e38ad8bed8328
Implements: blueprint notification-pipelines
2015-02-02 11:00:47 -05:00
Julien Danjou a5f8d66d6e Upgrade to hacking 0.10
Change-Id: Ia567c3aeb7f8516d0834dc8e4c3852e43a687043
2015-01-23 17:43:04 +01:00
Julien Danjou eed463659f Remove the Nova notifier
This has not been tested for months and doesn't work anymore. There's no
way people are using it, so let's drop it until someone starts fixing it
again.

Change-Id: I7d6472a1924320c890dec47c41bf22db07a36efc
2015-01-23 12:35:23 +01:00
Dina Belova fc7e781344 Use oslo_config instead of deprecated oslo.config
Change-Id: I85d5c8d3d9f00f86fd14500be0da1289f5672614
2015-01-15 12:51:18 +04:00
ZhiQiang Fan c7f12a4224 Use oslo_utils instead of deprecated oslo.utils
oslo.utils 1.2.0 has changed its namespace from oslo.utils to
oslo_utils, the old import style of oslo.utils still can work but
it is deprecated.

Change-Id: I8832259624f15a8040f6de35136db7dd6d217f02
2015-01-10 21:04:23 +08:00
Ilya Tyaptin 2ea548f10f Add test data generator via oslo messaging
This script is helpful for emulate real workflow.
Generate and send sample batches with different resources and
configurable counter_name.

Change-Id: I3ab6472c99abfe28e8c200ada2da91e97abed1d2
2014-12-25 15:42:26 +04:00
Jenkins 4d1563b131 Merge "Clean up bin directory" 2014-12-19 10:24:55 +00:00
Lianhao Lu b1b6c17516 Clean up bin directory
Move ceilometer-test-event.py from directory bin to directory tools,
since it's for test purpose.

Change-Id: I3485a27ae66e255fbc460d0548be9dbb5700fa42
2014-12-18 15:00:12 +08:00
Lena Novokshonova f1c8428006 Improve tools/make_test_data.sh correctness
This change allows the script tools/make_test_data.sh and
tools/make_test_data.py to work correctly by handing
exceptions appropriately.


Change-Id: Ib054c3e10d617686928bf03f94c5ff868905afde
Closes-bug: 1389684
2014-12-17 10:15:11 +00:00
Balazs Gibizer 062ac3313d Enable pep8 on ./tools directory
This patch fixes the pep8 issues of the tool scripts and
configures tox to run pep8 on the tools directory.

Change-Id: Ifed21e19dd2b382790a1e2a90d5153a8845c4b64
2014-11-25 15:52:40 +01:00
Balazs Gibizer 16faba1ad8 Adapting pylint runner to the new message format
Parseable output format and --include-ids parameter are deprecated
and ignored in the pylint version used on the gate.
These functions are replaced by the --msg-template parameter.

This patch changes the runner to use the new parameter so that the
job can run properly on the gate

Closes-Bug: #1394606
Change-Id: Ia3e531923caa3f4e9a0dd03e0a4f5ef1a6d3dafb
2014-11-21 09:54:01 +01:00
ZhiQiang Fan 1e71626bba Add event storage for test_hbase_table_utils
event storage has been independent now, sync it to
tools/test_hbase_table_utils.py.

Change-Id: I38e467ab18c317ad12d66f641ad4419c0fe33bee
2014-10-31 03:57:34 +08:00
Artur Svechnikov afc9834a34 Fix columns migrating for PostgreSQL
Columns generated in event table and t_datetime in
trait table shouldn't be type of double precision.

Change-Id: Ib9c5c8de034b5d1ccaa070b6de7c0d682160200c
Closes-Bug: #1337851
2014-10-27 12:35:17 -04:00
Steve Martinelli 935232cc7d Use oslo_debug_helper and remove our own version
With the latest version of oslotest, we can now take advantage
of a common oslo_debug_helper script.
We can now remove our own homebrewed version, minor changes to
tox.ini were needed.

Change-Id: Ibd4317e8b1a9e38c9f4ef839352b74f14e9ddcfa
2014-10-21 15:56:44 -04:00
gordon chung 33135d8053 add script to generate test event data
similar to make_test_data.py, this script generates a set of events
and writes them to the database (defined in ceilometer.conf).

configurable options:
- start - number of days in past to start test data
- end - number of days into the future to start test data
- interval - period between events, in minutes
- event_types - number of unique event_types

Change-Id: I80e023a82f7d5129649a5b1de5256e41e901e3c1
2014-10-15 16:40:16 +00:00
gordon chung b98a225449 switch to oslo-config-generator
the config generator has been moved to oslo.config. this patch
switches to use oslo.config and removes related deprecated code.

Change-Id: I9a22336142913d65da6299ea4092e170c9b2ff33
2014-10-12 16:05:10 -04:00
Julien Danjou f7392e4757 Add oslo.db to config generator
Otherwise we miss the oslo.db configuration option in the sample config
file.

Closes-Bug: 1379808

Change-Id: I3a70e5da42562081002286d37ba1a200150c8cfc
2014-10-10 16:41:38 +02:00
Igor Degtiarov 09b80591e9 Adds pylint check for critical error in new patches
Pylint usage pattern is to take a look on a diff for pylint results between
previous code version and current patch. It's needed to critical issues only.

Change-Id: I4fc2ae732a7eaef2bc7bfacfd111ef849d003268
2014-10-07 17:27:30 +03:00
Jenkins 8b61fdd2db Merge "[HBase] Improves speed of unit tests on real HBase backend" 2014-09-29 13:16:04 +00:00
Ilya Tyaptin 125d950dd4 [HBase] Improves speed of unit tests on real HBase backend
Currently, unittests at real HBase are not usually used.
Jenkins jobs and a predominant amount of developers use
HBase mock. One of the reasons for this is that unittests at real
HBase are too slow. It's due to processing of "disable_table"
and "delete_table" commands. In HBase these command take up
to 1-2 seconds. Now we create all table-set for each test that's
why at real HBase unit tests may be executed several hours.
So, at real HBase backend unit tests may be executed several hours.

My CR speeds up this case. To solve this problem it was decided
to keep all test data in one table. To provide a distinguishability
of data from different tests unique row-prefix is used for each one.

Creating and deleting required table are implements at
setup-test-env.sh.
Separating data is implemented with mock.patchs which transforms row
value in happybase.Table methods.

Change-Id: I1883d6e0619b0b2f223a4e58bdc0fc0656636e1f
Closes-bug: #1372912
2014-09-24 15:08:36 +04:00
gordon chung c717f0ff4c update references to auth_token middleware
auth_token middleware is deprecated from keystoneclient. this
patch updates references to use keystonemiddleware instead.

Change-Id: I79b9657cafbc66000ee63b8d16104af9cd32552d
Closes-Bug: #1373115
2014-09-23 16:26:14 -04:00
Julien Danjou 14b4cdbb51 Switch to oslo.utils
Change-Id: Iacfcbf49864198915f8c229bc552afb412b83b79
2014-08-22 14:52:13 +02:00
Ladislav Smola 9e97b60195 Adding init into tools folder
Adding init into tools folder so functions from the tools can be
imported elsewhere.

Change-Id: I89347be8e7ef4fdb1428a369c9ed2dfd1f962e9a
Related-Bug: #1349791
2014-08-11 13:02:52 +02:00
Ladislav Smola 700a7ce3bd Enhancing the make_test_data script
-Adding random boundaries rather than exact value for samples
-Allowing to pass datetime object or string
-Extracting make_test_data func, so it can be imported elsewhere
-Converting the integer time span to datetime

Change-Id: Iffbc8d9711b2f301a1f28b49980691ab34d17c20
Related-Bug: #1349791
2014-08-11 13:02:39 +02:00
Jenkins 0d09af4533 Merge "Fix make_test_data tools script" 2014-08-06 14:01:01 +00:00
gordon chung 2dc6348c90 Debug env for tox
Running a test with pdb was difficult because tox captures
output and causes pdb prompt to quit.

Tips for how to run with debug are provided here:
 https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests

This change puts these commands into a debug env in tox.ini so
you can do a command like:

tox -e debug pycadf.tests.test_cadf_spec

and when it hits your breakpoint you'll get the debug prompt.

Change-Id: Ic53a888e4e305d51159d1d6a2f962786a532e089
Co-Authored-By: Brant Knudson <bknudson@us.ibm.com>
Closes-Bug: #1350424
2014-07-31 15:11:11 -04:00
Ladislav Smola db04f196bd Fix make_test_data tools script
Method get_connection has been renamed to
get_connection_from_config.

Resource is object not dictionary, so attributes needs to be
accessed that way.

Change-Id: I19e09f3e9077d3346b4361fa6975a3e696e2e765
Related-Bug: #1349791
2014-07-29 13:20:59 +02:00
Dina Belova d65dd17016 Replace dict.iteritems() with six.iteritems(dict)
This change is needed to make Ceilometer code both Python 2.x and
3.x compatible in some future. Oslo modules are left without
changes in this change, that will be done directly in the
oslo-incubator code.

Partially-Implements: blueprint ceilometer-py33-support
Change-Id: Ic7fe5819f85524bb36f04dec6cad10d4cf2b935d
2014-07-28 16:35:16 +04:00
Gordon Chung 36638dde9d sync oslo code
synchronise up to Change-Id: I0d945784cbe24e34c8ef19d3d3c9c0f012cfe176

Change-Id: I1e28a60c8def0e3f4ba0c61985cfa0b9312ea5bd
2014-06-18 11:33:04 -04:00
Martin Geisler d7054053ae Remove (c) and remove unnecessary encoding lines
The word "Copyright" alone is sufficient to claim copyright, the (c)
symbol need not be present.[1]

As per PEP 263, a Python file with non-ASCII characters must have a
line with "coding: <some-encoding>". Python files containing only
7-bit ASCII characters need no such line.[2]

This commit removes unnecessary Unicode copyright symbols and
unnecessary encoding lines.

[1]: http://www.copyright.gov/circs/circ03.pdf
[2]: http://legacy.python.org/dev/peps/pep-0263/

Closes-Bug: #1324686
Change-Id: Id381ea1f029a0cfddd3773c6d9f16c47842d9c33
2014-05-31 13:02:21 +02:00
Mehdi Abaakouk 5995bf906c Replace oslo.rpc by oslo.messaging
The patch replaces oslo.rpc by oslo.messaging.

The important changes:
- On the collector, the queue name and the topic are now the same
  (ie: metering, instead of ceilometer.collector.metering for the queue
  and metering for the topic)
- Same for the alarm partitionner the queue is no more prefixed by
  ceilometer.alarm.

Implements switch-to-oslo.messaging

Change-Id: Ia5e4ff1dd1d419c090b8039627234ae7f07e8660
2014-04-14 11:56:56 +02:00
Mehdi Abaakouk 5f953e2765 Sync oslo-incubator code
Sync code to commit: b7ad6ddab8b1d61bf4f52ccaa461a9d68809747b

The oslo db API have been changed, so sqlalchemy driver have been updated
to match these changes.
We now use sqlalchemy/migration.py from oslo.db instead of the
ceilometer one.
The unused alembic code have been removed, because it is handled by
oslo.db now.

Closes bug: #1293409

Change-Id: I480d678a7165f32b92c5c9b4c55491c0edbc0991
2014-04-08 14:08:24 +02:00
Andreas Jaeger 7ae3124259 Improve help strings
Follow oslo.config style guide for help strings better to create
consistent help strings:
* Capitalize first word of each help string
* Finish help strings with "."
* Improve wording

Change-Id: I4723ad672c30146869254695ba82678b082efd91
2014-02-08 06:46:32 +01:00
Gordon Chung 733f281133 sync oslo common code
sync code with commit-id: 5e5a51b3ddc25b3242e8f4f4b5e5357942618662

Change-Id: If62f3bba14cdc74c78685b2fdf5aa769c4158a50
2014-02-05 15:52:47 +00:00