From 74cd3fb0039ea83b78595b0e6e7db9570f74e40f Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Tue, 11 Oct 2016 22:29:31 -0400 Subject: [PATCH 1/6] add test-requirements.txt for test dependencies --- test-requirements.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..9aa0cd2 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,8 @@ +pytest==2.9.2 +pytest-cov==2.3.0 +pytest-flake8==0.6 +testfixtures==4.10.0 +vcrpy==1.9.0 +mock==2.0.0 +Flask==0.11.1 +Flask-RESTful==0.3.5 From ceb941d501aceee3b7ae38b15bbd70a657af5e54 Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Tue, 11 Oct 2016 22:28:48 -0400 Subject: [PATCH 2/6] add gitlab continuous integration config --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..0825208 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,21 @@ +image: python:2.7.12-slim + +before_script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - coverage erase + +variables: + COVERAGE_FILE: .coverage + +pytest: + stage: test + script: + - ONE_XMLRPC="http://localhost:2633/RPC2" python setup.py test + tags: + - docker + +after_script: + - coverage combine + - coverage report + - coverage html From 9246a4b813e46b9b8397f9812f9e61fc6ae8a9e7 Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Tue, 11 Oct 2016 22:34:54 -0400 Subject: [PATCH 3/6] README: add build and coverage status --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8ec6a4e..b4b7f45 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # OneDNS + +[![build status](https://gitlab-int.rc.fas.harvard.edu/ops/one-dns/badges/master/build.svg)](https://gitlab-int.rc.fas.harvard.edu/ops/one-dns/commits/master) +[![coverage report](https://gitlab-int.rc.fas.harvard.edu/ops/one-dns/badges/master/coverage.svg)](https://gitlab-int.rc.fas.harvard.edu/ops/one-dns/commits/master) + Dyanmic DNS for OpenNebula ## Usage From 40dfd97292cdbbb8a915ce22bbac20fb138b6d5f Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Tue, 11 Oct 2016 22:46:25 -0400 Subject: [PATCH 4/6] gitlab-ci: setup ONE_AUTH for tests --- .gitlab-ci.yml | 12 +++++------- ci-scripts/after.sh | 4 ++++ ci-scripts/before.sh | 5 +++++ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 ci-scripts/after.sh create mode 100644 ci-scripts/before.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0825208..06638ca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,21 +1,19 @@ image: python:2.7.12-slim before_script: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - - coverage erase + - bash ci-scripts/before.sh variables: COVERAGE_FILE: .coverage + ONE_AUTH: "/tmp/test-one-auth" + ONE_XMLRPC: "http://localhost:2633/RPC2" pytest: stage: test script: - - ONE_XMLRPC="http://localhost:2633/RPC2" python setup.py test + - python setup.py test tags: - docker after_script: - - coverage combine - - coverage report - - coverage html + - bash ci-scripts/after.sh diff --git a/ci-scripts/after.sh b/ci-scripts/after.sh new file mode 100644 index 0000000..61dc4d4 --- /dev/null +++ b/ci-scripts/after.sh @@ -0,0 +1,4 @@ +#!/bin/bash +coverage combine +coverage report +coverage html diff --git a/ci-scripts/before.sh b/ci-scripts/before.sh new file mode 100644 index 0000000..6b73091 --- /dev/null +++ b/ci-scripts/before.sh @@ -0,0 +1,5 @@ +#!/bin/bash +echo 'someuser:sometoken' > ${ONE_AUTH} +pip install -r requirements.txt +pip install -r test-requirements.txt +coverage erase From 26fb8c0abb70fad2d21cae79c336239c0adaec2e Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Tue, 11 Oct 2016 23:26:22 -0400 Subject: [PATCH 5/6] bump pytest and plugins to latest versions --- setup.py | 6 +++--- test-requirements.txt | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 593ea91..43f0290 100644 --- a/setup.py +++ b/setup.py @@ -29,9 +29,9 @@ setup( 'pytest-runner>=2.9' ], tests_require=[ - "pytest>=2.9.2", - "pytest-cov>=2.3.0", - "pytest-flake8>=0.6", + "pytest>=3.0.3", + "pytest-cov>=2.4.0", + "pytest-flake8>=0.7", "testfixtures>=4.10.0", "vcrpy>=1.9.0", "mock>=2.0.0", diff --git a/test-requirements.txt b/test-requirements.txt index 9aa0cd2..316cc80 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ -pytest==2.9.2 -pytest-cov==2.3.0 -pytest-flake8==0.6 +pytest==3.0.3 +pytest-cov==2.4.0 +pytest-flake8==0.7 testfixtures==4.10.0 vcrpy==1.9.0 mock==2.0.0 From ab73b9acb740f6d80faba4cec7c85676d809e8ec Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Tue, 11 Oct 2016 23:43:11 -0400 Subject: [PATCH 6/6] remove 'coverage {combine,html}' commands --- ci-scripts/after.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci-scripts/after.sh b/ci-scripts/after.sh index 61dc4d4..e31426f 100644 --- a/ci-scripts/after.sh +++ b/ci-scripts/after.sh @@ -1,4 +1,2 @@ #!/bin/bash -coverage combine coverage report -coverage html