summaryrefslogtreecommitdiff
path: root/tox.ini
AgeCommit message (Collapse)Author
2020-12-09integration_tests: include timestamp in log output (#720)Daniel Watkins
2020-12-09integration_tests: add test for LP: #1898997 (#713)Daniel Watkins
integration_tests: add test for LP: #1898997 This introduces the `lxd_config_dict` mark, used to specify a free-form configuration dict to LXD for tests which only run there; and the `not_xenial` and `not_bionic` marks, used to skip tests on xenial/bionic via a basic release skipping mechanism. This also bumps the pycloudlib commit we depend upon, as the latest commit includes the changes required for LXD network config to work. (The `lxd_config_dict` change further complicated `_client`, so a minor refactoring is applied.)
2020-12-09Add integration test for power_state_change module (#717)James Falcon
Also introduce the `unstable` mark, to allow us to land tests which run inconsistently (such as this one).
2020-12-03integration_tests: introduce skipping of tests by OS (#702)Daniel Watkins
This introduces an optional, more complex OS_IMAGE format (`<image id>::<os>::<release>`) which allows the specification of the OS/OS release which the given image ID corresponds to. This information is used to skip tests which do not apply to the image. This commit is comprised of the following discrete changes: * introduce the IntegrationImage class, to handle parsing and storing the new OS_IMAGE format * support inferring the OS and OS release of Ubuntu series, so that we can continue to set OS_IMAGE to just a series name and have test skipping work * add documentation on Image Selection to integration_tests.rst * introduce the actual skipping behaviour based on OS marks * apply the `ubuntu` mark to all tests that should be skipped on non-Ubuntu operating systems
2020-11-24tox: avoid tox testenv subsvars for xenial support (#684)Chad Smith
Xenial tox 2.3.1 still suffers from https://github.com/tox-dev/tox/issues/208. As a result we cannot use testenv substvars if we want to support running tox on xenial systems. Drop the {[testenv:integration-tests]*} substitutions to avoid tracebacks when running `tox -e xenial-dev` which has the signature: "No support for the %s substitution type" % sub_type) tox.ConfigError: ConfigError: No support for the posargs substitution type
2020-11-23LXD VM support in integration tests (#678)James Falcon
2020-11-23Integration test for fallocate falling back to dd (#681)James Falcon
See #585
2020-11-20add integration test for LP: #1900837 (#679)Daniel Watkins
As the first test of this SRU cycle, this also introduces the sru_2020_11 mark to allow us to easily identify the set of tests generated for this SRU.
2020-11-18tox.ini: only select "ci" marked tests for CI runs (#677)Daniel Watkins
`-k` will select tests or marks whose names match. `-m` selects only tests which have the specified mark, so is more appropriate.
2020-11-18only run a subset of integration tests in CI (#672)Daniel Watkins
This introduces the "ci" mark, used to indicate a test which should run as part of our CI integration testing run and the integration-tests-ci tox environment, which runs only those tests. Travis has been adjusted to use this tox environment. (All current module tests have been marked with the "ci" mark, but the one bug test that we have has not.)
2020-11-10split integration and cloud_tests requirements (#652)Daniel Watkins
The cloud_tests and the integration_tests (via pycloudlib) have conflicting requirements. This commit splits up their requirements files, so we can accurately express the requirements for each.
2020-11-02integration_tests: various launch improvements (#638)Daniel Watkins
* integration_tests: fix passing launch_kwargs to session_cloud.launch * integration_tests: log the launch_kwargs before launching instances * integration_tests: add support for specifying instance name for tests Co-authored-by: Rick Harding <rharding@mitechie.com>
2020-10-06conftest.py: remove top-level import of httpretty (#599)Daniel Watkins
This means that the integration tests do not need to install test-requirements.txt in order to successfully import `conftest.py`.
2020-10-05tox.ini: add integration-tests testenv definition (#595)Daniel Watkins
2020-10-01Initial implementation of integration testing infrastructure (#581)James Falcon
2020-08-25tox: bump the pylint version to 2.6.0 in the default run (#544)Paride Legovini
Changes: tox: bump the pylint version to 2.6.0 in the default run Fix pylint 2.6.0 W0707 warnings (raise-missing-from)
2020-08-13tox.ini: pin correct version of httpretty in xenial{,-dev} envs (#531)Daniel Watkins
The version was bumped in c7248059dd2faaaadfbcef5c83e8e8ea166d6767 to support running on Python 3.7+ systems. Now that we have separate `xenial` and `xenial-dev` tox environments, we can restore the correct pinning for `xenial` without breaking `xenial-dev` on developer machines. Also drop the `mock` dependency from `xenial-shared-deps`; its removal was missed in 5f8f85bb38cc972d3d2c705a1ec73db3f690f323.
2020-08-10DataSourceOracle: refactor to use only OPC v1 endpoint (#493)Daniel Watkins
The /opc/v1/ metadata endpoints[0] are universally available in Oracle Cloud Infrastructure and the OpenStack endpoints are considered deprecated, so we can refactor the data source to use the OPC endpoints exclusively. This simplifies the datasource code substantially, and enables use of OPC-specific attributes in future. [0] https://docs.cloud.oracle.com/en-us/iaas/Content/Compute/Tasks/gettingmetadata.htm
2020-07-06cloudinit: fix tip-pylint failures and bump pinned pylint version (#478)Daniel Watkins
Specifically: * disable E1102 in cloudinit/sources/helpers/openstack.py for reasons described in a comment, and * refactor `abs_join` to require at least one positional argument; this matches os.path.join's signature, and that mismatch is what was causing pylint to emit a warning * bump to pylint 2.4.2
2020-07-02tests: use markers to configure disable_subp_usage (#473)Daniel Watkins
This is an improvement over indirect parameterisation for a few reasons: * The test code is much easier to read, the mark names are much more intuitive than the indirect parameterisation invocation, and there's less boilerplate to boot * The fixture no longer has to overload the single parameter that fixtures can take with multiple meanings
2020-06-30Enable use of the caplog fixture in pytest tests, and add a cc_final_message ↵Daniel Watkins
test using it (#461) caplog is only available in pytest itself from 3.0 onwards. In xenial, we only have pytest 2.8.7. However, in xenial we do have pytest-catchlog available (as python3-pytest-catchlog), so we use that where appropriate.
2020-06-10test: fix all flake8 E126 errors (#425)Joshua Powers
2020-06-02test: fix all flake8 E121 and E123 errors (#404)Joshua Powers
This fixes issues with closing brackets not matching the opening bracket's line and continuation line under-idented for hanging indent.
2020-06-02test: fix all flake8 E241 (#403)Joshua Powers
Remove extra spaces after a ','
2020-06-02test: ignore flake8 E402 errors in main.py (#402)Joshua Powers
This puts an ignore on the imports not at the top of the file errors. The reason for the ignore instead of fix is that the file is using imp to grab a lock and patch logging before further imports are completed.
2020-06-01test: fix all flake8 E741 errors (#401)Joshua Powers
This removes the use of variables named ‘l’, ‘O’, or ‘I’. Generally these are used in list comprehension to read the line of lines.
2020-05-27testing: use flake8 again (#392)Joshua Powers
Instead of running pycodestyle and pyflakes seperately, use flake8 to get the benefits of pyflakes and also stylistic checks as well as the ability to configure the settings for the project.
2020-05-14cloud_tests: emit dots on Travis while fetching images (#347)Daniel Watkins
This ensures that Travis will not kill our tests if fetching images is taking a long time. In implementation terms, this introduces a context manager which will spin up a multiprocessing.Process in the background and print a dot to stdout every 10 seconds. The process is terminated when the context manager exits. This also drop the use of travis_wait, which was being used to work around this issue.
2020-04-24cloudinit: drop dependencies on unittest2 and contextlib2 (#322)Daniel Watkins
These libraries provide backports of Python 3's stdlib components to Python 2. As we only support Python 3, we can simply use the stdlib now. This pull request does the following: * removes some unneeded compatibility code for the old spelling of `assertRaisesRegex` * replaces invocations of the Python 2-only `assertItemsEqual` with its new name, `assertCountEqual` * replaces all usage of `unittest2` with `unittest` * replaces all usage of `contextlib2` with `contextlib` * drops `unittest2` and `contextlib2` from requirements files and tox.ini It also rewrites some `test_azure` helpers to use bare asserts. We were seeing a strange error in xenial builds of this branch which appear to be stemming from the AssertionError that pytest produces being _different_ from the standard AssertionError. This means that the modified helpers weren't behaving correctly, because they weren't catching AssertionErrors as one would expect. (I believe this is related, in some way, to https://github.com/pytest-dev/pytest/issues/645, but the only version of pytest where we're affected is so far in the past that it's not worth pursuing it any further as we have a workaround.)
2020-03-17cloudinit: remove six from packaging/tooling (#253)Daniel Watkins
2020-03-11tox.ini: avoid substition syntax that causes a traceback on xenial (#245)Daniel Watkins
See the added comment for details.
2020-03-10tox.ini: use xenial version of jsonpatch in CI (#242)Daniel Watkins
Now that we can distinguish between CI xenial dependencies and needed-to-run-on-dev-machine xenial depedencies, we can return to testing with the correct jsonpatch version.
2020-03-10tox.ini: bump pyflakes version to 2.1.1 (#239)Daniel Watkins
pyflakes versions older than 2.1.0 are incompatible with Python 3.8 (which is the Python version in the current Ubuntu development release). See https://github.com/PyCQA/pyflakes/issues/367 for details. 2.1.1 is the latest version ATM, so bump to that.
2020-03-10cloudinit: move to pytest for running tests (#211)Daniel Watkins
As the nose docs[0] themselves note, it has been in maintenance mode for the past several years. pytest is an actively developed, featureful and popular alternative that the nose docs themselves recommend. See [1] for more details about the thinking here. (This PR also removes stale tox definitions, instead of modifying them.) [0] https://nose.readthedocs.io/en/latest/ [1] https://lists.launchpad.net/cloud-init/msg00245.html
2019-12-20ci: remove Python 2.7 from CI runs (#137)Daniel Watkins
Specifically, drop it from the default list of environments that tox will run, and from Travis. (We retain the configuration in tox.ini for now, for any remaining Python 2.7 needs.)
2019-12-18ci: emit names of tests run in Travis (#120)Daniel Watkins
This makes it easier to debug differences in test behaviour between Travis and local developer environments.
2019-12-06docs: Add security.md to readthedocsJoshua Powers
* docs: Add security.md to readthedocs This enables the ability to show the security policy on both GitHub and on the readthedocs site. To do this, enable the ability to import Markdown based files and translate them to rst. * Add doc-requirements.txt and update tox to use Also removes the extra, uncessary extension addition of .md
2019-11-26cloud_tests: add azure platform support to integration testsahosmanmsft
Added Azure to cloud tests supporting upstream integration testing. Implement the inherited platform classes, Azure configurations to release/platform, and docs on how to run Azure CI.
2019-09-07doc: document doc, create makefile and tox targetJoshua Powers
* Create makefile and tox targets for documentation building and testing to better replicate the live web docs using the same theme. * Created docs.rst to explain how to build and contribute to documentation with style guide and tips. * doc/rtd/conf.py:     * Add copyright to rtd config     * Use Sphinx's RTD theme to replicate actual docs
2019-03-21tox: Update testenv for openSUSE Leap to 15.0Thomas Bechtold
Use the requirements for the openSUSE Leap 15.0 release.
2019-03-18tox: bump pylint version to latest (2.3.1)Daniel Watkins
The previous version was emitting errors due to an incompatibility with one of its dependencies. (We could have pinned the dependency instead, but staying current on pylint is a worthy goal in and of itself.)
2019-01-25tox: fix disco httpretty dependencies for py37Chad Smith
LP: #1813361
2018-12-14Update to pylint 2.2.2.Scott Moser
The tip-pylint tox target correctly reported the invalid use of string formatting. The change here is to: a.) Fix the error that was caught. b.) move to pylint 2.2.2 for the default 'pylint' target.
2018-06-08tests: remove pip install workarounds for pylxd, take upstream fix.Scott Moser
pylxd upstream provided a fix for the issue we were seeing, so we can take that fix now rather than having our workarounds to order pip installs. The test is that this continues to work: rm -Rf .tox/citest tox -c tox.ini --recreate --notest -e citest
2018-06-07tests: ordered tox dependencies for pylxd installChad Smith
The pylxd project has a setup.py which defines install dependencies. Those sub-dependendencies include pbr and requests which in turn have package version conflicts. Since tox doesn't order dependencies installed, serially install pinned urllib3 at 1.22 which supports both pbr deps and requests deps of pylxd.
2018-05-04pycodestyle: Fix deprecated string literals, move away from flake8.Chad Smith
Fix remaining pycodesytle warnings related to invalid string literals introduced in more recent pycodeflakes versions https://bugs.python.org/issue27364 . Also stop using flake8 in tox as it is incompatible with newer versions of pyflakes. Instead we now add tox environments for pycodestyle and pyflakes individually. Set the versions in both pycodestyle and pyflakes to the currently available versions.
2018-03-23tests: remove jsonschema from xenial tox environment.Scott Moser
Ubuntu 16.04 (xenial) does not have jsonschema installed by default. As it is listed in requirements, the tox environment will always have it installed. Add the helper tools/pipremove that removes pip packages. Then use that to remove jsonschema without noise of always running and ignoring a 'pip uninstall jsonschema'.
2018-02-12tests: run nosetests in cloudinit/ directory, fix py26 fallout.Scott Moser
When we moved some tests to live under cloudinit/ we inadvertantly failed to change all things that would run nose to include that directory. This changes all the 'nose' invocations to consistently run with tests/unittests and cloudinit/. Also, it works around, more correctly this time, a python2.6-ism with the following code: with assertRaises(SystemExit) as cm: sys.exit(2)
2018-01-10tests: add integration requirements text fileJoshua Powers
This adds the specific requirements for integration testing to a single file that can be referenced in other areas. It also enables the read-dependencies script to install those packages.
2018-01-05tests: Enable AWS EC2 Integration TestingJoshua Powers
This enables integration tests to utilize AWS EC2 as a testing platform by utilizing the boto3 Python library. Usage will create and delete a custom VPC for every run. All resources will be tagged with the ec2 tag, 'cii', and the date (e.g. cii-20171220-102452). The VPC is setup with both IPv4 and IPv6 capabilities, but will only hand out IPv4 addresses by default. Instances will have complete Internet access and have full ingress and egress access (i.e. no firewall). SSH keys are generated with each run of the integration tests with the key getting uploaded to AWS at the start of tests and deleted on exit. To enable creation when the platform is setup the SSH generation code is moved to be completed by the platform setup and not during image setup. The nocloud-kvm platform was updated with this change. Creating a custom image will utilize the same clean script, boot_clean_script, that the LXD platform uses as well. The custom AMI is generated, used, and de-registered after a test run. The default instance type is set to t2.micro. This is one of the smallest instance types and is free tier eligible. The default timeout for ec2 was increased to 300 from 120 as many tests hit up against the 2 minute timeout and depending on region load can go over. Documentation for the AWS platform was added with the expected configuration files for the platform to be used. There are some additional whitespace changes included as well. pylint exception was added for paramiko and simplestreams. In the past these were not already flagged due to no __init__.py in the subdirectories of files that used these. boto3 was added to the list of dependencies in the tox ci-test runner. In order to grab console logs on EC2 the harness will now shut down an instance before terminating and before collecting the console log. This is to address a behavior of EC2 where the console log is refreshed very infrequently, but one point when it is refreshed is after shutdown.