Skip to content

Commit

Permalink
Add new tox env to run long hypothesis tests
Browse files Browse the repository at this point in the history
Revert .travis as long tests are going to be run
in Jenkins.
  • Loading branch information
aciba90 committed Jun 14, 2022
1 parent f61826b commit 4feedc2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ script:

env:
TOXENV=py3
PYTEST_ADDOPTS=-v
HYPOTHESIS_PROFILE=ci
PYTEST_ADDOPTS=-v # List all tests run by pytest

matrix:
fast_finish: true
Expand Down Expand Up @@ -129,8 +128,7 @@ matrix:
- python: 3.6
env:
TOXENV=lowest-supported
PYTEST_ADDOPTS=-v
HYPOTHESIS_PROFILE=ci
PYTEST_ADDOPTS=-v # List all tests run by pytest
dist: bionic
- python: 3.6
env: TOXENV=flake8
Expand Down
1 change: 1 addition & 0 deletions tests/unittests/config/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,7 @@ class TestSchemaFuzz:
# Avoid https://github.com/Zac-HD/hypothesis-jsonschema/issues/97
SCHEMA = JsonLocalResolver(get_schema()).resolve()

@pytest.mark.hypothesis_long
@skipUnlessHypothesisJsonSchema()
@given(from_schema(SCHEMA))
def test_validate_full_schema(self, config):
Expand Down
41 changes: 29 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
[tox]
envlist = py3, lowest-supported-dev, black, flake8, isort, mypy, pylint
envlist =
py3,
lowest-supported-dev,
hypothesis-long,
black,
flake8,
isort,
mypy,
pylint
recreate = True

[doc8]
Expand Down Expand Up @@ -97,8 +105,16 @@ deps =
-r{toxinidir}/test-requirements.txt
commands = {envpython} -m pytest \
--durations 10 \
{posargs:--cov=cloudinit --cov-branch --hypothesis-show-statistics \
tests/unittests}
-m "not hypothesis_long" \
{posargs:--cov=cloudinit --cov-branch tests/unittests}
passenv = HYPOTHESIS_PROFILE

[testenv:hypothesis-long]
deps =
-r{toxinidir}/test-requirements.txt
commands = {envpython} -m pytest \
-m hypothesis_long \
{posargs:--hypothesis-show-statistics tests/unittests}
passenv = HYPOTHESIS_PROFILE

[lowest-supported-deps]
Expand Down Expand Up @@ -229,25 +245,26 @@ addopts = --strict
log_format = %(asctime)s %(levelname)-9s %(name)s:%(filename)s:%(lineno)d %(message)s
log_date_format = %Y-%m-%d %H:%M:%S
markers =
allow_subp_for: allow subp usage for the given commands (disable_subp_usage)
adhoc: only run on adhoc basis, not in any CI environment (travis or jenkins)
allow_all_subp: allow all subp usage (disable_subp_usage)
allow_subp_for: allow subp usage for the given commands (disable_subp_usage)
azure: test will only run on Azure platform
ci: run this integration test as part of CI test runs
ds_sys_cfg: a sys_cfg dict to be used by datasource fixtures
ec2: test will only run on EC2 platform
gce: test will only run on GCE platform
azure: test will only run on Azure platform
oci: test will only run on OCI platform
openstack: test will only run on openstack platform
hypothesis_long: hypothesis test too long to run as unit test
instance_name: the name to be used for the test instance
is_iscsi: whether is an instance has iscsi net cfg or not
lxd_config_dict: set the config_dict passed on LXD instance creation
lxd_container: test will only run in LXD container
lxd_setup: specify callable to be called between init and start
lxd_use_exec: `execute` will use `lxc exec` instead of SSH
lxd_vm: test will only run in LXD VM
not_bionic: test cannot run on the bionic release
no_container: test cannot run in a container
user_data: the user data to be passed to the test instance
instance_name: the name to be used for the test instance
not_bionic: test cannot run on the bionic release
oci: test will only run on OCI platform
openstack: test will only run on openstack platform
ubuntu: this test should run on Ubuntu
unstable: skip this test because it is flakey
adhoc: only run on adhoc basis, not in any CI environment (travis or jenkins)
is_iscsi: whether is an instance has iscsi net cfg or not
user_data: the user data to be passed to the test instance

0 comments on commit 4feedc2

Please sign in to comment.