1. 27 11月, 2018 1 次提交
    • C
      Selftests: respect pylint 2.2.0 checks · e28a2461
      Cleber Rosa 提交于
      The newly released pylint version 2.2.0, changed its default behavior
      (enabled) the following checks:
      
       * :unnecessary-pass (W0107): *Unnecessary pass statement*
         Used when a "pass" statement that can be avoided is encountered.
      
       * :unused-import (W0611): *Unused %s*
         Used when an imported module or variable is not used.
      
      Let's apply fixes to those checks, and at the same time, pin the
      pylint versions so that our CI environment is more stable (code that
      test our code -- pylint -- doesn't change, while our code changes).
      
      For Python 2, the latest release was 1.9.3, so let's use that.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      e28a2461
  2. 02 10月, 2018 1 次提交
    • C
      Add core test parameter passing support (non-varianter based) · 252f8be2
      Cleber Rosa 提交于
      Currently, the only way to pass parameters to Avocado is by using the
      variants layer, that is, one of the existing varianter plugin
      implementations.  This was based on earlier design decisions, that
      we're trying to fix without breaking expectation and compatibility.
      
      While it'd makes sense to support parameters created by the varianter
      layer itself, together with non-varianter parameters, it seems that we
      can start by adding support for one or the other being used at a time.
      
      This commit does exactly that: add support for a method of passing
      parameters via the command line for all tests in a job, without
      having to resort to the varianter.  When the varianter is used,
      it takes precedence and the core test parameter passing support
      is ignored.
      
      This should solve a number of use cases that require one-time
      executions of tests with different parameters, especially
      executions during test development and debugging.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      252f8be2
  3. 18 9月, 2018 1 次提交
  4. 04 9月, 2018 1 次提交
    • C
      Enables pylint w0621 · 628e35c3
      Caio Carrara 提交于
      This pylint checks for possible redefining outer names. Some occurrences
      was preserved with disable flag because they would broke some public
      api, like method/functions names or parameters.
      Signed-off-by: NCaio Carrara <ccarrara@redhat.com>
      628e35c3
  5. 25 8月, 2018 1 次提交
  6. 16 7月, 2018 1 次提交
    • C
      Asset Fetcher: add a fetch/build example test · a1855314
      Cleber Rosa 提交于
      This example test fetches two different files from different
      locations, and uses a data file (shipped *with* the test) on
      one of them.
      
      The goal is to demonstrate a complete example of files you
      may want to distribute with your test, and the assets you
      may want to fetch from remote locations.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      a1855314
  7. 19 6月, 2018 1 次提交
  8. 12 6月, 2018 1 次提交
  9. 11 6月, 2018 1 次提交
  10. 10 5月, 2018 1 次提交
  11. 11 4月, 2018 1 次提交
  12. 10 4月, 2018 1 次提交
  13. 27 3月, 2018 1 次提交
  14. 22 3月, 2018 1 次提交
  15. 21 3月, 2018 1 次提交
  16. 20 3月, 2018 1 次提交
    • C
      Travis-CI: whitelist style check errors · aadb1c9a
      Cleber Rosa 提交于
      The latest jobs have been failing because of the following issues:
      
          ************* Module raise
          E1130: 48,30: Raise.test: bad operand type for unary -: NoneType
          ************* Module selftests.functional.test_basic
          I1101:1191,24: PluginsXunitTest.run_and_check: Module 'lxml.etree'
          has not 'XMLSchema' member, but source is unavailable. Consider
          adding this module to extension-pkg-whitelist if you want to
          perform analysis based on run-time introspection of living
          objects.
          I1101:1191,40: PluginsXunitTest.run_and_check: Module 'lxml.etree'
          has not 'parse' member, but source is unavailable. Consider adding
          this module to extension-pkg-whitelist if you want to perform
          analysis based on run-time introspection of living objects.
          I1101:1193,43: PluginsXunitTest.run_and_check: Module 'lxml.etree'
          has not 'parse' member, but source is unavailable. Consider adding
          this module to extension-pkg-whitelist if you want to perform
          analysis based on run-time introspection of living objects.
          ************* Module selftests.unit.test_xunit
          I1101: 91,24: xUnitSucceedTest.test_add_success: Module
          'lxml.etree' has not 'XMLSchema' member, but source is
          unavailable. Consider adding this module to
          extension-pkg-whitelist if you want to perform analysis based on
          run-time introspection of living objects.
          I1101: 91,40: xUnitSucceedTest.test_add_success: Module
          'lxml.etree' has not 'parse' member, but source is
          unavailable. Consider adding this module to
          extension-pkg-whitelist if you want to perform analysis based on
          run-time introspection of living objects.
          I1101: 92,43: xUnitSucceedTest.test_add_success: Module
          'lxml.etree' has not 'parse' member, but source is
          unavailable. Consider adding this module to
          extension-pkg-whitelist if you want to perform analysis based on
          run-time introspection of living objects.
      
      We can't whitelist the `lxml.etree` module at this time (inspekt doesn't
      have such an option) and the raise failure is a false positive.  Let's
      ignore those issues then.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      aadb1c9a
  17. 14 3月, 2018 1 次提交
  18. 08 3月, 2018 1 次提交
  19. 27 2月, 2018 3 次提交
  20. 16 2月, 2018 1 次提交
    • C
      avocado.utils.process: use bytes for raw stdout/stderr · 7d0e6a44
      Cleber Rosa 提交于
      This brings a change in behaviour, in which the stdout/stderr of the
      executed process will now be of bytes type, instead of a string type.
      
      Two new attributes, which are implemented as properties, have been
      added to the CmdResult class, `stdout_text` and `stderr_text`.  Those
      are convenience methods that will return the same content that is in
      `stdout` and `stderr`, reespectively, but decoded on the fly[1].
      
      With regards to encoding, if one is not provided, the result of
      `sys.getdefaultencoding()` will be used ("utf-8" for Python 3 and
      "ascii" for Python 2).
      
      Applications and/or tests using the APIs that return a CmdResult
      should, to the best of my knowledge, set a default encoding themselves
      so a stable behavior across Python versions.  But that if left to
      users of this API.
      
      A different tradeoff/design decision has to do with the tests modified
      here.  One option is to have "text" (as in sequences of human readable
      glyphs) as being of Python type "str".  On Python 2, "str" can be
      compared to "bytes" because a conversion will happen on demand.  That
      is, the following is fine on Python 2:
      
         >>> result = process.run("command")
         >>> "expected" in process.stdout
      
      Where `expected` is of type "str" and `process.stdout` is of type
      "bytes".  This is not true of Python 3, so either the types must match
      or a conversion must be done explicitly.  The solutions to that are:
      
      1) have these "text" as (of type) "bytes" in the source code itself,
         and avoid the conversion whenever possible
      2) have "strings" in the source code itself, and use the conversion
         provided by `CmdResult.stdout_text` and `CmdResult.stderr_text`.
      
      The approach chosen here is to avoid conversion if possible, that is,
      use "byte" types, given the fact that the source code encoding is by
      default 'ascii' and most of the "text" dealt with here can be
      represented in 'ascii' too.  This is equivalent of doing:
      
         result = process.run("command")
         b"expected" in process.stdout
         "errors: %s" % 0 in process.stderr_text
      
      [1] The obvious alternative, instead of decoding these on the fly
          would be to have multiple copies of the "same" data.  This assumes
          that binary data produced on the stdout/stderr will usually be
          larger than textual data.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      7d0e6a44
  21. 15 2月, 2018 2 次提交
  22. 02 1月, 2018 2 次提交
  23. 24 12月, 2017 1 次提交
  24. 06 12月, 2017 1 次提交
  25. 01 12月, 2017 1 次提交
  26. 30 11月, 2017 2 次提交
    • A
      examples: fix doublefree test · 472a65d9
      Amador Pahim 提交于
      Double free errors are silent in Fedora 27, making the test
      doublefree.py to fail.
      
      Using `MALLOC_CHECK_=1` is guaranteed to expose the double free
      errors, regardless the OS double free handling. This patch updates
      the doublefree.py test to use the `MALLOC_CHECK_=1` approach.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      472a65d9
    • C
      Output Check: documentation update · 8aa56d58
      Cleber Rosa 提交于
      The documentation and examples on the output check feature are
      outdated or innaccurate.
      
      For instance, the synctest.py example would produce different output
      than recorded in the accompanying reference files because the API
      parameters were not being respected.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      8aa56d58
  27. 14 10月, 2017 2 次提交
  28. 13 10月, 2017 1 次提交
  29. 14 8月, 2017 1 次提交
  30. 07 8月, 2017 1 次提交
    • L
      test: Remove unnecessary LazyProperty from Test class · f5ae8ed8
      Lukáš Doktor 提交于
      Most of the LazyProperty variables in Test are actually always read on
      "get_state" and other occasions so it does not make sense to set it
      Lazily.
      
      Also protect the remaining lazily initialized property from overriding
      by using @property instead of our custom LazyProperty, which is not
      really a property.
      
      This commit requires some adjustments to nasty example tests which used
      to override self.srcdir, which is not allowed (and restricted since this
      commit).
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      f5ae8ed8
  31. 23 6月, 2017 1 次提交
  32. 27 3月, 2017 1 次提交
  33. 10 3月, 2017 1 次提交
  34. 08 3月, 2017 1 次提交