Skip to content

Commit

Permalink
Add a cloud nox session for both runtests and pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Apr 18, 2019
1 parent 16ac5ea commit c83eb4d
Show file tree
Hide file tree
Showing 7 changed files with 606 additions and 12 deletions.
56 changes: 44 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
alias: compile-linux-py2.7-tcp-requirements
name: Linux Py2.7 TCP Requirements
files: ^requirements/((base|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(lint|cloud|docs|osx|windows|)\.in$
args:
- -v
- --py-version=2.7
Expand Down Expand Up @@ -41,7 +41,7 @@ repos:
alias: compile-linux-py2.7-zmq-requirements
name: Linux Py2.7 ZeroMQ Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=2.7
Expand Down Expand Up @@ -81,7 +81,7 @@ repos:
alias: compile-linux-py2.7-raet-requirements
name: Linux Py2.7 RAET Requirements
files: ^requirements/((base|raet|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=2.7
Expand Down Expand Up @@ -136,12 +136,20 @@ repos:
- --py-version=2.7
- --platform=linux

- id: pip-tools-compile
alias: compile-cloud-py2.7-requirements
name: Cloud Py2.7 Requirements
files: ^requirements/(static/cloud\.in)$
args:
- -v
- --py-version=2.7


- id: pip-tools-compile
alias: compile-linux-py3.4-tcp-requirements
name: Linux Py3.4 TCP Requirements
files: ^requirements/((base|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.4
Expand All @@ -153,7 +161,7 @@ repos:
alias: compile-linux-py3.4-zmq-requirements
name: Linux Py3.4 ZeroMQ Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.4
Expand All @@ -167,7 +175,7 @@ repos:
alias: compile-linux-py3.4-raet-requirements
name: Linux Py3.4 RAET Requirements
files: ^requirements/((base|raet|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.4
Expand All @@ -179,11 +187,19 @@ repos:
- --remove-line=^pycrypto==(.*)$
- --remove-line=^enum34==(.*)$

- id: pip-tools-compile
alias: compile-cloud-py3.4-requirements
name: Cloud Py3.4 Requirements
files: ^requirements/(static/cloud\.in)$
args:
- -v
- --py-version=3.4

- id: pip-tools-compile
alias: compile-linux-py3.5-tcp-requirements
name: Linux Py3.5 TCP Requirements
files: ^requirements/((base|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.5
Expand Down Expand Up @@ -217,7 +233,7 @@ repos:
alias: compile-linux-py3.5-zmq-requirements
name: Linux Py3.5 ZeroMQ Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.5
Expand Down Expand Up @@ -257,7 +273,7 @@ repos:
alias: compile-linux-py3.5-raet-requirements
name: Linux Py3.5 RAET Requirements
files: ^requirements/((base|raet|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.5
Expand Down Expand Up @@ -297,11 +313,19 @@ repos:
- --remove-line=^pycrypto==(.*)$
- --remove-line=^enum34==(.*)$

- id: pip-tools-compile
alias: compile-cloud-py3.5-requirements
name: Cloud Py3.5 Requirements
files: ^requirements/(static/cloud\.in)$
args:
- -v
- --py-version=3.5

- id: pip-tools-compile
alias: compile-linux-py3.6-tcp-requirements
name: Linux Py3.6 TCP Requirements
files: ^requirements/((base|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.6
Expand All @@ -324,7 +348,7 @@ repos:
alias: compile-linux-py3.6-zmq-requirements
name: Linux Py3.6 ZeroMQ Requirements
files: ^requirements/((base|zeromq|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.6
Expand Down Expand Up @@ -364,7 +388,7 @@ repos:
alias: compile-linux-py3.6-raet-requirements
name: Linux Py3.6 RAET Requirements
files: ^requirements/((base|raet|pytest)\.txt|static/(.*)\.in)$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|docs|osx|windows)\.in$
exclude: ^requirements/static/(centos-6|ubuntu-14.04|lint|cloud|docs|osx|windows)\.in$
args:
- -v
- --py-version=3.6
Expand Down Expand Up @@ -403,3 +427,11 @@ repos:
- --include=requirements/pytest.txt
- --remove-line=^pycrypto==(.*)$
- --remove-line=^enum34==(.*)$

- id: pip-tools-compile
alias: compile-cloud-py3.6-requirements
name: Cloud Py3.6 Requirements
files: ^requirements/(static/cloud\.in)$
args:
- -v
- --py-version=3.6
43 changes: 43 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,26 @@ def runtests_raet_pycryptodomex(session, coverage):
)


@nox.session(python=_PYTHON_VERSIONS, name='runtests-cloud')
@nox.parametrize('coverage', [False, True])
def runtests_cloud(session, coverage):
# Install requirements
_install_requirements(session, 'zeromq', 'unittest-xml-reporting==2.2.1')

pydir = _get_pydir(session)
cloud_requirements = os.path.join(REPO_ROOT, 'requirements', 'static', pydir, 'cloud.txt')

session.install('--progress-bar=off', '-r', cloud_requirements, silent=PIP_INSTALL_SILENT)

cmd_args = [
'--tests-logfile={}'.format(
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
),
'--cloud-provider-tests'
] + session.posargs
_runtests(session, coverage, cmd_args)


@nox.session(python=_PYTHON_VERSIONS, name='pytest-parametrized')
@nox.parametrize('coverage', [False, True])
@nox.parametrize('transport', ['zeromq', 'raet', 'tcp'])
Expand Down Expand Up @@ -704,6 +724,29 @@ def pytest_raet_pycryptodomex(session, coverage):
)


@nox.session(python=_PYTHON_VERSIONS, name='pytest-cloud')
@nox.parametrize('coverage', [False, True])
def pytest_cloud(session, coverage):
# Install requirements
_install_requirements(session, 'zeromq')
pydir = _get_pydir(session)
cloud_requirements = os.path.join(REPO_ROOT, 'requirements', 'static', pydir, 'cloud.txt')

session.install('--progress-bar=off', '-r', cloud_requirements, silent=PIP_INSTALL_SILENT)

cmd_args = [
'--rootdir', REPO_ROOT,
'--log-file={}'.format(
os.path.join(REPO_ROOT, 'artifacts', 'logs', 'runtests.log')
),
'--no-print-logs',
'-ra',
'-s',
os.path.join(REPO_ROOT, 'tests', 'integration', 'cloud', 'providers')
] + session.posargs
_pytest(session, coverage, cmd_args)


def _pytest(session, coverage, cmd_args):
# Create required artifacts directories
_create_ci_directories()
Expand Down
7 changes: 7 additions & 0 deletions requirements/static/cloud.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is a compilation of requirements installed on salt-jenkins git.salt state run

azure
impacket
netaddr
profitbricks
pywinrm
Loading

0 comments on commit c83eb4d

Please sign in to comment.