I was thinking about adding a new feature to TestNG. What I would like
to have is a dot (graphviz) diagram of test dependencies. ...not sure
if that is of any use at all, but I feel like it might be fun. :)
I don't know TestNG codebase very well (if at all), so I would like to
ask you for hints on how to proceed.
I guess, that after I feed TestNG with tests, e.g. like this:
TestNG testng = new TestNG();
testng.setTestClasses/Suites(...)
then TestNG holds some internal structure which describes dependencies of tests.
Now the question is: "how can I access it?"
What I figured out is that it is possible by implementing IReporter
interface. This seems to be pretty easy, but there is another issue to
solve. Reporters come into action after tests are finished. I would be
more happy to be able to generate it without running any tests. How
can I skip all tests ? Should I write an annotation transformer that
would make all tests "enabled=false"?
--
Cheers,
Tomek Kaczanowski
--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to testn...@googlegroups.com.
To unsubscribe from this group, send email to testng-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en.
> Actually, TestNG already supports this :-)
...that is really annoying! ;)
> In the file GraphThreadPoolExecutor.java, set DOT_FILES to `true` and TestNG
> will generate a .dot file that you can feed to GraphViz (it will tell you
> the exact path). This implementation will actually generate several pictures
> that represent the evolution of your method graph as TestNG executes them.
I will have a look at this. Thank you !
--
Regards / Pozdrawiam
Tomek Kaczanowski
--
Cheers,
Tomek Kaczanowski
--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to testn...@googlegroups.com.
To unsubscribe from this group, send email to testng-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en.
> You can modify this class to generate whatever graph works for you, you have
> access to the entire suite information and the current implementation shows
> you how to use it.
So one option is to fork/hack TestNG and change
GraphThreadPoolExecutor to whatever suits me. Ok, good to know, thanks
for this tip.
But that is not really user-friendly, is it? I mean, it would be much
easier to have it pluggable, which means without changing TestNG. That
is why I ask you so stubbornly about implementing IReporter :)
--
Regards / Pozdrawiam
Tomek Kaczanowski
> --
To unsubscribe from this group, send email to testng-dev+...@googlegroups.com.
> One quick comment: you don't need to run the tests in order to find out
> their dependencies, you can do this with simple introspection since the
> dependency logic is captured in annotations.
Yes, if I am only interested in seeing the dependencies then running
tests is a waste of time.
What do you mean "with simple introspection"? You mean I should use
standard Java mechanism, or is there something in the API of TestNG
that might help me to discover test dependencies without running the
tests?
What do you mean "with simple introspection"? You mean I should usestandard Java mechanism, or is there something in the API of TestNG
that might help me to discover test dependencies without running the
tests?
one more question (and probably not the last one).
If a configuration method (e.g. @BeforeClass) fails, then tests, that
should be run after it, are skipped, right?
Now, I would like to learn about why a particular test was skipped.
That is, I want to know because of which failed set up method it was
skipped.
Is it possible? AFAIK configuration methods are not listed by
getMethodsDependedUpon method of ITestNGMethod.
--
Regards / Pozdrawiam
Tomek Kaczanowski
2011/2/15 Cédric Beust ♔ <ced...@beust.com>:
Hi Cedric,
one more question (and probably not the last one).
If a configuration method (e.g. @BeforeClass) fails, then tests, that
should be run after it, are skipped, right?
Now, I would like to learn about why a particular test was skipped.
That is, I want to know because of which failed set up method it was
skipped.
Is it possible? AFAIK configuration methods are not listed by
getMethodsDependedUpon method of ITestNGMethod.