Browse Source

Add releases script pytest tests to tox.ini

Add tox testing in upstream jobs with changes to
the releases script.

Removed pyflakes as these test are not running as
required.

Change-Id: I3fdf0be7beb814a681a2dcc155bae87fdb6a4c7e
Ronelle Landy 11 months ago
parent
commit
7ca3fcd685

+ 1
- 0
scripts/emit_releases_file/emit_releases_file.py View File

@@ -2,6 +2,7 @@ import logging
2 2
 import re
3 3
 import requests
4 4
 
5
+# Define releases
5 6
 RELEASES = ['newton', 'ocata', 'pike', 'queens', 'master']
6 7
 LONG_TERM_SUPPORT_RELEASES = ['queens']
7 8
 

+ 1
- 1
scripts/emit_releases_file/test_get_dlrn_hash.py View File

@@ -30,5 +30,5 @@ def test_null_response_raises_runtimeerror(mock_get):
30 30
     mock_get.return_value = None
31 31
     with pytest.raises(RuntimeError):
32 32
         get_dlrn_hash(release, hash_name)
33
-    mock_get.assert_called(repo_url, timeout=(3.05, 27))
33
+    mock_get.assert_called_with(repo_url, timeout=(3.05, 27))
34 34
     assert (10 == mock_get.call_count)

+ 12
- 1
tox.ini View File

@@ -1,5 +1,5 @@
1 1
 [tox]
2
-envlist = pyflakes, pep8, py27
2
+envlist = pep8, py27, py35
3 3
 
4 4
 [testenv]
5 5
 usedevelop = True
@@ -32,3 +32,14 @@ commands = python scripts/tripleo-jobs-gerrit.py {posargs}
32 32
 # separately, outside of the requirements files.
33 33
 deps = bindep
34 34
 commands = bindep test
35
+
36
+# This environment is used to run unit tests
37
+[testenv:py27]
38
+deps = {[testenv]deps}
39
+changedir = scripts/emit_releases_file
40
+commands = pytest
41
+
42
+[testenv:py35]
43
+deps={[testenv]deps}
44
+changedir = {[testenv:py27]changedir}
45
+commands = {[testenv:py27]commands}

+ 17
- 0
zuul.d/layout.yaml View File

@@ -10,3 +10,20 @@
10 10
       - tripleo-multinode-container-minimal
11 11
       - tripleo-multinode-experimental
12 12
       - tripleo-undercloud-jobs
13
+    check:
14
+      jobs:
15
+        - openstack-tox-py27:
16
+            files:
17
+              - ^scripts/emit_releases_file/.*$
18
+        - openstack-tox-py35:
19
+            files:
20
+              - ^scripts/emit_releases_file/.*$
21
+    gate:
22
+      queue: tripleo
23
+      jobs:
24
+        - openstack-tox-py27:
25
+            files:
26
+              - ^scripts/emit_releases_file/.*$
27
+        - openstack-tox-py35:
28
+            files:
29
+              - ^scripts/emit_releases_file/.*$

Loading…
Cancel
Save