From 77307e3bbf54c3b70b31493b34b95e2d7382849b Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Thu, 3 Mar 2016 23:56:27 +0100 Subject: [PATCH] Add first integration test This takes all the manifests and does a dry-run on them. The plan is to later on enable testing of partial plugin examples as well. --- tests/integration/__init__.py | 0 tests/integration/dry_run_tests.py | 26 ++++++++++++++++++++++++++ tox.ini | 6 ++++++ 3 files changed, 32 insertions(+) create mode 100644 tests/integration/__init__.py create mode 100644 tests/integration/dry_run_tests.py diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/dry_run_tests.py b/tests/integration/dry_run_tests.py new file mode 100644 index 0000000..14fbbf7 --- /dev/null +++ b/tests/integration/dry_run_tests.py @@ -0,0 +1,26 @@ + + +def test_manifest_generator(): + """ + manifests_tests - test_manifest_generator. + + Loops through the manifests directory and tests that + each file can successfully be loaded and validated. + """ + + from bootstrapvz.base.manifest import Manifest + from bootstrapvz.base.main import run + + def dry_run(path): + manifest = Manifest(path=path) + run(manifest, dry_run=True) + + import os.path + from .. import recursive_glob + from itertools import chain + manifests = os.path.join(os.path.dirname(os.path.realpath(__file__)), + '../../manifests') + manifest_paths = chain(recursive_glob(manifests, '*.yml'), recursive_glob(manifests, '*.json')) + for manifest_path in manifest_paths: + dry_run.description = "Dry-running %s" % os.path.relpath(manifest_path, manifests) + yield dry_run, manifest_path diff --git a/tox.ini b/tox.ini index 93d70ba..9eaeb5d 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,12 @@ deps = nose-cov commands = nosetests --with-coverage --cover-package=bootstrapvz --cover-inclusive --verbose {posargs:tests/unit} +[testenv:integration] +deps = + nose + nose-cov +commands = nosetests --with-coverage --cover-package=bootstrapvz --cover-inclusive --verbose {posargs:tests/integration} + [testenv:system] deps = nose