From 6eae4ecbd5b0f2d250ece7ec313850225339dcc2 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 22 Mar 2019 10:08:11 +0100 Subject: [PATCH] remove tox and build native drone test environments --- .drone.jsonnet | 40 +++++---- .drone.yml | 198 ++++++++++++++++++++++++++++++++++++++--- tests/requirements.txt | 5 ++ 3 files changed, 213 insertions(+), 30 deletions(-) create mode 100644 tests/requirements.txt diff --git a/.drone.jsonnet b/.drone.jsonnet index 9ac441d..621d169 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,32 +1,34 @@ -local PythonVersions(pyversion="2.7", py="27") = { - name: "python" + pyversion, +local PipelineEmvironment(pyversion="2.7", ansibleversion="2.4") = { + name: "ansible" + ansibleversion, image: "python:" + pyversion, pull: "always", commands: [ - "pip install tox -q", - "tox -e $(tox -l | grep py" + py + " | xargs | sed 's/ /,/g') -q", + "pip install -q ansible~=" + ansibleversion, + "pip install -q -r tests/requirements.txt", + "pip install -q .", + "ansible-later -c tests/config/config.ini tests/data/yaml_success.yml" ], depends_on: [ "clone", ], }; -local PipelineTesting = { +local PipelineTesting(pyversion="2.7") = { kind: "pipeline", - name: "testing", + name: "python-" + pyversion, platform: { os: "linux", arch: "amd64", }, steps: [ - PythonVersions(pyversion="2.7", py="27"), - PythonVersions(pyversion="3.5", py="35"), - PythonVersions(pyversion="3.6", py="36"), - PythonVersions(pyversion="3.7", py="37"), + PipelineEmvironment(pyversion, ansibleversion="2.4"), + PipelineEmvironment(pyversion, ansibleversion="2.5"), + PipelineEmvironment(pyversion, ansibleversion="2.6"), + PipelineEmvironment(pyversion, ansibleversion="2.7"), ], }; -local PipelineBuild = { +local PipelineBuild(depends_on=[]) = { kind: "pipeline", name: "build", platform: { @@ -89,9 +91,7 @@ local PipelineBuild = { }, }, ], - depends_on: [ - "testing", - ], + depends_on: depends_on, }; local PipelineNotifications = { @@ -123,7 +123,15 @@ local PipelineNotifications = { }; [ - PipelineTesting, - PipelineBuild, + PipelineTesting(pyversion="2.7"), + PipelineTesting(pyversion="3.5"), + PipelineTesting(pyversion="3.6"), + PipelineTesting(pyversion="3.7"), + PipelineBuild(depends_on=[ + 'python-2.7', + 'python-3.5', + 'python-3.6', + 'python-3.7', + ]), PipelineNotifications, ] diff --git a/.drone.yml b/.drone.yml index 8bacfbb..1729bb7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,45 +1,212 @@ --- kind: pipeline -name: testing +name: python-2.7 platform: os: linux arch: amd64 steps: -- name: python2.7 +- name: ansible2.4 pull: always image: python:2.7 commands: - - pip install tox -q - - "tox -e $(tox -l | grep py27 | xargs | sed 's/ /,/g') -q" + - pip install -q ansible~=2.4 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml depends_on: - clone -- name: python3.5 +- name: ansible2.5 + pull: always + image: python:2.7 + commands: + - pip install -q ansible~=2.5 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.6 + pull: always + image: python:2.7 + commands: + - pip install -q ansible~=2.6 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.7 + pull: always + image: python:2.7 + commands: + - pip install -q ansible~=2.7 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +--- +kind: pipeline +name: python-3.5 + +platform: + os: linux + arch: amd64 + +steps: +- name: ansible2.4 + pull: always + image: python:3.5 + commands: + - pip install -q ansible~=2.4 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.5 + pull: always + image: python:3.5 + commands: + - pip install -q ansible~=2.5 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.6 + pull: always + image: python:3.5 + commands: + - pip install -q ansible~=2.6 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.7 pull: always image: python:3.5 commands: - - pip install tox -q - - "tox -e $(tox -l | grep py35 | xargs | sed 's/ /,/g') -q" + - pip install -q ansible~=2.7 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +--- +kind: pipeline +name: python-3.6 + +platform: + os: linux + arch: amd64 + +steps: +- name: ansible2.4 + pull: always + image: python:3.6 + commands: + - pip install -q ansible~=2.4 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.5 + pull: always + image: python:3.6 + commands: + - pip install -q ansible~=2.5 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.6 + pull: always + image: python:3.6 + commands: + - pip install -q ansible~=2.6 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml depends_on: - clone -- name: python3.6 +- name: ansible2.7 pull: always image: python:3.6 commands: - - pip install tox -q - - "tox -e $(tox -l | grep py36 | xargs | sed 's/ /,/g') -q" + - pip install -q ansible~=2.7 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +--- +kind: pipeline +name: python-3.7 + +platform: + os: linux + arch: amd64 + +steps: +- name: ansible2.4 + pull: always + image: python:3.7 + commands: + - pip install -q ansible~=2.4 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.5 + pull: always + image: python:3.7 + commands: + - pip install -q ansible~=2.5 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml + depends_on: + - clone + +- name: ansible2.6 + pull: always + image: python:3.7 + commands: + - pip install -q ansible~=2.6 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml depends_on: - clone -- name: python3.7 +- name: ansible2.7 pull: always image: python:3.7 commands: - - pip install tox -q - - "tox -e $(tox -l | grep py37 | xargs | sed 's/ /,/g') -q" + - pip install -q ansible~=2.7 + - pip install -q -r tests/requirements.txt + - pip install -q . + - ansible-later -c tests/config/config.ini tests/data/yaml_success.yml depends_on: - clone @@ -105,7 +272,10 @@ steps: - tag depends_on: -- testing +- python-2.7 +- python-3.5 +- python-3.6 +- python-3.7 --- kind: pipeline diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 0000000..7de58af --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,5 @@ +flake8 +pep8-naming +wheel +flake8-colors +pytest