Ask a Question

Tip : Use of tags in command line via bamboo build - Run all tests while sending -T tags parameters

JoostDG
Frequent Contributor

Tip : Use of tags in command line via bamboo build - Run all tests while sending -T tags parameters

In our CI build pipeline (bamboo) I setup two parameters tagTestSuite and tagTestCase. This way, all our automation testers can specify, if needed, which test cases need to be ran based on certain tags. This works fine if there are indeed such tags passed on.

But what if a project just wants to run all of its tests?  These -T parameters cannot be left empty in the command line as that fails the build... Deleting them from the bamboo variables will then lose the standardized approach for all testers to do a tag-based execution. 

 

Seeing the documentation here (https://support.smartbear.com/readyapi/docs/functional/running/automating/cli.html) I noticed you can provide logical operators. So I thought I came up with a nice solution:

I provide as default value for those parameters in bamboo a tag value that nobody would use and by setting the "!" operator in front of it I'd expected that ALL test suites/cases would run. So I've set parameters and resulted in a command line that has these : "-TTestSuite !itShouldRunAllTestSuites" "-TTestCase !itShouldRunAllTestCase". Since none of the testSuite/testCases has a tag "itShouldRunAllTestSuites" or "itShouldRunAllTestCases" I thought my project would be run in full....  But nope: error is shown:  [errorlog] java.lang.Exception: The tag "itShouldRunAllTestSuites" was not found.

Yes, I could go and add a tag to every single test suite and test case to work around this, but that could be tedious and not so future proof...

 

Solution: ReadyAPI seems to look first for a tag and then complain it wasn't found. So I tried this: I've added the tags "itShouldRunAllTestCases" and "itShouldRunAllTestSuites" to my project but did not tag any of my testsuites/testcases with this tag.

Executed above again and now ALL of my tests get's executed nicely!

2 REPLIES 2
nmrao
Community Hero

Re: Tip : Use of tags in command line via bamboo build - Run all tests while sending -T tags paramet

Nice.
You mean ReadyAPI should have anti-pattern as well? 🙂


Regards,
Rao.
sonya_m
Community Manager

Re: Tip : Use of tags in command line via bamboo build - Run all tests while sending -T tags paramet

Thank you for sharing this, @JoostDG !


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: