Browse Source

Enable pep8 and pylint in zuul for cgts-client

The zuul config file was not triggering correctly.
 cgts-client changes should run jobs for cgts-client
 sysinv changes should run jobs for sysinv
 pep8 / flake8 jobs do not need dependent projects

This change also fixes the failing pep8 and pylint errors

The change in sysinv/tox.ini was to verify the zuul jobs for
sysinv are triggered by a change under that folder.

Story: 2003862
Task: 27870
Change-Id: Ia5887ef74fc0628e0dcf55f1f27cf0dc9e5ccbc7
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Al Bailey 5 months ago
parent
commit
1eb9e76426

+ 33
- 10
.zuul.yaml View File

@@ -16,6 +16,8 @@
16 16
         - stx-devstack-config:
17 17
             voting: false
18 18
         - cgtsclient-tox-py27
19
+        - cgtsclient-tox-pep8
20
+        - cgtsclient-tox-pylint
19 21
     gate:
20 22
       jobs:
21 23
         - build-openstack-api-ref
@@ -28,6 +30,8 @@
28 30
         - controllerconfig-tox-pylint
29 31
         - configutilities-tox-flake8
30 32
         - cgtsclient-tox-py27
33
+        - cgtsclient-tox-pep8
34
+        - cgtsclient-tox-pylint
31 35
     post:
32 36
       jobs:
33 37
         - publish-stx-api-ref
@@ -44,7 +48,7 @@
44 48
       - openstack/stx-fault
45 49
       - openstack/stx-integ
46 50
     files:
47
-      - sysinv/*
51
+      - sysinv/sysinv/*
48 52
     vars:
49 53
       tox_envlist: py27
50 54
       tox_extra_args: -c sysinv/sysinv/sysinv/tox.ini
@@ -54,12 +58,8 @@
54 58
     parent: tox
55 59
     description: |
56 60
       Run flake8 test for sysinv
57
-    required-projects:
58
-      - openstack/stx-update
59
-      - openstack/stx-fault
60
-      - openstack/stx-integ
61 61
     files:
62
-      - sysinv/*
62
+      - sysinv/sysinv/*
63 63
     vars:
64 64
       tox_envlist: flake8
65 65
       tox_extra_args: -c sysinv/sysinv/sysinv/tox.ini
@@ -68,9 +68,6 @@
68 68
     name: controllerconfig-tox-flake8
69 69
     parent: tox
70 70
     description: Run flake8 tests for controllerconfig
71
-    required-projects:
72
-      - openstack/stx-update
73
-      - openstack/stx-fault
74 71
     files:
75 72
       - controllerconfig/*
76 73
     vars:
@@ -149,7 +146,7 @@
149 146
     description: |
150 147
       Run py27 test for cgts-client
151 148
     files:
152
-      - sysinv/*
149
+      - sysinv/cgts-client/*
153 150
     required-projects:
154 151
       - openstack/stx-update
155 152
       - openstack/stx-fault
@@ -157,3 +154,29 @@
157 154
     vars:
158 155
       tox_envlist: py27
159 156
       tox_extra_args: -c sysinv/cgts-client/cgts-client/tox.ini
157
+
158
+- job:
159
+    name: cgtsclient-tox-pep8
160
+    parent: tox
161
+    description: |
162
+      Run pep8 test for cgts-client
163
+    files:
164
+      - sysinv/cgts-client/*
165
+    vars:
166
+      tox_envlist: pep8
167
+      tox_extra_args: -c sysinv/cgts-client/cgts-client/tox.ini
168
+
169
+- job:
170
+    name: cgtsclient-tox-pylint
171
+    parent: tox
172
+    description: |
173
+      Run pylint test for cgts-client
174
+    files:
175
+      - sysinv/cgts-client/*
176
+    required-projects:
177
+      - openstack/stx-update
178
+      - openstack/stx-fault
179
+      - openstack/stx-integ
180
+    vars:
181
+      tox_envlist: pylint
182
+      tox_extra_args: -c sysinv/cgts-client/cgts-client/tox.ini

+ 2
- 2
sysinv/cgts-client/cgts-client/cgtsclient/common/base.py View File

@@ -50,7 +50,7 @@ class Manager(object):
50 50
     def _create(self, url, body):
51 51
         _, body = self.api.json_request('POST', url, body=body)
52 52
         if body:
53
-            return self.resource_class(self, body)  # noqa
53
+            return self.resource_class(self, body)  # noqa pylint: disable=not-callable
54 54
 
55 55
     def _upload(self, url, body, data=None):
56 56
         resp = self.api.upload_request_with_data(
@@ -84,7 +84,7 @@ class Manager(object):
84 84
         _, body = self.api.json_request(http_method, url, body=body)
85 85
         # PATCH/PUT requests may not return a body
86 86
         if body:
87
-            return self.resource_class(self, body)  # noqa
87
+            return self.resource_class(self, body)  # noqa pylint: disable=not-callable
88 88
 
89 89
     def _delete(self, url):
90 90
         self.api.raw_request('DELETE', url)

+ 1
- 1
sysinv/cgts-client/cgts-client/cgtsclient/openstack/common/config/generator.py View File

@@ -23,10 +23,10 @@
23 23
 import imp
24 24
 import os
25 25
 import re
26
+import six
26 27
 import socket
27 28
 import sys
28 29
 import textwrap
29
-import six
30 30
 
31 31
 from oslo_config import cfg
32 32
 

+ 3
- 1
sysinv/cgts-client/cgts-client/tox.ini View File

@@ -17,9 +17,10 @@ setenv = VIRTUAL_ENV={envdir}
17 17
          TESTR_START_DIR=cgtsclient/tests
18 18
 basepython = python2.7
19 19
 usedevelop = True
20
-install_command = pip install  -U  {[tox]wrdeps} -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
20
+install_command = pip install  -U  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
21 21
 deps = -r{toxinidir}/requirements.txt
22 22
        -r{toxinidir}/test-requirements.txt
23
+       {[tox]wrdeps}
23 24
 
24 25
 commands =
25 26
   find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete
@@ -32,6 +33,7 @@ whitelist_externals =
32 33
 passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
33 34
 
34 35
 [testenv:pep8]
36
+deps = -r{toxinidir}/test-requirements.txt
35 37
 commands =
36 38
     flake8 cgtsclient 
37 39
 

+ 1
- 1
sysinv/sysinv/sysinv/tox.ini View File

@@ -15,7 +15,7 @@ distshare={toxworkdir}/.tox/distshare
15 15
 # enabling usedevelop results in  py27 develop-inst:
16 16
 # Exception: Versioning for this project requires either an sdist tarball,
17 17
 # or access to an upstream git repository.
18
-# WRS Note. site-packages is true and rpm-python must be yum installed on your dev machine.
18
+# Note. site-packages is true and rpm-python must be yum installed on your dev machine.
19 19
 sitepackages = True
20 20
 
21 21
 # tox is silly... these need to be separated by a newline....

Loading…
Cancel
Save