diff --git a/.travis.yml b/.travis.yml index fdc5ba3e..be054e65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,22 @@ +after_success: coveralls +env: + - CLOUD_SHELL_SHELL_CORE=1 + - CLOUD_SHELL_SHELL_CORE=2 +install: + - pip install -r external_requirements.txt + - pip install -r test_requirements.txt + - pip install "cloudshell-core>=2.0.0,<2.1.0" --extra-index-url https://testpypi.python.org/simple + - chmod 777 ./cloudshell_shell_core_install.sh + - ./cloudshell_shell_core_install.sh + - pip install "cloudshell-automation-api>=7.1.0.0,<7.2.0.0" --extra-index-url https://testpypi.python.org/simple language: python -python: - - "2.7" - -install: - - pip install -r external_requirements.txt - - pip install -r test_requirements.txt - - pip install "cloudshell-core>=2.0.0,<2.1.0" --extra-index-url https://testpypi.python.org/simple - - pip install "cloudshell-shell-core>=2.0.0,<2.1.0" --extra-index-url https://testpypi.python.org/simple - - pip install "cloudshell-automation-api>=7.1.0.0,<7.2.0.0" --extra-index-url https://testpypi.python.org/simple - -script: - - pushd package - - python setup.py develop - - popd - - python runtests.py --with-coverage --cover-package=package --exclude-dir=integration - -after_success: - coveralls - -notifications: - webhools: https://qualisystems.getbadges.io/api/app/webhook/63350e33-4119-49c3-8127-075aaa022926 +notifications: + webhools: "https://qualisystems.getbadges.io/api/app/webhook/63350e33-4119-49c3-8127-075aaa022926" +python: + - "2.7" +script: + - pushd package + - python setup.py develop + - popd + - chmod 777 ./run_static_or_vcenter_tests.sh + - ./run_static_or_vcenter_tests.sh diff --git a/cloudshell_shell_core_install.sh b/cloudshell_shell_core_install.sh new file mode 100644 index 00000000..5306784f --- /dev/null +++ b/cloudshell_shell_core_install.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [ "${CLOUD_SHELL_SHELL_CORE}" -eq 1 ] +then + pip install "cloudshell-shell-core>=2.0.0,<2.1.0" --extra-index-url https://testpypi.python.org/simple +else + pip install "cloudshell-shell-core>=2.4.0,<2.5.0" --extra-index-url https://testpypi.python.org/simple +fi \ No newline at end of file diff --git a/run_static_or_vcenter_tests.sh b/run_static_or_vcenter_tests.sh new file mode 100644 index 00000000..fe66be6a --- /dev/null +++ b/run_static_or_vcenter_tests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +if [ "${CLOUD_SHELL_SHELL_CORE}" -eq 1 ] +then + echo "Running vCenter Tests" + python runtests.py --with-coverage --cover-package=package --exclude-dir=integration +else + echo "Running static VM Tests" + python runtestsStaticVM.py --with-coverage --cover-package=package --exclude-dir=integration +fi \ No newline at end of file diff --git a/runtests.py b/runtests.py index 4603b582..6432b2cf 100644 --- a/runtests.py +++ b/runtests.py @@ -1,3 +1,4 @@ +import re import nose import nose.config import sys @@ -5,5 +6,13 @@ c = nose.config.Config() c.plugins=DefaultPluginManager() c.srcDirs = ['package'] + + +# c.ignoreFiles.append('vm_autoload_driver') +c.ignoreFiles.append(re.compile(r'^vm_autoload_driver\.py$')) +c.ignoreFiles.append(re.compile(r'^test_get_inventory\.py$')) +c.ignoreFiles.append(re.compile(r'^DeployAppOrchestrationDriver$')) + + if not nose.run(config=c): sys.exit(1) diff --git a/runtestsStaticVM.py b/runtestsStaticVM.py new file mode 100644 index 00000000..9622e219 --- /dev/null +++ b/runtestsStaticVM.py @@ -0,0 +1,9 @@ +import nose +import nose.config +import sys +from nose.plugins.manager import DefaultPluginManager +c = nose.config.Config() +c.plugins=DefaultPluginManager() +c.srcDirs = ['static_vm_package'] +if not nose.run(config=c): + sys.exit(1) diff --git a/static_vm_package/VCenterAutoloadStaticVMDriver/tests/test_get_inventory b/static_vm_package/VCenterAutoloadStaticVMDriver/tests/test_get_inventory.py similarity index 99% rename from static_vm_package/VCenterAutoloadStaticVMDriver/tests/test_get_inventory rename to static_vm_package/VCenterAutoloadStaticVMDriver/tests/test_get_inventory.py index 696af038..9b10b8a4 100644 --- a/static_vm_package/VCenterAutoloadStaticVMDriver/tests/test_get_inventory +++ b/static_vm_package/VCenterAutoloadStaticVMDriver/tests/test_get_inventory.py @@ -45,6 +45,8 @@ def test_get_inventory(self): self.assertTrue(self.deploy_app_orchestration_driver._try_get_ip.called) self.assertTrue(self.deploy_app_orchestration_driver._get_vm_details.called) self.assertTrue(self.deploy_app_orchestration_driver.pv_service.find_vm_by_name.called) + + def test_get_vm_details(self): vm_details = self.deploy_app_orchestration_driver._get_vm_details(uuid="Piplup", @@ -56,3 +58,4 @@ def test_get_vm_details(self): + diff --git a/vCenterShell_specs/vcenter_app_discovery.ini b/vCenterShell_specs/vcenter_app_discovery.ini new file mode 100644 index 00000000..32c22d94 --- /dev/null +++ b/vCenterShell_specs/vcenter_app_discovery.ini @@ -0,0 +1,6 @@ +[Packaging] +is_driver: True +driver_folder: static_vm_autoload_driver +include_dirs: +target_name: VCenter Static VM Autoload +target_dir: Resource Drivers - Python \ No newline at end of file