streamsx.testing.nose

Nose plugins for IBM Streams application testing.

Classes

AddConfigurationPlugin() Add arbitrary configuration to a test
DisableSSLVerifyPlugin() Disable SSL certification verification.
JobConfigPlugin() Job configuration plugin.
SkipStandalonePlugin() Skip standalone tests.
class streamsx.testing.nose.AddConfigurationPlugin

Add arbitrary configuration to a test

Enabled with --with-streamsx-add-config.

This plugin adds arbitrary configuration items to a test’s test_config dictionary by updating with the dictionary value supplied by the options.

These options must be set when using this plugin.

  • --streamsx-test-context CONTEXT - Context that will have its configuration added to. Any test that runs with a different context will not have its
  • --streamsx-test-config CODE - Code that is executed using built-in method exec. The execution must set the local variable cfg to a dictionary that will then be used as test.test_config.update(cfg) before the test is run.

Example:

nosetests --with-streamsx-add-config --streamsx-test-context STANDALONE --streamsx-test-config "cfg = {'topology.keepArtifacts':True}"
configure(options, conf)

Configure the plugin and system, based on selected options.

The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enableOpt) is true.

options(parser, env=environ({'HOSTNAME': 'build-9365248-project-251772-streamsxtesting', 'PYPY_VERSION_35': 'pypy3.5-7.0.0', 'APPDIR': '/app', 'HOME': '/home/docs', 'OLDPWD': '/', 'CONDA_VERSION': '4.6.14', 'READTHEDOCS': 'True', 'READTHEDOCS_PROJECT': 'streamsxtesting', 'PATH': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/envs/pypackage/bin:/home/docs/.pyenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/docs/.conda/bin:/home/docs/.pyenv/bin', 'LANG': 'C.UTF-8', 'DEBIAN_FRONTEND': 'noninteractive', 'BIN_PATH': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/envs/pypackage/bin', 'PYTHON_VERSION_35': '3.5.7', 'READTHEDOCS_VERSION': 'pypackage', 'PYTHON_VERSION_27': '2.7.16', 'PYTHON_VERSION_36': '3.6.8', 'PWD': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/checkouts/pypackage/docs/source', 'PYTHON_VERSION_37': '3.7.3', 'PYENV_ROOT': '/home/docs/.pyenv', 'DOCUTILSCONFIG': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/checkouts/pypackage/docs/source/docutils.conf'}))

Register commandline options.

Implement this method for normal options behavior with protection from OptionConflictErrors. If you override this method and want the default –with-$name option to be registered, be sure to call super().

class streamsx.testing.nose.DisableSSLVerifyPlugin

Disable SSL certification verification.

Disables SSL certification when running distributed tests. This is useful when a test instance with a self-signed certificate, such as the IBM Streams Quick Start edition.

Enabled with --with-streamsx-disable-ssl-verify.

configure(options, conf)

Configure the plugin and system, based on selected options.

The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enableOpt) is true.

class streamsx.testing.nose.JobConfigPlugin

Job configuration plugin.

Plugin that modifies the job configuration object for the application under test.

Enabled with --with-streamsx-jco.

These options are supported:

  • --streamsx-jco-default-tag=tag - Sets the resource tag for the default host pool. The default host pool is where transformations/operators with explicit resource tags are assigned to and by default maps to the resource tag application.
configure(options, conf)

Configure the plugin and system, based on selected options.

The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enableOpt) is true.

options(parser, env=environ({'HOSTNAME': 'build-9365248-project-251772-streamsxtesting', 'PYPY_VERSION_35': 'pypy3.5-7.0.0', 'APPDIR': '/app', 'HOME': '/home/docs', 'OLDPWD': '/', 'CONDA_VERSION': '4.6.14', 'READTHEDOCS': 'True', 'READTHEDOCS_PROJECT': 'streamsxtesting', 'PATH': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/envs/pypackage/bin:/home/docs/.pyenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/docs/.conda/bin:/home/docs/.pyenv/bin', 'LANG': 'C.UTF-8', 'DEBIAN_FRONTEND': 'noninteractive', 'BIN_PATH': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/envs/pypackage/bin', 'PYTHON_VERSION_35': '3.5.7', 'READTHEDOCS_VERSION': 'pypackage', 'PYTHON_VERSION_27': '2.7.16', 'PYTHON_VERSION_36': '3.6.8', 'PWD': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/checkouts/pypackage/docs/source', 'PYTHON_VERSION_37': '3.7.3', 'PYENV_ROOT': '/home/docs/.pyenv', 'DOCUTILSCONFIG': '/home/docs/checkouts/readthedocs.org/user_builds/streamsxtesting/checkouts/pypackage/docs/source/docutils.conf'}))

Register commandline options.

Implement this method for normal options behavior with protection from OptionConflictErrors. If you override this method and want the default –with-$name option to be registered, be sure to call super().

class streamsx.testing.nose.SkipStandalonePlugin

Skip standalone tests.

Automatically skips any tests that have been configured for standalone using Tester.setup_standalone().

Enabled with --with-streamsx-skip-standalone.

configure(options, conf)

Configure the plugin and system, based on selected options.

The base plugin class sets the plugin to enabled if the enable option for the plugin (self.enableOpt) is true.