As per victoria cycle testing runtime and community goal,
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).
Bump lower constraints to make testing work for Focal.
Change-Id: I1fc6b0c67d767bc698e12f0e79fadd19bb7d0a8d
Story: #2007865
Task: #402198
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: Id266a937b37507a1cef05ac34e33a80265581ad1
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
This replaces the deprecated (in python 3.2) unittest.TestCase
method assertRaisesRegexp() with assertRaisesRegex()
Change-Id: Ie329779dbfe39ec9674f9a999a27d927311b7e7b
The kwarg ``enforce_type`` should be removed from oslo.config's
``set_override`` function, used throughout unit tests, because it's
currently deprecated and will soon be removed [0], as ``enforce_type``
currently has default value of ``True`` [1].
This patch also removes instances of ``CONF.set_override`` and
``CONF.clear_override`` from unit tests that inherit from
``base.MuranoTestCase`` which already provides a wrapper around
this functionality: ``override_config`` which also calls
``CONF.clear_override`` via ``self.addCleanup``.
[0] Can be seen in any unit test logs
[1] https://github.com/openstack/oslo.config/blob/master/oslo_config/cfg.py#L2625
Change-Id: I6146ea2363e594fd000d8ecda8c2130145723ffe
Closes-Bug: #1690886
Removes the @testtools.skipIf decorator from
test_load_package_except_lookup_error in
murano.unit.tests.engine.test_package_loader, because related bug was
removed [1].
This patch makes a trivial change by removing the skip.
[1] https://review.openstack.org/#/c/384713/
Change-Id: I86cfe4cedd63b0224fcc0186cdba671bb91004e9
Related-Bug: #1632107
OpenStack Puppet CI uses packaged version of Murano,
so we don't have write permissions to test directory.
We need to compose Murano packages required for
tests in temporarily directories to fix it.
Closes-Bug: #1620706
Change-Id: I0334869237208f707b66b1e473e6044b1d3fe06f
Group 'packages_opts' has always been inconsistent, since it included
'opts' into it's name and options in that group we related to both
engine and api. This commit moves engine related options to [engine]
group and api-related options to [murano] group.
This restores backward compatibility with liberty configs, that included
'load_packages_from' into [engine] group
'packages_opts' is added to all the options moved as deprecated_group,
thus retaining backward compatibility with old configs
Change-Id: I00b6f06ec352de4b57baaa86da9155bb36bcc23a
Closes-Bug: #1543027
* Single universal ClientManager class was dropped in favor of
of individual in-context methods to create OS clients without
ClientManager restrictions.
* Environment class was renamed to ExecutionSession to avoid
common confusion with io.murano.Environment
* execution_session_local module was introduced to simplify
keep of per-execution session (per-deployment) data. This
is similar to thread-locals with the difference that there can
be many threads in single session.
* All OS-clients related code was migrated to keystone client
sessions and API v3 (except for GLARE and Mistral that doesn't
support sessions). This increases performance and solves
authentication problems that could be caused by token expiration
even with trusts enabled.
* [DEFAULT]/home_region setting was introduced instead of
[murano]/region_for_services to configure what region
should be used by the clients by default (where Murano API
resides). All client factories respect this setting.
Change-Id: If02c7e5d7d39574d0621e0e8dc27d1f501a31984
Previously usage_cache incorrectly used the whole definition as key.
This lead to incorrect deletion of package cache during downloads.
This commit also updates the way errors during exclusive package are
handled and updates test to include cleanup, deletion and non-deletion
of cached packages
Implements bp: murano-engine-package-cache
Change-Id: I6567d60fe5094c4ff06a87d9392f71e319f93d9c
This commit modifies cleanup method of API package loader to include
cleaning up of stale downloaded packages. This is done with respect to
IPC and green-thread usage locks.
Implements blueprint: murano-engine-package-cache
Change-Id: I09a08c3646c32666893b5ed35463f8ec5e413284
Method CONF.set_override to change config option's
value with designated value in unit test, but never check if the
designated vaule is valid. Each config option has a type like StrOpt,
BoolOpt, etc. StrOpt with parameter choices only allows values in set
of choices. In short, 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 and fixes violations.
Note: We can't set enforce_type=True by default in oslo.config now, it
may break all project's unit test. We can switch enforce_type=True by
default when all project fix violations like this commit.
Related-Bug: #1517839
Change-Id: Ia9f6b8a04290f93699fc1f613ce0e841f040d4ae
With this change MuranoPackage becomes first-class DSL citizen.
Packages have version, runtime_version (that is specified
in Format attribute of the manifest file) and a list of classes.
Previously engine used to have package loader which had most
of "load" functionality and class loader that mostly acted as an
adapter from package loader to interface that DSL used to
get classes. Now class loader is gone and is replaced with
package loader at the DSL level. Package loader is responsible
for loading packages by either package or class name (as it was
before) plus semantic_version spec (for example ">=1.2,<2.0").
Package loader can now keep track of several versions of the same
package.
Also packages now have requirements with version specs.
All class names that are encountered in application code are
looked up within requirements only. As a consequence
packages that use other packages without referencing
them explicitly will become broken. An exception from this rule
is core library which is referenced automatically.
Partially implements: blueprint murano-versioning
Change-Id: I8789ba45b6210e71bf4977a766f82b66d2a2d270
This package class loader combines two types of
class loaders: loading packages from API and from local directory.
If folders to look packages in are specified,
packages would be loaded from their.
Otherwise, standart loader by API will operate as usual.
Implements blueprint change-murano-class-loader
Change-Id: Ifd8f40a755dc580703a44edc2b32cdd17691669d