Ignore dependencies at runtime

100 views
Skip to first unread message

Pavel Georgiev

unread,
Jan 31, 2008, 6:03:03 AM1/31/08
to testng-users
Hi,

Currently my tests are logically grouped. This is because the
functionalities have a logical order. If i cannot login to the server
why try to do something?:)

This is fine if one has one or two dependencies. But i have certain
tests that depend on 20 other. So each time i execute a test from that
group i need to also execute the "acceptance tests" this method/test
depends on. This takes a lot of time when i only need to debug a given
test. Is there a way to tell TestNG to ignore all dependencies for a
given test run?

In a summary:
1) When running the tests regularly - follow all dependancies
2) When debugging a given test/group remove all dependancies

Thanks.

Pavel Georgiev

unread,
Jan 31, 2008, 6:04:17 AM1/31/08
to testng-users
Btw I use ant to run the tests (if it matters).

On 31 Ян, 13:03, Pavel Georgiev <pavel.vasilev.georg...@gmail.com>
wrote:

Mark Derricutt

unread,
Jan 31, 2008, 6:19:25 AM1/31/08
to testng...@googlegroups.com
You could do this with an Annotation Transformer - which when run with certain system properties goes and removes all the dependencies from the annotations prior to TestNG running.

As an experiment awhile ago I wrote the following transformer:

http://www.talios.com/writing_fine_grained_test_requirements_with_expressions.htm

which executes an EL statement attached to tests and modifies the dependencies in order to trigger a test skip.

You could do something similar here probably...

Cédric Beust ♔

unread,
Jan 31, 2008, 11:09:45 AM1/31/08
to testng...@googlegroups.com
Interesting, Mark.  You also bring up a good point:  it doesn't seem possible to make an Annotation Transformer skip a test.  Your workaround is clever, though (transform the @Test annotation to make it depend on a non-existent group).  I need to think if that's enough or if I should support this explicitly...

--
Cédric

Carl Carl

unread,
Feb 25, 2015, 8:30:30 AM2/25/15
to testng...@googlegroups.com
Hi all, 
I would like to also ignore the dependencies in testNG in my code, But the link above is not valid anymore. So any one give me a detail explain on how does it work?

Carl

Cedric於 2008年1月31日星期四 UTC+1下午5時09分45秒寫道:
Reply all
Reply to author
Forward
0 new messages