Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Remote test results #994

Closed

Conversation

clebergnu
Copy link
Contributor

This is a PR mostly addressed to @lmr since he reported the general issues with running custom test result implementations.

The first 2 commits are general improvements, but not critical changes. The last 2 commits really addresses the very broken state of remote test results and remote test runners. More complete description of the issues are on the commit message themselves.

This is really intended to be the same for all instances of a given
class. Every other (xunit, json, journal, html) result class already
does it like that.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Avocado defines avocado.core.result.TestResult, so that alternative
test result classes can inherit from it. When a user writes a new
test result class, he's left wondering how to activate that.

First, for consistency, Avocado should define proper interfaces
for "test result plugins". This is on sight, and will ultimately
allow users to register new test result implementations simply by
registering the setuptools entry points, just as it's currently
done (on versions >= 0.31.0) for command line related plugins.

Until then, let's at least improve the current state of things.
These changes believe that the following improvements are given here:

* avocado.core.job.Job._set_output_plugins now won't look at every
  possible key in the application arguments, and won't silence
  possible errors while trying to instantiate test result classes.
* test result writers can now use a documented method for registering
  their test result classes.

The same approach was not chosen to be done with the test runner
classes because there can only by one test runner per Avocado job.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
This implementation of __getattr__ has allowed users of the test
result proxy, most importantly the result test runner, to ask for
attributes, including important methods, that would only be available
on the RemoteTestResult implementation.

Things have been working more or less by pure chance, based on the
lucky fact that the RemoteTestResult would be at the right place on
the proxy `output_plugins`.

Let's forbid users of the test result proxy to look for attributes
that are not part of the test result "contract" by removing this
magical (and rather evil) method.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
And not the test proxy for attributes that are not part of the general
test result "contract".

NOTE: THIS IS A DRAFT CHANGE. IT INTRODUCES OTHER FAILURES WHEN RUNNING
THE REMOTE BASED TEST RUNNER. It's sole purpose is to exemplify how the
test result proxy `__getattr__` was being abused.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
@clebergnu
Copy link
Contributor Author

I'm closing this one because the first two commits were sent on a separate PR, and the fix for the real issue is going to come on another PR.

@clebergnu clebergnu closed this Feb 5, 2016
@lmr lmr removed the in progress label Feb 5, 2016
@clebergnu clebergnu deleted the remote_test_results branch May 4, 2016 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants