1. 28 10月, 2016 1 次提交
    • C
      Plugins: introduce archive result plugin · 5332f7a3
      Cleber Rosa 提交于
      The archive (ZIP) feature has no reason for reason for being
      a core feature, as it maps nicely to the result plugin interface.
      
      Let's turn that into a proper (and quite simple) plugin.
      
      Also, let's add a functional test for both the archive plugin, and for
      the ordered execution configuration using the zip archive for that.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      5332f7a3
  2. 27 10月, 2016 24 次提交
  3. 26 10月, 2016 15 次提交
    • A
      remote: don't copy files for remote executions · 9d483a36
      Amador Pahim 提交于
      Currently, if not explicitly disabled, we copy the test files for
      remote executions. This approach has a number of issues and does not
      cover all the cases.
      
      This patch removes the copy of test/multiplex files for remote
      executions, making necessary for the remote instance to have the files
      available in the indicated locations.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      9d483a36
    • A
      remote: improve error handling from remote executions · 784f3040
      Amador Pahim 提交于
      A remote job can fail for a number of reasons other than remote access
      timeout (the only error handled so far).
      
      This patch makes the job to exit nicely, showing the message from
      remote job, in case we cannot parse the json output from the remote job.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      784f3040
    • A
      remote: create a `DummyLoader` and use it in 'remote' · 357cebf0
      Amador Pahim 提交于
      In order to remove the hack used to fake the test_suite inside the job
      when a remote execution is in place, this patch creates a new loader
      class called DummyLoader, which returns the test suite with test
      `SkipTest` and the file path as test name. The goal is to not engage
      default test loaders when we are in a remote execution.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      357cebf0
    • A
      refactor the total number of tests probe · 5f502d2b
      Amador Pahim 提交于
      Currently, the Job() is in charge to probe the number of tests. But
      depending on the test runner in use, this information can be impossible
      to probe before calling the test runner. For example, using the remote
      test runner, we have no guarantee that the information used to create
      the test_suite (test files, and multiplex files) will be available
      locally, where the job is processed.
      
      This patch transfer the probe of the number of tests to the test
      runner. Also, the Result class was prepared to accommodate this change,
      making the total number of tests configurable by calling
      ResultProxy.set_tests_total().
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      5f502d2b
    • A
      avocado.utils.process: execute default int handler · 56e649ea
      Amador Pahim 提交于
      In order to exit subprocess gracefully, our library overrides the
      default SIGINT handler with a custom handler that waits for the
      subprocess. Since the default SIGINT handler raises a KeyboardExeption,
      which is expected by the caller, and our custom handler does not, this
      patch calls the default handler from inside our custom handler, after
      the steps required to exit the subprocess gracefully.
      
      Reference: https://trello.com/c/NZPg155xSigned-off-by: NAmador Pahim <apahim@redhat.com>
      56e649ea
    • A
      Merge branch 'clebergnu-job_phases_v3' · 3c10b4de
      Amador Pahim 提交于
      3c10b4de
    • C
      Job: make stdout_stderr private · 3e34ef06
      Cleber Rosa 提交于
      This attribute is used solely for internal purposes.  Let's make it
      private.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      3e34ef06
    • C
      Job: remove idfile attribute · 5ff5dc1e
      Cleber Rosa 提交于
      The idfile attribute is nothing more than logdir + 'id'.  Since we've
      documented this attribute, let's remove it in an attempt to keep the
      job namespace cleaner.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      5ff5dc1e
    • C
      Job: remove unused attributes · c9aae5a6
      Cleber Rosa 提交于
      References to test dir and a never used test_index are Job attributes
      that should not really exist.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      c9aae5a6
    • C
      Job phases: move job execution code to run() method · 4b9765ac
      Cleber Rosa 提交于
      The `run()` method is supposed to be the simplified interface for
      jobs, that is, they run all phases of a job.  This should allow for
      users of job instances to simply run:
      
         >>> job = avocado.core.job.Job()
         >>> result = job.run()
      
      Of course the other more granular methods can still be used.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      4b9765ac
    • C
      Job phases: introduce post_tests · e61cb98c
      Cleber Rosa 提交于
      The post_tests phase is intended for the job to run any actions after
      the tests are run.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      e61cb98c
    • C
      Job phases: introduce run_tests · d36e9bc3
      Cleber Rosa 提交于
      The run_tests phase is responsible for actually running the test suite
      that has been created in the create_test_suite phase.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      d36e9bc3
    • C
      Result: make sure every job has a result directory · c3ae6559
      Cleber Rosa 提交于
      This change makes the initialization of the job results happen a lot
      earlier than usual, at job instantiation time.  It matches the use
      cases of the "Job API", that is, when users want to manipulate job
      instances.
      
      With this, change it's possible to execute snippets of code such
      as:
      
         >>> from avocado.core.job import Job
         >>> job = avocado.core.Job()
         >>> job.log.info("Checking if system is ready")
      
      And have that persisted at `job.logdir`, with the "Checking if system
      is ready" message logged at `job.logfile`.
      
      This also addresses the issue that, once a job is created, its result
      dir is never removed, even if it's empty.  The Avocado test runner
      still behaves mostly the same, that is, if the existing job has no
      tests (such as when none of the test names given were resolved), it
      will proceed to the job execution.  I'd argue that, since it's not
      possible (or I'd say desirable) that test resolution happens outside
      the context of a job, this is the logical way to go.
      
      This reinforces the change that a job without a test suite is still a
      valid job.  That's is the reason for the removal of the test that
      checked if job results directory were removed if Avocado was executed
      without test names as parameters.
      
      Reference: https://trello.com/c/hu4vxQOLSigned-off-by: NCleber Rosa <crosa@redhat.com>
      c3ae6559
    • C
      Job phases: introduce pre_tests · 4d216b7b
      Cleber Rosa 提交于
      The pre_tests phase is intended for the job to execute any actions it
      deems necessary before any test is executed.  Right now, the Job
      Pre/Post plugins have their "pre" methods executed here.
      
      Following this, there is going to be a rename for the plugin interface
      names, to better reflect that those actions do not happen before or
      after a job, but happen *within* a job, before and after *tests* are
      executed.
      
      While at it, let's also make the Job Pre/Post plugin dispatcher
      (`_job_pre_post_dispatcher`) private.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      4d216b7b
    • C
      Job phases: introduce create_test_suite · 7fa0c137
      Cleber Rosa 提交于
      This introduces the create_test_suite job phase.  Its goal is to
      fire up the test resolver and populate the instance attribute
      `test_suite`.
      Signed-off-by: NCleber Rosa <crosa@redhat.com>
      7fa0c137