URL: https://github.com/freeipa/freeipa/pull/1308
Author: tomaskrizek
 Title: #1308: Run tox tests for PyPI packages on Travis
Action: opened

PR body:
"""
Original PR: #1293 
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1308/head:pr1308
git checkout pr1308
From e70fb185f71746dfd90af3944ace8e60434cad71 Mon Sep 17 00:00:00 2001
From: Christian Heimes <chei...@redhat.com>
Date: Thu, 16 Nov 2017 12:27:16 +0100
Subject: [PATCH] Run tox tests for PyPI packages on Travis

Signed-off-by: Christian Heimes <chei...@redhat.com>
---
 .test_runner_config.yaml |  5 ++++-
 .travis.yml              |  4 +++-
 .travis_run_task.sh      | 14 ++++++++++----
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/.test_runner_config.yaml b/.test_runner_config.yaml
index 85c48be5d8..3207ede410 100644
--- a/.test_runner_config.yaml
+++ b/.test_runner_config.yaml
@@ -28,7 +28,7 @@ steps:
   builddep:
   - rm -rf /var/cache/dnf/*
   - "dnf makecache fast || :"
-  - dnf builddep -y ${builddep_opts} --spec freeipa.spec.in --best --allowerasing
+  - dnf builddep -y ${builddep_opts} -D "with_wheels 1" --spec freeipa.spec.in --best --allowerasing
   cleanup:
   - chown -R ${uid}:${gid} ${container_working_dir}
   - journalctl -b --no-pager > systemd_journal.log
@@ -53,6 +53,9 @@ steps:
   lint:
   - PYTHON=/usr/bin/python2 make V=0 lint
   - PYTHON=/usr/bin/python3 make V=0 pylint
+  tox:
+  # just run one pylint and one Python 3 target (time/coverage trade-off)
+  - tox -e py27,py36,pypi,pylint3
   prepare_tests:
   - echo ${server_password} | kinit admin && ipa ping
   - cp -r /etc/ipa/* ~/.ipa/
diff --git a/.travis.yml b/.travis.yml
index 5990ab868b..bf2d1f626f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,13 +28,15 @@ env:
             test_ipaserver
             test_pkcs10
             test_xmlrpc/test_[l-z]*.py"
+        - TASK_TO_RUN="tox"
+          TEST_RUNNER_CONFIG=".test_runner_config.yaml"
 install:
     - pip install --upgrade pip
     - pip3 install --upgrade pip
     - pip install pycodestyle
     - >
       pip3 install
-      git+https://github.com/freeipa/ipa-docker-test-runner@release-0-2-1
+      git+https://github.com/freeipa/ipa-docker-test-runner@release-0-2-2
 
 script:
     - mkdir -p $CI_RUNNER_LOGS_DIR
diff --git a/.travis_run_task.sh b/.travis_run_task.sh
index 49c60444eb..9faf4c3f53 100755
--- a/.travis_run_task.sh
+++ b/.travis_run_task.sh
@@ -6,7 +6,16 @@
 
 PYTHON="/usr/bin/python${TRAVIS_PYTHON_VERSION}"
 test_set=""
-developer_mode_opt="--developer-mode"
+
+case "$TASK_TO_RUN" in
+    lint|tox)
+        # disable developer mode for lint and tox tasks.
+        developer_mode_opt=""
+        ;;
+    *)
+        developer_mode_opt="--developer-mode"
+        ;;
+esac
 
 function truncate_log_to_test_failures() {
     # chop off everything in the CI_RESULTS_LOG preceding pytest error output
@@ -25,9 +34,6 @@ then
     then
         git diff origin/$TRAVIS_BRANCH -U0 | pycodestyle --diff &> $PEP8_ERROR_LOG ||:
     fi 
-
-    # disable developer mode for lint task, otherwise we get an error
-    developer_mode_opt=""
 fi
 
 if [[ -n "$TESTS_TO_RUN" ]]
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to