Skip to content
Snippets Groups Projects
  1. Apr 24, 2019
  2. Mar 18, 2019
    • manchandavishal's avatar
      Add py36 and py37 tox envs · f8e0be59
      manchandavishal authored
      With python3.6 and python3.7 jobs added to the Zuul jobs, it makes sense
      to add this to the tox config too.
      
      Change-Id: Icf4a05048c406250ad6331f5593617471dcba319
      f8e0be59
  3. Mar 05, 2019
    • Ivan Kolodyazhny's avatar
      Switch integration tests to run with python3 · 43f8c3b1
      Ivan Kolodyazhny authored
      tox env for the integration tests is now renamed to 'integration'
      as it is no longer run under python 2.7.
      
      __hash__() method is now defined in integration_tests.helpers.BaseTestCase
      to avoid unhashable error during loading django test runner. This is
      originally caused by the fact that the base testcase class for integration
      tests is implemented on top of testtools and testtools does not define
      __hash__() method. In Python 3, __hash__() method must be defined
      if a class (re)defines __eq__() method to make the class hashable [1].
      Ideally integration base TestCase class can be implemented on top of
      Django test case, but the current implementation depends on features
      from testtools a lot, so it seems better to add __hash__() method
      as a workaround.
      
      Unbound methods don't exist in Python 3[2], so six.create_unbound_method
      doesn' work as expected. To dynamic method generation we have to use new
      descriptors interface [3] or just generate new
      functools.partialmethod [4] function introduced in Python 3.4 to
      generate class methods with pre-defined 'path' argument and pass 'self'
      as a first function argument for class instance.
      
      [1] https://docs.python.org/3.5/reference/datamodel.html#object.__hash__
      [2] https://six.readthedocs.io/#six.create_unbound_method
      [3] https://docs.python.org/3/howto/descriptor.html
      [4] https://docs.python.org/3/library/functools.html#functools.partialmethod
      
      Change-Id: I5c3078bdc66e33fe676d431bb28d92b35faaf479
      43f8c3b1
  4. Feb 27, 2019
  5. Jan 12, 2019
    • Akihiro Motoki's avatar
      Enable pylint in horizon · 220b1346
      Akihiro Motoki authored
      tests.py files are excluded from targets checked by pylint
      because it takes longer and longer time to check them somehow.
      
      pylint 2.2.x is supported only in Python 3 and we already switched
      our pep8 basepython to python3, so pylint and astroid are installed
      only for python3. This seems the easiest way to ensure py27 env works.
      
      literal-comparison error in openstack_dashboard/api/nova.py
      is also fixed in this commit as it is simple enough.
      
      Change-Id: Ic8868a44b296dba457be721716ca6f9d37ad9369
      220b1346
  6. Dec 28, 2018
  7. Dec 25, 2018
  8. Dec 22, 2018
    • Akihiro Motoki's avatar
      Allow to run pep8/docs tox env with horizon plugins · 25b6706f
      Akihiro Motoki authored
      As of now, when horizon plugins are configured in the horizon repo,
      pep8 and docs tox env cannot run.
      This is because openstack_dashboard.settings tries to load horizon plugins
      but horizon plugins are not installed in tox env by default and
      the jobs will fail as a result.
      This commit changes to use openstack_dashboard.test.settings
      as DJANGO_SETTINGS_MODULE for these tox environments by default.
      
      Change-Id: I6a9d0c74271cc4addd8a0964b5955d7d3b6d8267
      25b6706f
  9. Nov 10, 2018
    • Akihiro Motoki's avatar
      Bump hacking to 1.1.0 · cebe212d
      Akihiro Motoki authored
      Fix the following new errors:
      * E305 expected 2 blank lines after class or function definition, found 1
      * E126 continuation line over-indented for hanging indent
      
      max_line_length is set to 80 as the default value in pycodestyle is 79
      but horizon uses 80 as max_line_length.
      
      Ignore W504 and F405 by configurations.
      Reasons of disabling them are explained as comments in tox.ini.
      
      Change-Id: Iee8bcd60c30883fc8c74f08cf20af853cbb5e271
      cebe212d
  10. Oct 30, 2018
  11. Aug 26, 2018
    • Akihiro Motoki's avatar
      Run bandit job with python3 · 53c73833
      Akihiro Motoki authored
      Most jobs run with python3 now by default.
      
      In addition, this commit moves bandit testenv definitions
      before non-testenv tox environments. I believe this brings
      better readability.
      
      Change-Id: Ibc66211ebc517368b629a09084a494dc81a0265f
      53c73833
    • Akihiro Motoki's avatar
      Add py3-dj21 tox env for Django 2.1 · 00c58143
      Akihiro Motoki authored
      Django 2.1 has been released. It would be nice to have tox env
      for testing with Django 2.1.
      
      Note that this does not mean I lead Django 2.1 support.
      
      Related-Bug: #1789046
      Change-Id: Ic5f59e3c19480e01f5bfecbb0994121ee649388f
      00c58143
  12. Jul 08, 2018
    • Qian Min Chen's avatar
      Modify the 'tox.ini' file · 7b48d512
      Qian Min Chen authored
      Since the horizon remove the 'run_tests.sh' file,
      so there should remove '.venv' from the '.tox.ini' file.
      
      Change-Id: I3f956521ac1af37df77961991eddbfc0a3afb718
      7b48d512
  13. Jun 22, 2018
    • Ivan Kolodyazhny's avatar
      Add Bandit non-voting job · fe4a1f40
      Ivan Kolodyazhny authored
      This commit adds two new tox environments for bandit scanner. To run any
      of them you can use tox commands:
      
      1) 'tox -e bandit' to run bandit scanner against all the code
      2) 'tox -e bandit-baseline' to run bandit scanner only against the last
      commit or the current changes.
      
      Bandit job uses 'bandit-baseline' tox environment to veryfy that no new
      issues were introduced.
      
      Change-Id: I1fc3bb0d5d151f215b9efc916f921fabaa72e7d8
      fe4a1f40
  14. Jun 21, 2018
    • Akihiro Motoki's avatar
      Fix and reorganize tox env definitions · a384dc55
      Akihiro Motoki authored
      * Define py35 commands in a single place.
        Previously it was defined in [testenv] and [testenv:py35].
      * py35 env should use python3.5 instead of python3
        because pyNN job is specific to a specific python version.
        In addition, python version is automatically assumed by tox.
      * Sort env definitions in the order of unit tests, other testing stuffs
        with 'testenv:' prefix and finally non testenv stuffs (like flake8).
      * Drop testenv:manage-py35dj20 because testenv:manage now uses
        python 3.5 and Django 2.0.
      * Avoid using dict-style env commands definitions.
        In OpenStack projects, we usually use [testenv:xxxx] style.
      
      Change-Id: Ib55031a50a51f952b738f0fdf33313fa2c7522ff
      a384dc55
  15. Jun 15, 2018
    • Ivan Kolodyazhny's avatar
      Fix tox py27integration environment · 0a584d67
      Ivan Kolodyazhny authored
      Commit I7fb2fd7dd40f301ea822154b9809a9a07610c507 from integration tests
      run by incorrect syntax of posargs argument. This patch fixes it.
      
      Change-Id: I5882556a1b346ac40fe68b06772c4b349f70dfbc
      0a584d67
  16. Jun 08, 2018
    • Ivan Kolodyazhny's avatar
      Use default Django test runner instead of nose · 1f80d944
      Ivan Kolodyazhny authored
      Nose has been in maintenance mode for the past several years. It has
      issue with exit code [1] which leads to false positive results for our
      seleniun-headless job.
      
      This patch changes test runner for Horizon tests and does the following
      things:
      
      * Django test runner  executes test in a different order than Nose does.
        That's why we've got an issue with side-effect in
        horizon.tests.unit.tables.test_tables.MyToggleAction class. This patch
        adds workaround to it.
      * Rename filename of test files to names starting with 'test_'
        so that the django test runner can find tests expectedly.
      * '--with-html-output' option is temporary dropped and will be added in
        a following patch.
      * Integraion tests is marked via django.test.tag mechanism which is
        introduced in Django 1.10
      * 'selenium-headless' is broken now because we don't have geckodriver on
        gates, this patch makes it non-voting.
      * 'tox -e cover' is fixed
      * Remove @memorized decorator from
        dashboards.project.images.images.tables.filter_tenant_ids function.
      
      [1] https://github.com/nose-devs/nose/issues/984
      
      Depends-On: https://review.openstack.org/572095
      Depends-On: https://review.openstack.org/572124
      Depends-On: https://review.openstack.org/572390
      Depends-On: https://review.openstack.org/572391
      
      Related blueprint: improve-horizon-testing
      Change-Id: I7fb2fd7dd40f301ea822154b9809a9a07610c507
      1f80d944
    • Akihiro Motoki's avatar
      Add python3 django 1.11 job instead of django 2.0 job · 0bc2f1b0
      Akihiro Motoki authored
      Django 2.0 is now used in tox py35 job, so there is no need for
      py35dj20 job. Instead, Django 1.11 with python3 is not covered.
      
      - py35dj20 job is dropped from tox.ini.
      - python3-django111 is added to tox.ini.
        python3 is specified to basepython to avoid a specific python version.
      - Zuul job to consume python3-django111 is added.
      
      Note that horizon-openstack-tox-py35dj20 cannot be dropped
      because this job is used by horizon plugins.
      
      Change-Id: Ic3b5e06d591a6f1d667993d19dcddfaf40882dee
      0bc2f1b0
  17. Jun 06, 2018
    • Doug Hellmann's avatar
      fix tox python3 overrides · a59b2e1a
      Doug Hellmann authored
      
      We want to default to running all tox environments under python 3, so
      set the basepython value in each environment.
      
      We do not want to specify a minor version number, because we do not
      want to have to update the file every time we upgrade python.
      
      We do not want to set the override once in testenv, because that
      breaks the more specific versions used in default environments like
      py35 and py36.
      
      Change-Id: Iceeaad2d6e31f3afeba5879ba3825caba437940d
      Signed-off-by: default avatarDoug Hellmann <doug@doughellmann.com>
      a59b2e1a
  18. Apr 11, 2018
    • Akihiro Motoki's avatar
      Make babel_extract_angular work with python 3 · 386a5b66
      Akihiro Motoki authored
      Also run pep8 env with python3 as pep8/flake8 python 3 is
      generally more strict.
      
      Change-Id: Id4669ca1f929826f07cfe2928092d0e7255fda6f
      Closes-Bug: #1762992
      386a5b66
    • Akihiro Motoki's avatar
      Fix E402 warnings · f0f028ca
      Akihiro Motoki authored
      E402 module level import not at top of file
      
      Change-Id: Ia8425ffe5b1325d00ae482d99b6764fd0fcbf822
      f0f028ca
    • Akihiro Motoki's avatar
      Fix W503 warnings · 11eb4e9d
      Akihiro Motoki authored
      W503 line break before binary operator
      
      Looking at the code base, it sounds okay to follow this check.
      
      Change-Id: Id511e0104dc6de5b204021661d4a8776ca6d3658
      11eb4e9d
  19. Apr 10, 2018
    • Akihiro Motoki's avatar
      Fix pep8 errors · f545272f
      Akihiro Motoki authored
      Recent pep8 upgrade and corresponding pycodestyle update break
      horizon pep8 job due to the new rules.
      
      This commit fixes the following new errors:
      - E226 missing whitespace around arithmetic operator
      - E241 multiple spaces after ','
      - E731 do not assign a lambda expression, use a def
      
      The following errors are added to the ignore list
      as there are many errors:
      - E402 module level import not at top of file
      - W503 line break before binary operator
      
      Change-Id: I3478b0684175d2604bbcc1d89cbfca298b97f1e1
      f545272f
  20. Mar 25, 2018
  21. Mar 24, 2018
  22. Mar 11, 2018
    • Akihiro Motoki's avatar
      Update tox.ini · d885d9e5
      Akihiro Motoki authored
      - Drop tox envs for Django 1.10 or older.
      - Drop tox env py27dj111 as Django 1.11 is our primary version
        and it is covered by py27.
      - Ensure Django 2.0 is installed in py35dj20 and manage-py35dj20.
        The current install command potentially installs Django 2.1 or
        later if alpha version is released. It is better to ensure
        2.0.x is installed.
      
      Change-Id: I85cbb61da9496313ae1633ec94b85702b434b122
      d885d9e5
  23. Mar 08, 2018
    • Monty Taylor's avatar
      Update upper-constraints consumption · 835a4bb7
      Monty Taylor authored
      In order to deal with horizon going into the upper-constraints file so
      that horizon plugins can consume it normally, we need to align the
      constraints invocation in horizon's tox.ini. This means putting the -C
      argument into the dependencies list rather than the pip install line so
      that it doesn't get appended to tox installing horizon itself.
      
      While we're in here, move nosehtmloutput into test-requirements so that
      we don't need to do .[test] which also doesn't work with constraints.
      
      Needed-By: https://review.openstack.org/550475
      Change-Id: I736f79010c2d34e25d41d967a38128c2263ed13f
      835a4bb7
  24. Feb 07, 2018
    • Luong Anh Tuan's avatar
      Enable more hacking-extensions · fc64ba95
      Luong Anh Tuan authored
      This patch enable extensions:
      -[H106] Do not put vim configuration in source files.
      -[H204] Use assert(Not)Equal to check for equality.
      -[H205] Use assert(Greater|Less)(Equal) for comparison.
      
      Change-Id: I7fa2c8753b2b471f44afe8ee83a4a612ed1b76a9
      fc64ba95
  25. Jan 06, 2018
    • Akihiro Motoki's avatar
      tox: run doc8 in pep8 · 262f099d
      Akihiro Motoki authored
      The gate doc/releasenotes jobs do not use tox targets and
      call sphinx directly, so doc8 check is not asserted in the gate.
      Considering this, this commit adds doc8 check to pep8 job
      to ensure doc8 check is applied.
      
      Change-Id: I9df403199264de36b1d0997871e32b29a6988c00
      262f099d
  26. Dec 27, 2017
  27. Nov 29, 2017
  28. Nov 22, 2017
    • Akihiro Motoki's avatar
      tox: allow to specify module when running pep8 env · 72a4f460
      Akihiro Motoki authored
      The horizon repo now contains three python modules: openstack_auth,
      horizon and openstack_dashboard. It is useful if we can specify
      a specific python module when running 'tox -e pep8'.
      
      Change-Id: I35d0f2a762806c52bd2fa0e863db500b4ae2c605
      72a4f460
  29. Nov 17, 2017
    • chao liu's avatar
      Add django.wsgi to target of pep8 · ff08536a
      chao liu authored
      The django.wsgi file should be adjusted to meet pep8 standards
      and apply pep8 check to django.wsgi automatically.
      
      Change-Id: Iaee708e95b7209c5ff19129a98af37914f320bd
      ff08536a
  30. Oct 09, 2017
  31. Sep 27, 2017
    • Rob Cresswell's avatar
      Add Django OpenStack Auth to Horizon · e3e5812b
      Rob Cresswell authored
      Moves Django OpenStack Auth content to Horizon, since they are so
      tightly coupled. This cleans up the development workflow and should
      make keystone / auth related contributions easier.
      
      Implements: blueprint merge-openstack-auth
      Change-Id: Ia1cdc47bad1ca6e633073a9f9445b0c7f70d05bc
      e3e5812b
  32. Sep 20, 2017
  33. Aug 21, 2017
  34. Jul 19, 2017
    • Akihiro Motoki's avatar
      Use doc8 check · 497cae2b
      Akihiro Motoki authored
      doc8 is a linter for documents and used in openstack-manuals.
      It is better to enforce document linters for simple checking.
      
      The current rules are really simple like:
      - line length check (80 chars)
      - new line at the end of file
      
      Change-Id: I3810df521068ffc97e25a5fc56b72397bf9783bc
      497cae2b
  35. Jul 08, 2017
    • Akihiro Motoki's avatar
      Fix py27dj18 definition · 9663f2f5
      Akihiro Motoki authored
      py27dj18 currently uses Django 1.10 (from upper-constraints.txt).
      The Django version should be specified explicitly.
      
      Change-Id: I23a6dda4da52a0758e2f3e3bff26795c161babb8
      9663f2f5
  36. Jul 07, 2017
    • Michael Dovgal's avatar
      Add '*.pyc' clean up for unit_tests · e6ea634c
      Michael Dovgal authored
      After updating code from actual branch we still use old *.pyc files.
      It can give an unexpected result, for instance, a lot of tests are
      broken due to unknown reasons.
      This patch fixes this issue.
      
      Change-Id: I3bdbad9748dc3d94d6d8914156604eab7ad877a0
      e6ea634c
Loading