Browse Source

Run functional tests on Python 3

The functional job roles are extended with an option to specify
python version to run with and a new CI job is created.
python-memcached is added to requirements.txt, since it is used in
the default keystonemiddleware configuration.

Change-Id: I0b77b150785a90b411cba4ffc4b89cc67646e2ac
Grzegorz Grasza 4 months ago
parent
commit
85b776bc86
6 changed files with 37 additions and 2 deletions
  1. 13
    0
      .zuul.yaml
  2. 3
    0
      bindep.txt
  3. 1
    0
      requirements.txt
  4. 2
    0
      roles/configure-freeipa/tasks/main.yaml
  5. 8
    2
      roles/configure-novajoin/tasks/main.yaml
  6. 10
    0
      tox.ini

+ 13
- 0
.zuul.yaml View File

@@ -3,6 +3,8 @@
3 3
       jobs:
4 4
         - novajoin-functional:
5 5
             voting: false
6
+        - novajoin-functional-py3:
7
+            voting: false
6 8
 
7 9
 - job:
8 10
     name: novajoin-functional
@@ -39,3 +41,14 @@
39 41
           # Disable Cinder services
40 42
           c-bak: false
41 43
           c-vol: false
44
+
45
+- job:
46
+    name: novajoin-functional-py3
47
+    description: |
48
+      Run functional tests under Python 3.
49
+    parent: novajoin-functional
50
+    nodeset: devstack-single-node-fedora-latest
51
+    vars:
52
+      tox_envlist: functional-py3
53
+      bindep_profile: test py3
54
+      python_version: 3

+ 3
- 0
bindep.txt View File

@@ -3,3 +3,6 @@
3 3
 
4 4
 python-ipalib
5 5
 python-ipaclient
6
+
7
+python3-ipalib [py3]
8
+python3-ipaclient [py3]

+ 1
- 0
requirements.txt View File

@@ -7,6 +7,7 @@ Paste>=2.0.2 # MIT
7 7
 Routes>=2.3.1 # MIT
8 8
 six>=1.10.0 # MIT
9 9
 python-keystoneclient>=3.8.0 # Apache-2.0
10
+python-memcached>=1.59 # PSF
10 11
 keystoneauth1>=3.3.0 # Apache-2.0
11 12
 oslo.concurrency>=3.25.0 # Apache-2.0
12 13
 oslo.config>=6.1.0 # Apache-2.0

+ 2
- 0
roles/configure-freeipa/tasks/main.yaml View File

@@ -21,6 +21,7 @@
21 21
     name: urllib3
22 22
     state: absent
23 23
   become: true
24
+  when: python_version is not defined
24 25
 
25 26
 - name: Install FreeIPA
26 27
   package:
@@ -35,6 +36,7 @@
35 36
   check_mode: true
36 37
   ignore_errors: yes
37 38
   register: mod_nss_check
39
+  become: true
38 40
 
39 41
 - name: Remove mod_ssl config which conflicts with FreeIPA
40 42
   file:

+ 8
- 2
roles/configure-novajoin/tasks/main.yaml View File

@@ -1,10 +1,16 @@
1 1
 - name: Build novajoin
2
-  command: python setup.py build
2
+  command: python{{ python_version|default('') }} setup.py build
3 3
   args:
4 4
     chdir: '{{ zuul.project.src_dir }}'
5 5
 
6
+- name: Install novajoin requirements
7
+  command: python{{ python_version|default('') }} -m pip install -r requirements.txt
8
+  args:
9
+    chdir: '{{ zuul.project.src_dir }}'
10
+  become: true
11
+
6 12
 - name: Install novajoin
7
-  command: python setup.py install
13
+  command: python{{ python_version|default('') }} setup.py install
8 14
   args:
9 15
     chdir: '{{ zuul.project.src_dir }}'
10 16
   become: true

+ 10
- 0
tox.ini View File

@@ -76,3 +76,13 @@ setenv =
76 76
 commands =
77 77
     /usr/bin/find . -type f -name "*.py[c|o]" -delete
78 78
     stestr run --slowest {posargs}
79
+
80
+[testenv:functional-py3]
81
+basepython = python3
82
+sitepackages = true
83
+deps = -r{toxinidir}/test-requirements.txt
84
+setenv =
85
+    OS_TEST_PATH={toxinidir}/novajoin/tests/functional
86
+commands =
87
+    /usr/bin/find . -type f -name "*.py[c|o]" -delete
88
+    stestr run --slowest {posargs}

Loading…
Cancel
Save