1. 18 12月, 2015 2 次提交
    • C
      Old Plugin Architecture: disable legacy plugin manager completely · a0d4cd77
      Cleber Rosa 提交于
      At this point, no plugin support exists in Avocado. This is in
      preparation for the new plugin code to be cleanly introduced.
      
      The plugins that play a role in the plugin architecture have
      been removed, since they wouldn't be functional under the new
      plugin management code. The ones that are add extra functionality
      to Avocado have been kept, and will be ported to the new
      architecture.
      
      Also, most of the functional tests have been temporarily disabled.
      The reason is that most of them run avocado, which depends on the
      run command, which in turn, depends on the plugin archicture code.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      a0d4cd77
    • C
      Command line parser: only show the basic usage info by default · 4dd666e3
      Cleber Rosa 提交于
      This shows a more succint version of the help message (the so called
      "usage" information). It's a certainly a matter of taste and change
      of behavior, so this is marked as an RFC.
      
      It also avoids a hackish injection of the print_help method as the
      default dispatch method.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      4dd666e3
  2. 16 12月, 2015 1 次提交
  3. 15 12月, 2015 1 次提交
    • C
      selftests/functional/test_output.py: skip test on absence of PIL library · 5f7bafd0
      Cleber Rosa 提交于
      The `test_gendata` test of `OutputTest` runs the example test
      `gendata.py`, but the `gendata.py` itself has a conditional in one of
      the tests that make use of the PIL (aka Pillow package) library and
      does nothing if it's missing.
      
      PIL (Pillow) is highly dependent on C compilers and libraries to be
      able to build itself. This makes systems it harder to run the full
      Avocado self tests on more diverse (usually minimalist) systems.
      
      So, let's make that functional test optional, if the libraries are not
      present.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      5f7bafd0
  4. 11 12月, 2015 1 次提交
    • C
      Human output: functional test fixes · cb4b6d97
      Cleber Rosa 提交于
      There are a couple of functional unittests that assume that a given
      output was produced by the regular UI, that is, the Human output
      format.
      
      That is fine, since they're functional tests. But, some situations
      lead to test errors, instead of pointing failures. Let's turn those
      into explicit checks and fail properly instead of producing errors.
      
      Note: These errors were visible when the human output was disabled, in
      the plugin overhaul work, but the fixes still make sense independently
      of that work.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      cb4b6d97
  5. 07 12月, 2015 1 次提交
    • C
      virtualenv: allow tests to run properly on them · 63aa6df6
      Cleber Rosa 提交于
      While going through the dependency list (requirements*.txt files) and
      performing our self tests out of virtual environments, I noticed that
      some tests are run outside the virtual environments.
      
      The reason is that, even though the virtual environment is activated
      for the test session (and say, `which python` gives `/venv/bin/python`),
      we have hard coded `/usr/bin/python` in most places.
      
      According to the some discussions on the virtualenv project itself[1],
      a quick solution is to revert to the also common `/usr/bin/env python`
      way of pointing to the Python interpreter.
      
      [1] - https://github.com/pypa/virtualenv/issues/124Signed-off-by: NCleber Rosa <crosa@redhat.com>
      63aa6df6
  6. 03 11月, 2015 1 次提交
  7. 30 10月, 2015 2 次提交
    • C
      Exit codes: use symbolic names in functional self tests · 49fcd32c
      Cleber Rosa 提交于
      Since we define the meaning of each exit code, we should be using that
      ourselves.
      
      Functional tests have been coded using literal values, and there may
      be a good reason for that: proving that the API stands.  But there's a
      big issue: we have not declared those codes as some kind of an
      external API and guarantee stability. Also the subsequent changes in
      this series actually change the meaning and values of those.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      49fcd32c
    • L
      avocado: Add support for --dry-run · 069e3784
      Lukáš Doktor 提交于
      It's prone to mistakes maintain two separate ways to query for tests
      (running them and displaying available ones).
      
      This patch implements --dry-run, which follows the full "run" process,
      only instead of running the test it skips them.
      
      Additionally the --dry-run uses some tweaks to tell them apart from
      normal executions, namely:
      
          1. No sysinfo gathering
          2. Unique id is 0000000000000000000000000000000000000000
          3. Unless user provides custom log location, fresh tmpdir is used
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      069e3784
  8. 28 10月, 2015 1 次提交
    • C
      Plugins: remove external plugin support · 7b969527
      Cleber Rosa 提交于
      In preparation for the large plugin refactor, let's simplify the code ASAP
      and drop related (custom) functionality that is going to be replaced.
      
      Standard setuptools entrypoints is going to provide better capability then
      our custom code that supports external 'avocado_*.py'module loading.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      7b969527
  9. 08 10月, 2015 1 次提交
    • L
      avocado: Mass import cleanups · f4e82a6e
      Lucas Meneghel Rodrigues 提交于
      This is an automated mass import cleanup across all
      avocado source files:
      
      1) Imports follow the order:
       * Standard library imports
       * Non standard library external imports
       * Internal imports
       All separated by a single line
      2) One line between imports and the rest of the code
      3) Remove unused imports in the process
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      f4e82a6e
  10. 07 10月, 2015 2 次提交
  11. 01 10月, 2015 4 次提交
    • C
      Test Loader: drop support and remove all mentions of BUGGY tests · 153497f7
      Cleber Rosa 提交于
      The BUGGY test concept relies on loading/executing the Python file
      containing the tests and failing to do so. Since Avocado won't
      load/execute Python test files anymore, it's not possible or desirable
      to keep the BUGGY tests around.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      153497f7
    • C
      Test Loader: add test for multiple classes support in a single file · 5a8eb35f
      Cleber Rosa 提交于
      There's no real reason why a single Python file can not hold multiple
      test classes, each one with its own tests.
      
      This test adds a simple Python test file with two classes, each one
      with its own test, and expects the loader to find two instrumented
      tests.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      5a8eb35f
    • C
      Test Loader: add test for safer loading of tests before execution · 392aa961
      Cleber Rosa 提交于
      The test loader should only load (import, thus execute) Python test
      modules at test execution time. During, for example, test discovery
      and listing time, the Python modules should never be imported (thus
      executed).
      
      This introduces a test called "sleep eleven" (because "ten" is boring)
      that "accidentally" has a `time.sleep(11)` at the global scope. This
      test is listed by executing `avocado list -V sleepeleven.py` and is
      given 3 seconds to finish. If the loader actually loads/executes the
      Python code, it will fail because it will take at least a little bit
      more then 11 seconds.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      392aa961
    • L
      avocado.core.loaders: Make it possible to specify test loaders · fddbd88c
      Lukáš Doktor 提交于
      Currently we can only specify the loader plugins order via settings.
      This patch adds "--loaders" argument and improves the granularity.
      Now it's possible to set either @plugin_name, or TEST_TYPE, where
      TEST_TYPE is the mapped name of the plugin (eg. SIMPLE, VT, ...)
      
      There is one special name "DEFAULT", which injects all unspecified
      loaders in the position of the "DEFAULT" keyword. When "DEFAULT" is
      not specified, not-listed plugins/test_types are not evaluated.
      (therefor it's possible to restrict some test loaders or only some
      test types).
      
      As the usecase changed slightly, the settings option was renamed
      from plugins.loader_plugins_priority to plugins.loaders.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      fddbd88c
  12. 30 9月, 2015 3 次提交
  13. 24 9月, 2015 1 次提交
  14. 18 9月, 2015 2 次提交
  15. 17 9月, 2015 1 次提交
  16. 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
  17. 03 9月, 2015 4 次提交
    • 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: 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/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