1. 06 2月, 2017 1 次提交
  2. 07 11月, 2016 1 次提交
  3. 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
  4. 24 2月, 2016 2 次提交
    • L
      avocado.core: Merge avocado.core.log into avocado.core.output · b6496893
      Lukáš Doktor 提交于
      Those two are interconnected, let's keep them in one file instead of
      local imports.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      b6496893
    • 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
  5. 23 2月, 2016 1 次提交
    • L
      avocado.core.output: Rename add_console_handler to add_log_handler · 7b3c553d
      Lukáš Doktor 提交于
      The function "add_console_handler" is quite useful. This patch extends
      it's capabilities and renames it to fit the new purpose.
      
      Because the new default logging level for "add_log_handler" is INFO,
      we add the "avocado.test" and root logger to level DEBUG.
      
      Then finally a few adjustments to the tests that rely on specific
      log format and level:
      
      1) selftests/functional/test_multiplex.py: adapt to changes in
      test logger That means that extra prefixes ('avocado.test') are
      printed out on each line when avocado is run with '--show-job-log'.
      While at it, be more precise and check for the specific params at the
      specific run with the given variant, instead of looking for a given
      param in the output of the three tests variants.
      
      2) selftests/functional/test_standalone.py: adapt to the change of
      log prefix ('avocado.test') and extra line because of DEBUG level.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      7b3c553d
  6. 30 10月, 2015 1 次提交
    • 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
  7. 18 9月, 2015 1 次提交
  8. 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
  9. 03 9月, 2015 2 次提交
    • 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: 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
  10. 31 7月, 2015 1 次提交
  11. 07 7月, 2015 1 次提交
  12. 14 4月, 2015 1 次提交
  13. 19 3月, 2015 1 次提交
    • L
      avocado.core.output: Make stream logging to point to stdout · 43a4751d
      Lucas Meneghel Rodrigues 提交于
      It is more natural [1] that output of --show-job-log goes to
      stdout than stderr. Let's change that behavior and update
      unittests accordingly.
      
      [1] Natural in this sense is defined by the user's expectation -
          when setting avocado to --show-job-log, you expect that the
          job log *is* in the application's stdout.
      
      Changes from v1:
       * Python 2.6 constructor param for StreamHandler is strm,
         that was changed in 2.7 to be stream. Let's keep compatibility
         by using positional arguments.
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      43a4751d
  14. 18 3月, 2015 1 次提交
  15. 04 3月, 2015 1 次提交
    • L
      avocado.test: Fortify avocado before very nasty exceptions · fda1dde4
      Lukáš Doktor 提交于
      The NastyException error is back:
      
      class NastyException(Exception):
          def __init__(self, msg):
              self.msg = msg
          def __str__(self):
              return self.msg
      
      crashes Avocado. The problem is we are trying to re-raise the exceptions
      and then read the traceback again. Even reading of the details of this
      very nasty written exception causes critical failure.
      
      What this patch does instead of handling issues wherever we produce
      them, it waits till the exception bubbles to the entry-point and it
      tries to read it. If it fails, we log the original traceback
      (information about the failure) and then user-friendly message saying
      we're unable to retrieve the original failure.
      
      Additionally I had to modify the xunit output as in case of very nasty
      inputs it's unable to reproduce the values.
      Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
      fda1dde4
  16. 27 2月, 2015 1 次提交
  17. 29 1月, 2015 1 次提交
  18. 28 11月, 2014 1 次提交
  19. 25 11月, 2014 1 次提交
  20. 12 9月, 2014 1 次提交
    • L
      avocado: Move tests to example/tests · c04cbf42
      Lucas Meneghel Rodrigues 提交于
      We have tests/ and selftests/ in avocado (the test runner).
      The former includes examples of tests that make use of the
      avocado API, and are also used to test avocado via CI.
      
      This is confusing, as it doesn't make it clear to users that
      tests are not part of the avocado framework. Since we have a
      directory called examples with some other files (multiplexer,
      plugins), move the tests to there (and keep using them in the CI).
      Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
      c04cbf42
  21. 29 7月, 2014 1 次提交
  22. 15 5月, 2014 1 次提交