summaryrefslogtreecommitdiff
path: root/tox.ini
Commit message (Collapse)AuthorAgeFilesLines
* ci: add hypothesis scheduled GH check (#2149)Alberto Contreras2023-05-081-0/+1
|
* tox.ini: set -vvvv --showlocals for pytest (#2104)Chris Patterson2023-04-111-0/+1
| | | | | | | | | | Test failures may have truncated assertions using `...` in some output. Increase verbosity and print locals to help with triaging failures caught in CI, particularly as some environments may not be readily testable locally. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
* integration tests: Refactor instance checking (#1989)James Falcon2023-03-271-11/+0
| | | | | | Using individual release and platform marks to specify our test support matrix was leading to too many marks specifying different combinations of things. Rather, we can rely on the "skipif" mark to perform any needed release or platform checks.
* integration tests: add IBM VPC support (SC-1352) (#1915)Alberto Contreras2023-01-181-0/+1
|
* test: mock dns calls (#1922)Brett Holman2023-01-031-0/+1
| | | | | Add fixture to disallow dns lookups by default in a common utility function.
* Auto-format schema (#1810)Brett Holman2022-11-101-0/+6
| | | Add schema auto-format to tox and a CI test
* tests: Drop httpretty in favor of responses (#1720)Alberto Contreras2022-09-191-21/+2
|
* Fix check_format_tip (#1679)Alberto Contreras2022-08-221-0/+3
|
* test: Collect integration test time by default (#1638)Brett Holman2022-08-121-1/+4
|
* tox: Fix tip-flake8 and tip-mypy (#1635)Alberto Contreras2022-08-101-0/+2
|
* testing: add support for pycloudlib's pro images (#1604)Alberto Contreras2022-08-021-0/+1
| | | | | | Added new pytest marker to define IntegrationCloud customizations. Migrate test_lp1835584 to use this functionality. Bump pycloudlib version.
* meta-schema: add infra to skip inapplicable modulesAlberto Contreras2022-07-201-0/+3
| | | | | | | | Add new `activate_by_schema_keys` property to `MetaSchema` defining the schema keys that must be present, to avoid skipping the module. Add this new key to our schema docs. Add documentation to `topics/module_creation`. Import TypedDict from typing_extensions TypedDict and gate it within TYPE_CHECKING to avoid runtime import concerns.
* Resource leak cleanup (#1556)Brett Holman2022-07-131-0/+9
| | | Add tox target for tracing for resource leaks, fix some leaks
* tox: Remove entries from default envlist (#1578)James Falcon2022-07-111-2/+0
| | | | | | | | | lowest-supported-dev requires running with python 3.6, which few people will be running locally. hypothesis-slow is being removed because fuzz testing shouldn't be a gate for new features. LP: #1980854
* Enable pytest to run in parallel (#1568)Brett Holman2022-07-111-0/+9
| | | | | - add a tox target for running unit tests in parallel - add missing mocks - make parametrized gzip bytes deterministic
* Fuzz testing jsonchema (#1499)Alberto Contreras2022-07-061-13/+37
| | | | | | | - Add `hypothesis` and `hypothesis-jsonschema` - Add `hypothesis-slow` tox env to run slow tests - Implement `JsonLocalResolver` to avoid `hypothesis-jsonschema` errors - Add fuzz test covering `validate_cloudconfig_schema`
* tox: add unpinned env for do_format and check_format (#1554)Brett Holman2022-06-301-0/+25
| | | Add make helpers to do and check fmt
* CI: add non-blocking run against the linters tip versions (#1531)Paride Legovini2022-06-271-4/+12
| | | | | | | | | | Changes: * Tox: the tip-black and tip-isort environments. * Tox: reuse the non-tip commands in the tip- environments. * Add non-blocking (continue-on-error: true) step in the test test matrix to run the tip- linters on ubuntu-latest. * Code fixups to make tip-pylint pass. * Bump the pinned pylint version to 2.13.9 (last version supporting Python 3.6).
* tox: integration-tests-jenkins: softfail if only some test failed (#1528)Paride Legovini2022-06-171-1/+4
| | | | | | | | | | | | | | | Prior to this change a single test failure when running the integration-tests-jenkins tox environment caused Jenkins jobs to fully fail (status FAILURE). With this change the pytest's "some tests failed" return code [1] is ignored, and the status of the Jenkins jobs is determined using the junit report that pytest generates. Most of the time this will result in UNSTABLE (yellow) jobs when some tests failed. If the junit report is missing (or only reports failures) the job will still be marked as FAILURE (red). [1] https://docs.pytest.org/en/7.1.x/reference/exit-codes.html
* Oracle ds changes (#1474)Alberto Contreras2022-06-081-0/+1
| | | | | | | | | | | | | | | For primary network config: - Use `iSCSI` config if some `/run/net*` file exists, even if `/run/initramfs/open-iscsi.interface` does not. - If the instance is not an `iSCSI` one, then crawl the network config from `IMDS` instead of falling back to "best guess". - Remove unnecessary conditional use of dhcp.EphemeralDHCPv4 and use it always to crawl `IMDS`. - Migrate tests to pytest. - Extend unit test coverage. - Add some types for mypy. LP: #1967942
* tox: add link checker environment, fix links (#1480)Brett Holman2022-06-031-0/+13
|
* docs: fix external links, add one more to the list (#1477)Brett Holman2022-05-261-0/+3
|
* Update linters and adapt code for compatibility (#1434)Paride Legovini2022-05-051-4/+4
| | | | | | | Changes: - pylint 2.13.8: fix E0601(used-before-assignment) - pylint 2.13.8: fix E4702(modified-iterating-dict) - pylint 2.13.8: silence W0402(deprecated-module) on distutils.errors - tox: bump linters versions
* docs: Fix doc warnings and enable errors (#1419)Alberto Contreras2022-04-291-1/+1
| | | | | | | - Remove Sphinx build warnings - Turn Sphinx warnings into errors LP: #1876341 SC-894
* Allow growpart to resize encrypted partitions (#1316)James Falcon2022-04-261-0/+1
| | | | | | | | | | Adds the ability for growpart to resize a LUKS formatted partition. This involves resizing the underlying partition as well as the filesystem. 'cryptsetup' is used for resizing. This relies on a file present at /cc_growpart_keydata containing json formatted 'key' and 'slot' keys, with the key being base64 encoded. After resize, cloud-init will destroy the luks slot used for resizing and remove the key file.
* Add support for dual stack IPv6/IPv4 IMDS to Ec2 (#1160)Brett Holman2022-04-141-0/+1
| | | | | | | | | - add support for parallel http(s) requests to wait_for_url() - implementation based loosely on RFC6555: "Happy Eyeballs" [1] - update ec2 datasource to support dual-stack ipv6/ipv4 - only "nitro" instances have ipv6 IMDS, favor ipv4 initially - replace httpretty with responses for ec2 tests [1] https://datatracker.ietf.org/doc/html/rfc6555
* Mypy stubs and other tox maintenance (SC-920) (#1374)Brett Holman2022-04-121-6/+14
| | | | | | | | - add type stubs for mypy: jsonschema, oauthlib - specify mypy directories to avoid env/ false positive - add conftest.py and setup.py - make setup.py pass pylint: - check ./tools/render-cloudcfg return code in setup.py - find_sources() has no return code, don't check for one
* tox: add types-* packages to check_format env (#1362)James Falcon2022-04-011-0/+3
|
* black: bump pinned version to 22.3.0 to avoid click dependency issues (#1357)Chad Smith2022-03-291-1/+1
| | | | | | | | | | | Black < 22.3.0 didn't handle a dropped internal attribute _unicodefun from in more click package version 8.1.0. Due to issue Issue: https://github.com/psf/black/issues/2964 This broke our CI and tox -e do_format targets with cannot import name '_unicodefun' from 'click'. Increment our pinned black to 22.3.0 and apply minor format change rules.
* tox: set verbose flags for integration tests (#1323)Chris Patterson2022-03-111-1/+1
| | | Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
* mypy: introduce type checking (#1254)Chris Patterson2022-02-141-6/+32
| | | | | | | | | | | All currently failing modules are excluded from reporting errors using follow-imports=silent and an exclusion list. Future work can whittle down this failing list. This change will start enforcing new modules and those currently passing. Includes some minor alphabetical reordering in tox.ini. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
* Integration testing docs and refactor (#1231)James Falcon2022-02-021-3/+0
| | | | | | * Include CI and Fixtures sections in integration test docs * Incorporate additional variable annotations * Remove unnecessary IntegrationInstance subclasses * Move setup_image teardown into its fixture
* fix parallel tox execution (#1214)Brett Holman2022-01-311-20/+33
|
* tox: pass PYCLOUDLIB_* env vars into integration tests when present (#1196)Chad Smith2022-01-181-2/+2
|
* Remove 3.5 and xenial support (SC-711) (#1167)James Falcon2022-01-101-113/+77
| | | | | | | | | | | | Includes: - Update tox.ini and .travis.yml accordingly - Cleanup tox.ini with new tox syntax and cloud-init dependencies - Update documentation accordingly - Replace/remove xenial references where additional testing isn't required - Remove xenial checks in integration tests - Replace yield_fixture with fixture in pytest tests Sections of code commented with lines like "Remove when Xenial is no longer supported" still exist as they're require additional testing.
* Adopt Black and isort (SC-700) (#1157)James Falcon2021-12-151-4/+24
| | | | | Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
* Reorganize unit test locations under tests/unittests (#1126)Brett Holman2021-12-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attempts to standardize unit test file location under test/unittests/ such that any source file located at cloudinit/path/to/file.py may have a corresponding unit test file at test/unittests/path/to/test_file.py. Noteworthy Comments: ==================== Four different duplicate test files existed: test_{gpg,util,cc_mounts,cc_resolv_conf}.py Each of these duplicate file pairs has been merged together. This is a break in git history for these files. The test suite appears to have a dependency on test order. Changing test order causes some tests to fail. This should be rectified, but for now some tests have been modified in tests/unittests/config/test_set_passwords.py. A helper class name starts with "Test" which causes pytest to try executing it as a test case, which then throws warnings "due to Class having __init__()". Silence by changing the name of the class. # helpers.py is imported in many test files, import paths change cloudinit/tests/helpers.py -> tests/unittests/helpers.py # Move directories: cloudinit/distros/tests -> tests/unittests/distros cloudinit/cmd/devel/tests -> tests/unittests/cmd/devel cloudinit/cmd/tests -> tests/unittests/cmd/ cloudinit/sources/helpers/tests -> tests/unittests/sources/helpers cloudinit/sources/tests -> tests/unittests/sources cloudinit/net/tests -> tests/unittests/net cloudinit/config/tests -> tests/unittests/config cloudinit/analyze/tests/ -> tests/unittests/analyze/ # Standardize tests already in tests/unittests/ test_datasource -> sources test_distros -> distros test_vmware -> sources/vmware test_handler -> config # this contains cloudconfig module tests test_runs -> runs
* Remove pin in dependencies for jsonschema (#1078)James Falcon2021-10-221-1/+1
| | | | | | In jsonschema 4, hostname validation was changed to have an optional dependency on the fqdn package. Since we don't have this dependency in cloud-init, attempting this validation will no longer fail for a string that isn't a valid hostname.
* tox integration: pass the *_proxy, GOOGLE_*, GCP_* env vars (#1050)Paride Legovini2021-10-071-1/+1
| | | | | | *_proxy: required for https_proxy and no_proxy GOOGLE_* and GCP_*: see [1]. https://cloud.google.com/functions/docs/configuring/env-var#runtime_environment_variables_set_automatically
* pin jsonschema in requirements.txt (#1043)James Falcon2021-09-301-0/+1
| | | | On unit tests, tox is attempting to install 4.0, which fails two of the unit tests, and fails python 3.5 as it is not compatible.
* testing: remove cloud_tests (#1020)James Falcon2021-09-291-9/+2
| | | Cloud tests have been replaced with integration tests
* tox: bump the pinned flake8 and pylint version (#1029)Paride Legovini2021-09-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tox: bump the pinned flake8 and pylint version * pylint: fix W1406 (redundant-u-string-prefix) The u prefix for strings is no longer necessary in Python >=3.0. * pylint: disable W1514 (unspecified-encoding) From https://www.python.org/dev/peps/pep-0597/ (Python 3.10): The new warning stems form https://www.python.org/dev/peps/pep-0597, which says: Developers using macOS or Linux may forget that the default encoding is not always UTF-8. [...] Even Python experts may assume that the default encoding is UTF-8. This creates bugs that only happen on Windows. The warning could be fixed by always specifying encoding='utf-8', however we should be careful to not break environments which are not utf-8 (or explicitly state that only utf-8 is supported). Let's silence the warning for now. * _quick_read_instance_id: cover the case where load_yaml() returns None Spotted by pylint: - E1135 (unsupported-membership-test) - E1136 (unsubscriptable-object) LP: #1944414
* Fix `make style-check` errors (#1000)Shreenidhi Shedi2021-09-011-2/+2
| | | | | | | | | | | | | | Using flake8 inplace of pyflakes Renamed run-pyflakes -> run-flake8 Changed target name to flake8 in Makefile With pyflakes we can't suppress warnings/errors in few required places. flake8 is flexible in that regard. Hence using flake8 seems to be a better choice here. flake8 does the job of pep8 anyway. So, removed pep8 target from Makefile along with tools/run-pep8 script. Included setup.py in flake8 checks
* Update pylint to v2.9.3 and fix the new issues it spots (#946)Paride Legovini2021-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | In CI run against pylint 2.9.3 and fix occurrences of: - W0237 (arguments-renamed) - W0402 (deprecated-module) The W0402 deprecated-module was about module `imp`: cloudinit/patcher.py:9: [W0402(deprecated-module), ] Uses of a deprecated module 'imp' The imp module is deprecated and replaced by importlib, which according to the documentation has no replacement for acquire_lock() and release_lock(), which are the only reason why `imp` is imported. Nothing about the code using this lock that actually requires it. Let's remove the locking code and the import altogether. Dropping the locking makes patcher.patch() an empty wrapper around _patch_logging(). Rename _patch_logging() to patch_logging() and call it directly instead. Drop patch().
* tests: Add 'adhoc' mark for integration tests (#925)James Falcon2021-06-171-1/+10
| | | Also new jenkins tox definition
* Add integration test for lp-1920939 (#891)James Falcon2021-05-141-0/+1
| | | | | | | In #856 we added the ability to use partprobe instead of blockdev for reading partitions. Test that partprobe succeeds where blockdev fails. Also add a mechanism to our integration tests to allow a callable to be called between `lxc init` and `lxc start`
* Allow user control over update events (#834)James Falcon2021-05-131-1/+1
| | | | | | | | | | | | | | | | | | | Control is currently limited to boot events, though this should allow us to more easily incorporate HOTPLUG support. Disabling 'instance-first-boot' is not supported as we apply networking config too early in boot to have processed userdata (along with the fact that this would be a pretty big foot-gun). The concept of update events on datasource has been split into supported update events and default update events. Defaults will be used if there is no user-defined update events, but user-defined events won't be supplied if they aren't supported. When applying the networking config, we now check to see if the event is supported by the datasource as well as if it is enabled. Configuration looks like: updates: network: when: ['boot']
* Emit dots on travis to avoid timeout (#867)James Falcon2021-04-151-1/+1
| | | | | | | The current method of running a background sleep until travis is finished is causing integration test runs to pass even when they should be failing. Instead, update the code to emit dots itself.
* Fix apt default integration test (#845)James Falcon2021-03-191-0/+1
| | | | | | | | | | The apt default test wasn't ported over from cloud-tests correctly. uri should be specified in the test, but it was not, so the test failed on openstack (and likely other platforms) because without a specified uri, the default uri will vary by platform. I separated this uri test out into a separate test function. Also add openstack specific test for apt configuration with no uri. Other platform-specific tests should be added here over time.
* tox.ini: pass OS_* environment variables to integration tests (#830)Daniel Watkins2021-03-031-2/+2
| | | This allows source'd OpenStack credentials to be used for tox tests.