Skip to content
tox.ini 18.7 KiB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
#######################################################################################
# Copyright ETSI Contributors and Others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#######################################################################################

[tox]
envlist = black, flake8, pylint, safety

[tox:jenkins]
toxworkdir = /tmp/.tox

[testenv]
usedevelop = True
basepython = python3
setenv = VIRTUAL_ENV={envdir}
         PYTHONDONTWRITEBYTECODE = 1
deps =  -r{toxinidir}/requirements.txt
parallel_show_output = true


#######################################################################################
[testenv:black]
deps = black
skip_install = true
commands =
        - black --check --diff NG-RO
        - black --check --diff RO-plugin
        - black --check --diff RO-SDN-arista_cloudvision
        - black --check --diff RO-SDN-dpb
        - black --check --diff RO-SDN-dynpac
        - black --check --diff RO-SDN-floodlight_openflow
        - black --check --diff RO-SDN-ietfl2vpn
        - black --check --diff RO-SDN-juniper_contrail
        - black --check --diff RO-SDN-odl_openflow
        - black --check --diff RO-SDN-onos_openflow
        - black --check --diff RO-SDN-onos_vpls
        - black --check --diff RO-VIM-aws
        - black --check --diff RO-VIM-azure
        - black --check --diff RO-VIM-fos
        - black --check --diff RO-VIM-opennebula
        - black --check --diff RO-VIM-openstack
        - black --check --diff RO-VIM-openvim
        - black --check --diff RO-VIM-vmware


#######################################################################################
[testenv:cover]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dev.txt
        -r{toxinidir}/requirements-test.txt
skip_install = true
commands =
        sh -c 'rm -f nosetests.xml'
        coverage erase
        # NG-RO
        - nose2 -C --coverage NG-RO/osm_ng_ro
        sh -c 'mv .coverage .coverage_ng_ro'
        # RO-plugin
        - nose2 -C --coverage RO-plugin/osm_ro_plugin
        sh -c 'mv .coverage .coverage_ro_plugin'
        # RO-SDN-arista_cloudvision
        - nose2 -C --coverage RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision
        sh -c 'mv .coverage .coverage_rosdn_arista_cloudvision'
        # RO-SDN-dpb
        - nose2 -C --coverage RO-SDN-dpb/osm_rosdn_dpb
        sh -c 'mv .coverage .coverage_rosdn_dpb'
        # RO-SDN-dynpac
        - nose2 -C --coverage RO-SDN-dynpac/osm_rosdn_dynpac
        sh -c 'mv .coverage .coverage_rosdn_dynpac'
        # RO-SDN-floodlight_openflow
        - nose2 -C --coverage RO-SDN-floodlight_openflow/osm_rosdn_floodlightof
        sh -c 'mv .coverage .coverage_rosdn_floodlightof'
        # RO-SDN-ietfl2vpn
        - nose2 -C --coverage RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn
        sh -c 'mv .coverage .coverage_rosdn_ietfl2vpn'
        # RO-SDN-juniper_contrail
        - nose2 -C --coverage RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail
        sh -c 'mv .coverage .coverage_rosdn_juniper_contrail'
        # RO-SDN-odl_openflow
        - nose2 -C --coverage RO-SDN-odl_openflow/osm_rosdn_odlof
        sh -c 'mv .coverage .coverage_rosdn_odlof'
        # RO-SDN-onos_openflow
        - nose2 -C --coverage RO-SDN-onos_openflow/osm_rosdn_onosof
        sh -c 'mv .coverage .coverage_rosdn_onosof'
        # RO-SDN-onos_vpls
        - nose2 -C --coverage RO-SDN-onos_vpls/osm_rosdn_onos_vpls
        sh -c 'mv .coverage .coverage_rosdn_onos_vpls'
        # RO-VIM-aws
        - nose2 -C --coverage RO-VIM-aws/osm_rovim_aws
        sh -c 'mv .coverage .coverage_rovim_aws'
        # RO-VIM-azure
        - nose2 -C --coverage RO-VIM-azure/osm_rovim_azure
        sh -c 'mv .coverage .coverage_rovim_azure'
        # RO-VIM-fos
        - nose2 -C --coverage RO-VIM-fos/osm_rovim_fos
        sh -c 'mv .coverage .coverage_rovim_fos'
        # RO-VIM-opennebula
        - nose2 -C --coverage RO-VIM-opennebula/osm_rovim_opennebula
        sh -c 'mv .coverage .coverage_rovim_opennebula'
        # RO-VIM-openstack
        - nose2 -C --coverage RO-VIM-openstack/osm_rovim_openstack -s RO-VIM-openstack/osm_rovim_openstack
        sh -c 'mv .coverage .coverage_rovim_openstack'
        # RO-VIM-openvim
        - nose2 -C --coverage RO-VIM-openvim/osm_rovim_openvim
        sh -c 'mv .coverage .coverage_rovim_openvim'
        # RO-VIM-vmware
        - nose2 -C --coverage RO-VIM-vmware/osm_rovim_vmware -s RO-VIM-vmware/osm_rovim_vmware
        sh -c 'mv .coverage .coverage_rovim_vmware'
        # Combine results and generate reports
        coverage combine .coverage_ng_ro .coverage_ro_plugin .coverage_rosdn_arista_cloudvision .coverage_rosdn_dpb .coverage_rosdn_dynpac .coverage_rosdn_floodlightof .coverage_rosdn_ietfl2vpn .coverage_rosdn_juniper_contrail .coverage_rosdn_odlof .coverage_rosdn_onos_vpls .coverage_rosdn_onosof .coverage_rovim_aws .coverage_rovim_azure .coverage_rovim_fos .coverage_rovim_opennebula .coverage_rovim_openstack .coverage_rovim_openvim .coverage_rovim_vmware
        coverage report --omit='*tests*'
        coverage html -d ./cover --omit='*tests*'
        coverage xml -o coverage.xml --omit='*tests*'
whitelist_externals = sh


#######################################################################################
[testenv:flake8]
deps = flake8
skip_install = true
commands =
        - flake8 NG-RO/osm_ng_ro/ NG-RO/setup.py
        - flake8 RO-plugin/osm_ro_plugin/ RO-plugin/setup.py
        - flake8 RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision/ RO-SDN-arista_cloudvision/setup.py
        - flake8 RO-SDN-dpb/osm_rosdn_dpb/ RO-SDN-dpb/setup.py
        - flake8 RO-SDN-dynpac/osm_rosdn_dynpac/ RO-SDN-dynpac/setup.py
        - flake8 RO-SDN-floodlight_openflow/osm_rosdn_floodlightof/ RO-SDN-floodlight_openflow/setup.py
        - flake8 RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn/ RO-SDN-ietfl2vpn/setup.py
        - flake8 RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail/ RO-SDN-juniper_contrail/setup.py
        - flake8 RO-SDN-odl_openflow/osm_rosdn_odlof/ RO-SDN-odl_openflow/setup.py
        - flake8 RO-SDN-onos_openflow/osm_rosdn_onosof/ RO-SDN-onos_openflow/setup.py
        - flake8 RO-SDN-onos_vpls/osm_rosdn_onos_vpls/ RO-SDN-onos_vpls/setup.py
        - flake8 RO-VIM-aws/osm_rovim_aws/ RO-VIM-aws/setup.py
        - flake8 RO-VIM-azure/osm_rovim_azure/ RO-VIM-azure/setup.py
        - flake8 RO-VIM-fos/osm_rovim_fos/ RO-VIM-fos/setup.py
        - flake8 RO-VIM-opennebula/osm_rovim_opennebula/ RO-VIM-opennebula/setup.py
        - flake8 RO-VIM-openstack/osm_rovim_openstack/ RO-VIM-openstack/setup.py
        - flake8 RO-VIM-openvim/osm_rovim_openvim/ RO-VIM-openvim/setup.py
        - flake8 RO-VIM-vmware/osm_rovim_vmware/vimconn_vmware.py RO-VIM-vmware/osm_rovim_vmware/tests/test_vimconn_vmware.py RO-VIM-vmware/setup.py


#######################################################################################
[testenv:pylint]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dev.txt
        -r{toxinidir}/requirements-test.txt
        pylint
skip_install = true
commands =
        - pylint -E NG-RO/osm_ng_ro
        - pylint -E RO-plugin/osm_ro_plugin
        - pylint -E RO-SDN-arista_cloudvision/osm_rosdn_arista_cloudvision
        - pylint -E RO-SDN-dpb/osm_rosdn_dpb
        - pylint -E RO-SDN-dynpac/osm_rosdn_dynpac
        - pylint -E RO-SDN-floodlight_openflow/osm_rosdn_floodlightof
        - pylint -E RO-SDN-ietfl2vpn/osm_rosdn_ietfl2vpn
        - pylint -E RO-SDN-juniper_contrail/osm_rosdn_juniper_contrail
        - pylint -E RO-SDN-odl_openflow/osm_rosdn_odlof
        - pylint -E RO-SDN-onos_openflow/osm_rosdn_onosof
        - pylint -E RO-SDN-onos_vpls/osm_rosdn_onos_vpls
        - pylint -E RO-VIM-aws/osm_rovim_aws
        - pylint -E RO-VIM-azure/osm_rovim_azure
        - pylint -E RO-VIM-fos/osm_rovim_fos
        - pylint -E RO-VIM-opennebula/osm_rovim_opennebula
        - pylint -E RO-VIM-openstack/osm_rovim_openstack
        - pylint -E RO-VIM-openvim/osm_rovim_openvim
        - pylint -E RO-VIM-vmware/osm_rovim_vmware


#######################################################################################
[testenv:safety]
setenv =
        LC_ALL=C.UTF-8
        LANG=C.UTF-8
deps =  {[testenv]deps}
        safety
skip_install = true
commands =
        - safety check --full-report


#######################################################################################
[testenv:pip-compile]
deps =  pip-tools==5.5.0
commands =
        - sh -c 'for file in requirements*.in ; do pip-compile -rU --no-header $file ;\
        out=`echo $file | sed "s/.in/.txt/"` ; \
        head -16 tox.ini >> $out ;\
        done'
whitelist_externals = sh


#######################################################################################
[testenv:dist_ng_ro]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/NG-RO
commands =
        sh -c 'rm -rf osm_ng_ro/requirements.txt deb_dist dist osm_ng_ro.egg-info osm_ng_ro*.tar.gz'
        sh -c 'cp ../requirements.txt osm_ng_ro/requirements.txt'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-ng-ro*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_plugin]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-plugin
commands =
        sh -c 'rm -rf deb_dist dist osm_ro_plugin.egg-info osm_ro_plugin*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-ro-plugin*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_arista_cloudvision]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-arista_cloudvision
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_arista_cloudvision.egg-info osm_rosdn_arista_cloudvision*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-arista-cloudvision*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_dpb]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-dpb
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_dpb.egg-info osm_rosdn_dpb*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-dpb*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_dynpac]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-dynpac
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_dynpac.egg-info osm_rosdn_dynpac*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-dynpac*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_floodlight_of]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-floodlight_openflow
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_floodlightof.egg-info osm_rosdn_floodlightof*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-floodlightof*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_ietfl2vpn]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-ietfl2vpn
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_ietfl2vpn.egg-info osm_rosdn_ietfl2vpn*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-ietfl2vpn*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_juniper_contrail]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-juniper_contrail
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_juniper_contrail.egg-info osm_rosdn_juniper_contrail*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-juniper-contrail*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_odl_of]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-odl_openflow
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_odlof.egg-info osm_rosdn_odlof*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-odlof*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_onos_of]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-onos_openflow
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_onosof.egg-info osm_rosdn_onosof*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-onosof*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_sdn_onos_vpls]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-SDN-onos_vpls
commands =
        sh -c 'rm -rf deb_dist dist osm_rosdn_onos_vpls.egg-info osm_rosdn_onos_vpls*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rosdn-onos-vpls*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_vim_aws]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-aws
commands =
        sh -c 'rm -rf deb_dist dist osm_rovim_aws.egg-info osm_rovim_aws*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rovim-aws*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_vim_azure]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-azure
commands =
        sh -c 'rm -rf deb_dist dist osm_rovim_azure.egg-info osm_rovim_azure*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rovim-azure*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_vim_fos]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-fos
commands =
        sh -c 'rm -rf deb_dist dist osm_rovim_fos.egg-info osm_rovim_fos*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rovim-fos*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_vim_opennebula]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-opennebula
commands =
        sh -c 'rm -rf deb_dist dist osm_rovim_opennebula.egg-info osm_rovim_opennebula*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rovim-opennebula*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_vim_openstack]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-openstack
commands =
        sh -c 'rm -rf deb_dist dist osm_rovim_openstack.egg-info osm_rovim_openstack*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rovim-openstack*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_vim_openvim]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-openvim
commands =
        sh -c 'rm -rf deb_dist dist osm_rovim_openvim.egg-info osm_rovim_openvim*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rovim-openvim*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[testenv:dist_ro_vim_vmware]
deps =  {[testenv]deps}
        -r{toxinidir}/requirements-dist.txt
skip_install = true
changedir = {toxinidir}/RO-VIM-vmware
commands =
        sh -c 'rm -rf deb_dist dist osm_rovim_vmware.egg-info osm_rovim_vmware*.tar.gz'
        python3 setup.py --command-packages=stdeb.command sdist_dsc
        sh -c 'cd deb_dist/osm-rovim-vmware*/ && dpkg-buildpackage -rfakeroot -uc -us'
whitelist_externals = sh

#######################################################################################
[flake8]
ignore =
        W291,
        W293,
        W503,
        W605,
        E123,
        E125,
        E203,
        E226,
        E241
exclude =
        .git,
        __pycache__,
        .tox,
max-line-length = 120
show-source = True
builtins = _