1. 03 5月, 2016 1 次提交
    • L
      avocado.core.loader: Fix the test alias resolver · 3ff48800
      Lukáš Doktor 提交于
      This patch fixes and improves resolving of the test aliases (paths
      relative to `data_dir.get_tests_dir`).
      
      1. It removes the magic `.py` suffix, which prevented non-python files
         from being resolved (simple.sh was resolved to $tests/simple.sh.py)
      2. It adds the feature to filter the class/method from the test
         reference by parsing $test_reference:$class.$method for implicit
         resolver. (previously this worked only for absolute path resolver)
      
      Visible changes are:
      
      * `avocado run passtest` => fails (used to work)
      * `avocado run passtest.py` => works (did not work)
      * `avocado run env_variables.sh` => works (did not work)
      * `avocado run passtest.py:PassTest.test` => works (did not work)
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      3ff48800
  2. 27 4月, 2016 1 次提交
    • C
      Avocado: Release 35.0 · 523c0e41
      Cleber Rosa 提交于
      This release introduces a new versioning scheme, so the "big bump"
      from 0.34.0 to 35.0 is not such a big bump.
      
      Some additional changes with regards to versioning were added, such as
      the way the remote runner checks for Avocado on the remote host.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      523c0e41
  3. 26 4月, 2016 1 次提交
    • L
      avocado: Implement serialized test ids · 5973e898
      Lukáš Doktor 提交于
      This commit implements the serialized test ids described in the
      Introduce proper test IDs RFC.
      
      https://www.redhat.com/archives/avocado-devel/2016-March/msg00024.html
      
      It implements `TestName` class, which contains the test uid, test name
      and the variant uid and allows querying for the file-system-friendly
      name.
      
      The workflow is:
      
      1. tests are discovered, name is translated to "Test Name" by loader
      2. test_suite is passed to the runner (new) along with the number of
         tests+variants to be executed (used to get number of digits)
      3. the Mux (params generator) yields the template + (new) variant id
      4. the runner replaces template['name'] to TestName(uid, test_name,
         variant_id); where uid is currently no executed tests, test_name is
         the original name from Loader and variant_id is either None or the
         variant index.
      
      This commit makes the `tag` argument unused. To avoid problems a warning
      is issued on it's usage so we can remove it in the upcoming releases.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      5973e898
  4. 13 4月, 2016 2 次提交
  5. 11 4月, 2016 1 次提交
    • L
      avocado.core.test: Avoid None status on early exception · af10c0df
      Lukáš Doktor 提交于
      When avocado fails early in the process (for example in
      _setup_environment_variables) it crashes, because the test status is
      None. Other example could be user-defined status, which is not inside
      user-facing-statuses.
      
      This patch modifies the "status" to "ERROR" when test reports
      unsupported status and sets related values to provide details regarding
      this failure.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      af10c0df
  6. 07 4月, 2016 1 次提交
    • A
      avocado.code.job fix job return code on timed out jobs · 41177f0a
      Amador Pahim 提交于
      When a job is timed out during a test execution, we fail the test
      and put status ERROR in the test. The job then exits with the rc
      AVOCADO_TESTS_FAIL. This patch fixes this, making the test status
      INTERRUPTED and the job to exit with AVOCADO_JOB_INTERRUPTED.
      
      Also, when a job is timed out before a test, the test is skipped
      and the job exits with rc AVOCADO_ALL_OK. For that case, this patch
      makes the job to exit with AVOCADO_JOB_INTERRUPTED instead, keeping
      the test status as SKIP.
      
      Given this change, now we have the following combinations of test status
      and job return code:
      
      Case1:
          - Test1: PASS
          - Test2: SKIP (TestTimeoutSkip)
      
          Job RC: AVOCADO_JOB_INTERRUPTED
      
      Case2:
          - Test1: PASS
          - Test2: INTERRUPTED (TestTimeoutInterrupted)
          - Test3: SKIP (TestTimeoutSkip)
      
          Job RC: AVOCADO_JOB_INTERRUPTED
      
      Case3:
          - Test1: PASS
          - Test2: FAIL
          - Test3: INTERRUPTED (TestTimeoutInterrupted)
          - Test4: SKIP (TestTimeoutSkip)
      
          Job RC: AVOCADO_JOB_INTERRUPTED
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      41177f0a
  7. 30 3月, 2016 1 次提交
  8. 18 3月, 2016 1 次提交
    • C
      External Runner: deal with empty test URL · 139e717b
      Cleber Rosa 提交于
      A test base on the external runner feature depends on both the
      external runner and the test URL. These two are always combined to
      generate the complete command that will be executed by Avocado.
      
      But, the Avocado command line application does not require URLs to be
      given on the command line, because these may come from other sources
      on loaders other than the basic FileLoader.
      
      So, let's also explicitly require a URL to be given to to the External
      Runner loader to return a test factory (class and parameters).
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      139e717b
  9. 16 3月, 2016 1 次提交
    • L
      avocado.core: Log all messages to sys.stdout except of errors · f5acea12
      Lukáš Doktor 提交于
      While working on the avocado logging system we thought it'd be
      consistent and better to log certain streams to sys.stderr rather than
      sys.stdout. It turned out to be a bit confusing and unexpected, so after
      a discussion this commit adjusts the streams to:
      
       * avocado.app - loglevel <= info goes to stdout
                     - loglevel > info goes to stderr
       * other streams - go always into stdout
       * sys.stdout - goes to sys.stdout when enabled
       * sys.stderr - goes to sys.stderr when enabled
                    - goes to sys.stdout when enabled as test output
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      f5acea12
  10. 10 3月, 2016 1 次提交
    • C
      selftests/functional/test_basic.py: extend timeout on test_kill_stopped_sleep · 27029ff4
      Cleber Rosa 提交于
      Given the last CI jobs, RunnerSimpleTest:test_kill_stopped_sleep() has
      been failing often. The obvious reason, given the nature of the test
      and the heavily shared and loaded computing resources they run on, is
      the lack of resources.
      
      One example of such as failure:
      
         ======================================================================
         FAIL: test_kill_stopped_sleep (selftests.functional.test_basic.RunnerSimpleTest)
         ----------------------------------------------------------------------
         Traceback (most recent call last):
           File "/home/travis/build/avocado-framework/avocado/selftests/functional/test_basic.py", line 549, in test_kill_stopped_sleep
             % proc.get_output())
         AssertionError: Avocado process still alive 1s after job-timeout:
         JOB ID     : 5c65a06b4ab15e69d6c4a1fc762368e0e99cbc1f
         JOB LOG    : /tmp/avocado_selftests.functional.test_basicHIyhV4/job-2016-03-09T15.08-5c65a06/job.log
         TESTS      : 1
          (1/1) /bin/sleep 60:
         ctrl+z pressed, stopping test (5046)
         ERROR
      
      So, let's give 4 extra seconds for the process to be
      terminated. Hopefully failures in the timeout handling will still be
      revealed given the relatively small buffer.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      27029ff4
  11. 04 3月, 2016 1 次提交
    • C
      avocado/core/data_dir.py: make data_dir settings dynamic · be47dcc4
      Cleber Rosa 提交于
      The configurations related to the "data_dir" are currently read at
      module load time. This means that changes in the configuration between
      module load time and changes to the settings (such as parsing an
      additional config file) is never seen.
      
      Since the avocado command line application parses extra configuration
      files (given with `--config`) after the module is loaded, these extra
      configuration files are never applied to the data_dir configuration.
      
      There's one more issue with regards to the the settings usage: because
      once references to the `settings` instance singleton are grabbed, they
      will always point to the same settings objects. The data_dir unittests
      exercise changes to the settings objects by replacing that
      instance. So, let's refer to the settings using the full location
      (module.attribute), which will always give back the "current" (be it
      original or replaced) settings instance.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      be47dcc4
  12. 03 3月, 2016 2 次提交
  13. 24 2月, 2016 2 次提交
    • C
      raise/except statements: mass style change · 2b2f6fca
      Cleber Rosa 提交于
      This commit changes the idiom on (hopefully all) except statements,
      from:
         except foo, details:
      
      to:
         except foo as details:
      
      Which is compatible with both Python 2 and 3.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      2b2f6fca
    • L
      avocado: Change logging initialization · 83a50b5f
      Lukáš Doktor 提交于
      This patch changes the way logging is initialized in avocado app:
      
      1. stdout/stderr/logging is replaced with in-memory handlers
      2. when arg parsing is done, logging is reconfigured accordingly to
         setting and re-logs stored messages (when streams are enabled)
      3. when job starts and "test" stream is enabled, "" and "avocado.test"
         streams are enabled
      4. when job finishes and "test" stream enabled the additional outputs,
         the additional outputs are disabled again.
      
      The 3 and 4 is necessarily as the "" logger contains all logs including
      avocado initialization (stevedore, PIL, ...). This way the "test" stream
      still outputs everything, but only during the job-execution and not
      during avocado initialization and cleanup. (one can use "early" log to
      see those).
      
      Last but not least it keeps "avocado.app" output in stdout (and stderr),
      but it moves all other outputs to stderr instead. This is IMO better
      handling as one can distinguish between debug and "additional" output.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      83a50b5f
  14. 12 2月, 2016 1 次提交
  15. 04 2月, 2016 1 次提交
  16. 03 2月, 2016 1 次提交
    • L
      avocado.core.runner: Force methodName on replay_map substitution · d74158ec
      Lukáš Doktor 提交于
      The "replay_map" allows to substitute the test class with custom class.
      The problem is, that the "methodName" defined in "test_params" might not
      exist in this class.
      
      We have two choices, either leave it up to the user, to substitute with
      a compatible class (eg. by creating the "methodName" in "__init__"
      before calling the super.__init__), or we can require them to always use
      given "methodName". This patch uses the second approach as it seems less
      magical to me.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      d74158ec
  17. 27 1月, 2016 1 次提交
  18. 07 1月, 2016 2 次提交
    • C
      selftests/functional/test_basic.py: remove references to old Plugin · c4180e95
      Cleber Rosa 提交于
      There are a few leftover references to the old Plugin classes in
      the functional tests. Let's remove them.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      c4180e95
    • L
      avocado.core.loader: Append test directory to sys.path · 62ae0d60
      Lucas Meneghel Rodrigues 提交于
      If a test has local imports (a fairly common use case),
      we have to append the base test dir to sys.path. Otherwise,
      we end up having a horrible traceback as a result:
      
      Exception loading test
      Traceback (most recent call last):
        File "/home/lmr/Code/avocado.lmr/avocado/core/runner.py", line 200, in _run_test
          instance = loader.load_test(test_factory)
        File "/home/lmr/Code/avocado.lmr/avocado/core/loader.py", line 262, in load_test
          test_module = imp.load_module(module_name, f, p, d)
        File "scylla_longevity.py", line 5, in <module>
          from sdcm.tester import ScyllaClusterTester
      ImportError: No module named sdcm.tester
      
      Which is clearly not wanted. We had this problem before
      and now we have a regression. It's time for a functional
      test to make sure we don't regress again.
      Signed-off-by: NLucas Meneghel Rodrigues <lookkas@gmail.com>
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      62ae0d60
  19. 18 12月, 2015 10 次提交
  20. 03 11月, 2015 1 次提交
  21. 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
  22. 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
  23. 07 10月, 2015 2 次提交
  24. 01 10月, 2015 1 次提交
    • 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
  25. 30 9月, 2015 1 次提交