1. 25 9月, 2015 1 次提交
  2. 24 9月, 2015 1 次提交
  3. 18 9月, 2015 3 次提交
  4. 17 9月, 2015 1 次提交
  5. 15 9月, 2015 1 次提交
    • L
      avocado.core.test: Avoid passing ugly exceptions · 73c8cefb
      Lukáš Doktor 提交于
      Currently when one passes exception, which is not instance of Exception,
      avocado proceeds and returns "INTERRUPTED" test instead of "ERROR". This
      for example happens when old-style-class is used as exception. This
      patch uses pure "except" without any argument to catch such exceptions
      and then it wraps them in "exceptions.TestError" instead.
      
      The same applies to "setUp" and "tearDown", they only use different
      class as a wrapper.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      73c8cefb
  6. 11 9月, 2015 1 次提交
  7. 04 9月, 2015 1 次提交
  8. 03 9月, 2015 6 次提交
    • L
      selftests/functional/test_interrupt.py: Fix NoSuchProcess bug · 8a5e28d8
      Lucas Meneghel Rodrigues 提交于
      If between psutil.procs() and the instantiation of the Process
      object the given pid has terminated, we'll get a NoSuchProcess
      error from psutils. Let's expand the list comprehension to avoid
      getting caught by such a condition.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      8a5e28d8
    • C
      selftests/doc/test_doc_build.py: convert to a unittest test · b8bd211f
      Cleber Rosa 提交于
      All other tests (unit and functional) are based on unittest. Let's do
      the same to this one, so that the default unittest discover code finds
      it and runs it.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      b8bd211f
    • C
      Selftests: remove evil "simple import magic" · 6149e2dc
      Cleber Rosa 提交于
      Even though I may be the one to blame about coming up with this
      "simple import magic", I believe it was a mistake and we should get
      rid of them.
      
      There are a couple of other ways to actually do development out of
      of a source tree, including running unittests that do not require
      this amount of boiler plate code. Examples include just setting
      the PYTHONPATH environment variable to actually run (setuptools based)
      `python setup.py develop`.
      
      The little bits of what looks like the import magic that was left, is
      not really import magic. It's just that functional tests need to locate
      the Avocado source tree base directory to run the test runner from it.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      6149e2dc
    • C
      Selftests: drop nose usage for plain unittest discovery · e9c0d813
      Cleber Rosa 提交于
      The unittest module, and unittest2 backport on Python 2.6, is capable of
      finding unittests and running them. So, effectively, we do not need nose
      at all.
      
      This patch removes the dependency on nose, replacing the run script
      with a version based solely on the unittest module.
      
      One change of functionality is that run now looks and runs tests in the
      standard selftests directories (unit, functional, doc), and does not
      accept command line arguments. If one wants to run a subset of them,
      it's pretty easy to just use the unittest module for that:
      
       $ python -m unittest discover -s selftests/unit
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      e9c0d813
    • C
      selftests/functional/test_interrupt.py: silence the test · dae3ea22
      Cleber Rosa 提交于
      When running this functional test with the standard unittest
      discovery/runner it produces output that conflicts with the runner
      output.
      
      It looks like this output is not necessary for the test itself, and
      not that helpful for debugging purposes, so, let's just silence it.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      dae3ea22
    • C
      Selftests: move to adhere to unittest discover default pattern · 24d87eb4
      Cleber Rosa 提交于
      To be honest, our test code could still be kept in the same directories and
      have the same names. But I think we can improve two things here:
      
      1) Flatten a little bit the directory structure of selftests. Two path
      components are being dropped here: "all" and "avocado". So that
      "selftests/all/functional/avocado" becomes simply
      "selftests/functional".
      
      2) File names match what is, by default, recognized by unittest (the
      Standard Library module) based discovery of tests. That means that
      doc_build_test.py becomes test_doc_build.py. Not a big deal IMHO.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      24d87eb4
  9. 15 8月, 2015 1 次提交
  10. 14 8月, 2015 1 次提交
  11. 13 8月, 2015 1 次提交
    • C
      Inner Runner implementation · f364a1ab
      Cleber Rosa 提交于
      In some external test suites, what is defined as a "test" can not be
      run by itself and need a specific runner script/tool.
      
      This introduces the concept of an "inner runner", that is, a custom
      test runner or tool that can deal with custom tests that do follow
      the Avocado SIMPLE test definition.
      
      This implements the Trello card:
      
       https://trello.com/c/TpXecE2n/486-introduce-inner-runner-to-avocado-run
      
      More information can be found in the man page section about it.
      
      Changes from v1:
       * removed "level" from "inner level runner" mentions
       * replicated docs from man page to "main" docs
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      f364a1ab
  12. 10 8月, 2015 1 次提交
  13. 04 8月, 2015 1 次提交
  14. 31 7月, 2015 2 次提交
  15. 30 7月, 2015 3 次提交
  16. 28 7月, 2015 3 次提交
    • L
      avocado: Shorter app output · c1728093
      Lucas Meneghel Rodrigues 提交于
      Instead of putting outputs on separate lines, condensate
      test results summary into a single line. The new output
      looks like:
      
      $ avocado run passtest
      JOB ID     : f2f5060440bd57cba646c1f223ec8c40d03f539b
      JOB LOG    : /home/user/avocado/job-results/job-2015-07-27T17.13-f2f5060/job.log
      JOB HTML   : /home/user/avocado/job-results/job-2015-07-27T17.13-f2f5060/html/results.html
      TESTS      : 1
      (1/1) passtest.py:PassTest.test: PASS (0.00 s)
      RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0
      TIME       : 0.00 s
      
      We updated a few unittests in order to not depend on the
      looks of the human output anymore, since unless we are
      specifically testing for human output behavior, the unittests
      should use machine readable output. Also, the documentation
      was updated to reflect the new output layout.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      c1728093
    • L
      avocado.utils.astring: Remove trailing whitespaces from tabular output · d83516e1
      Lucas Meneghel Rodrigues 提交于
      We did notice that listing commands have trailing whitespace
      at their ends. Trailing whitespaces are bad for program output
      (copy/paste, among other reasons), so let's fix it.
      
      I did notice there was no reason to not implement the base
      function for the tabular output as a generator, so I've
      introduced iter_tabular_output, that is a generator, and
      in order to not break API unnecessarily, implemented
      tabular_output in terms of iter_tabular_output.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      d83516e1
    • L
      selftests: astring_unittest.py: Fix incorrect assertion · e1c38c1b
      Lucas Meneghel Rodrigues 提交于
      This is a rather embarassing bug. We should be testing
      for equality of outputs, so assertEqual instead of
      assertTrue (which in effect makes the test always pass,
      regardless of the avocado output). Let's fix it.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      e1c38c1b
  17. 20 7月, 2015 1 次提交
    • L
      avocado.core.loader: Refactor test loader to be consistent · 3573b193
      Lukáš Doktor 提交于
      Previously the "file" loader was special and always matched the URL
      which might be confusing and lead to problems when developing additional
      plugins.
      
      This commit tires to define the way loaders should work. They must never
      fail (unless of uncaught exception which is reported and next available
      plugins is used). Instead when the URL produces broken test or even a
      single corrupted subtest, consider it as URL not for me and return empty
      set. The loader proxy uses next plugin to resolve this URL. When no
      plugin resolves the URL user is advised to run "avocado list -V" to see
      the potential problems.
      
      The order of loader plugins was also changed. Now the file-loader is
      first by default and all remaining ones are loaded by the plugin
      priority. The order can be changed in setting
      "plugins/loader_plugins_priority". It uses "name" variable of the each
      loader plugin. Not listed plugins are loaded afterwards.
      
      Additionally the whole loader API was simplified. Now it only accepts
      one parameter - list_tests - which is 3-state:
      
      1. ALL       - all tests including broken/incorrect ones
      2. AVAILABLE - available tests (for listing purposes)
      2. DEFAULT   - default tests (to run when no url given)
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      3573b193
  18. 16 7月, 2015 1 次提交
    • L
      avocado.core.loader: Remove job from test loader · a87645ce
      Lukáš Doktor 提交于
      Test loader doesn't need to know anything about the job, the only useful
      argument is `args`.
      
      Second big change is the way loader is used. This patch uses list of
      registered plugins on module-level (similarly to settings or logging)
      instead of custom instance and plugins registered in args dict. This way
      the plugins are loaded in the order they are registered (by plugin
      priority) instead of random order.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      a87645ce
  19. 08 7月, 2015 1 次提交
  20. 07 7月, 2015 3 次提交
  21. 26 6月, 2015 2 次提交
  22. 24 6月, 2015 1 次提交
  23. 18 6月, 2015 3 次提交