Excluding tests by tags using Maven on the command line

999 views
Skip to first unread message

Esben Rugbjerg

unread,
Jul 15, 2013, 8:27:34 AM7/15/13
to robotframe...@googlegroups.com
Hi,

Can anyone give me and example on how to control which tests that is executed when running RF through Maven ? As far as I can see I have to use the excludes_cli and includes_cli, but I can't make them work.

I have tried 
mvn integration-test -Dexcludes_cli="givenWhenThen" -Dincludes_cli="testInDev"

Any help will be very much appreciated

Thanks
Esben

Jussi Malinen

unread,
Jul 15, 2013, 10:36:44 AM7/15/13
to esbenr...@gmail.com, robotframe...@googlegroups.com
Hi!

The option name from command line is only excludes and includes. In maven docs these command line names are known as "expressions". (See the docs and you will se that the expression for excludes_cli is ${excludes})

Maybe the documentation could be improved here by adding a few examples?

So just try mvn integration-test -Dexcludes=foo -Dincludes=bar

Cheers,
Jussi
> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
> To post to this group, send email to robotframe...@googlegroups.com.
> Visit this group at http://groups.google.com/group/robotframework-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

dani...@gmail.com

unread,
Sep 16, 2013, 1:59:27 PM9/16/13
to robotframe...@googlegroups.com, esbenr...@gmail.com
I tried this command, but it did not work.  Does anyone know the right command to use for excluding and including test(s)?

Jussi Malinen

unread,
Sep 17, 2013, 9:31:43 AM9/17/13
to dani...@gmail.com, robotframe...@googlegroups.com, esbenr...@gmail.com
What are you trying to do?

Note that those includes and excludes include and exclude based on test tags. (As mentioned in the user guide: http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#by-tag-names)

If you instead want to select tests based on their name, you should use tests and suites settings. As in

-Dtests=MyTestName,AnotherTest

See the user guide and pybot --help for more information on the options.

- Jussi

dani...@gmail.com

unread,
Sep 17, 2013, 9:52:27 AM9/17/13
to robotframe...@googlegroups.com, dani...@gmail.com, esbenr...@gmail.com
I am able to exclude test(s) by modifying pom.xml in Maven.  Now, I am trying to include and exclude tests via command line.


Thank you for replying.

Stefan Lecho

unread,
Sep 18, 2013, 2:47:32 AM9/18/13
to robotframe...@googlegroups.com, dani...@gmail.com, esbenr...@gmail.com
If you define your test case like this
*** Test Case ***
My Test Case
[Tags] TheTagOfMyTestCase

You can use the following command line to include the above test case:
mvn clean install -Dincludes=TheTagOfMyTestCase

Reply all
Reply to author
Forward
0 new messages