brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [9/9] brooklyn-server git commit: Closes #556
Date Mon, 13 Feb 2017 06:26:49 GMT
Closes #556

Speed up tests

Starting an embedded OSGi container is slow - over half a second per `setUp()` call (and thus
per test method) that uses it. It will likely be considerably slower on the jenkins build
machine etc. This PR separates out those classes that include an embedded OSGi container into
those tests that actually need it and those that don't. It primarily moves code around (e.g.
separating out the osgi-based tests from `CatalogYamlLocationTest` into a new `CatalogOsgiYamlLocationTest`).

It also cherry-pick @ahgittin's commit that was included in https://github.com/apache/brooklyn-server/pull/480
(which marks some more slow tests as "integration").

If you're wondering why just moving the code has resulted in a bunch of extra lines (`+1,956
−1,038` according to the "Files changed" summary), there are two primary reasons: first
there are 6 new classes which have the apache header and a bunch of imports; second the `CatalogOsgiYamlEntityTest`
repeats some tests that are done in `CatalogOsgiEntityTest`. The reason is that there are
subtleties in how bundles are used to load catalog items (especially when composing multiple
items, and sub-typing). It's therefore worth having slow versions of some of these tests that
use actual OSGi bundles.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/0f649fe1
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/0f649fe1
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/0f649fe1

Branch: refs/heads/master
Commit: 0f649fe175d6dfb1327d1db5bec420d71ac2a4c1
Parents: 6571bab 29191b7
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Mon Feb 13 08:26:05 2017 +0200
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Mon Feb 13 08:26:05 2017 +0200

----------------------------------------------------------------------
 .../camp/brooklyn/AbstractYamlTest.java         |  20 +
 .../camp/brooklyn/ReferencedOsgiYamlTest.java   | 230 +++++
 .../camp/brooklyn/ReferencedYamlTest.java       | 191 ----
 .../catalog/CatalogOsgiYamlEntityTest.java      | 861 +++++++++++++++++++
 .../catalog/CatalogOsgiYamlLocationTest.java    | 198 +++++
 .../catalog/CatalogOsgiYamlPolicyTest.java      | 165 ++++
 .../catalog/CatalogOsgiYamlTemplateTest.java    | 113 +++
 .../brooklyn/catalog/CatalogYamlEntityTest.java | 796 +++++------------
 .../catalog/CatalogYamlLocationTest.java        |  81 +-
 .../brooklyn/catalog/CatalogYamlPolicyTest.java |  73 +-
 .../catalog/CatalogYamlTemplateTest.java        |  43 +-
 .../catalog/SpecParameterParsingOsgiTest.java   | 116 +++
 .../catalog/SpecParameterParsingTest.java       | 101 +--
 .../feed/function/FunctionFeedTest.java         |   2 +-
 ...okeEffectorOnCollectionSensorChangeTest.java |   2 +-
 .../brooklyn/policy/ha/ServiceReplacerTest.java |   2 +-
 16 files changed, 1956 insertions(+), 1038 deletions(-)
----------------------------------------------------------------------



Mime
View raw message