I have a scenario where there are several independent jmx files, each of them has their own threadgroup etc. Using JMeter Ant script I can fire them all in sequence and collect the result in a jtl file. My challenge here is to do the same thing but fire off the tests in parallel. Please note that Include Controller is not an option since I want to use(or honor) the ThreadGroup and User Defined Variables in each jmx files.
Thanks for your help
Perhaps Parallel Ant Task is what you're looking for.
However <parallel> directive is not thread safe so I wouldn't recommend to use it with JMeter Ant task and consider using i.e. command-line mode, maven plugin or custom Java class which will spawn individual JMeter tests with it.
See 5 Ways To Launch a JMeter Test without Using the JMeter GUI guide for details of the approaches, hope this helps to find the one which matches your environment.
Yes, Ant parallel solves this problem.
Related
So I have 3 Appium/Selenium Junit classes, each for a different platform (iOS, Android, web). I'd like to create 3 Jenkins jobs and then run some or all of them in parallel based on parameters that I'll input somehow (file, command, etc.).
Example: I want to run the iOS and Android tests with specific devices (UDIDs). So I'd somehow input this information (which jobs to run and with which parameters=devices), and the 2 jobs will run concurrently with this input.
I'm a Jenkins beginner, and I have tried searching and found many Jenkins plugins that seem like they can help (i.e. Parameterized Trigger Plugin), but I didn't understand how to use these correctly (how to configure the jobs correctly with these plugins). Any help would be appreciated (as "dumbed-down" as possible...)
So it's like this. You can run tests on Jenkins in parallel or in multiple builds. I'm using maven, multiple Jenkins nodes, selenium-grid and bunch of other tools. You can call single maven command so it can run parallel tests at once, for eg. only mobile (Android/iOS), and web in separate build to run tests in parallel run for multiple browsers eg. (Chrome & Firefox...).
There is a several ways to achieve this, but there is lot o preparation and setup:
via java/testNg (xml test-suites),
set up selenium-grid for multiple instances,
Here is great starter article for this: https://www.swtestacademy.com/selenium-parallel-tests-grid-testng/
https://learn.techbeacon.com/units/how-use-testng-parallel-test-execution
(if using for mobile testing) setup Appium to run several instances, here is also nice article to start with: https://appium.io/docs/en/advanced-concepts/parallel-tests/
have multiple Jenkins nodes, here is something about that, read entire article: https://wiki.jenkins.io/display/JENKINS/Distributed+builds
But main question was about Jenkins, You can achieve this by creating simple Maven build, create Your job, connect it with Your code on git, enter maven command to call Your code, and You should be set to go, again one more article: https://developers.perfectomobile.com/pages/viewpage.action?pageId=21435209.
Good parallelism is hard to achieve, but when You do its is going to make You worth all time invested.
Hope It will help You!
I am setting up my local build using Ant and have decided to use RabbitMQ. I would like to have any Ant task that I can use to configure my local installation for setting things up (stop, start, create queues etc..) and tearing them down as part of my test suite.
Has anyone come across anything like this?
I described a scenario in this question there the op was looking for a way to declare queues and bindings without the overhead of doing it at runtime.
In my solution I use a console utility to perform the queue declarations and have this called from a build step in my build server when running builds and tests.
During the normal course of coding and integration testing from the IDE, I simply make sure that I have used the utility fairly recently to make sure the queues have been established as per the current XML definitions. My test setups ensure that the queues themselves are empty before running.
Hope this helps.
Steve
Ant is a build tool. While running your automated tests is generally part of a build process, the setup of your queues are part of your specification's context and should be included in your tests. If you truly have a need to configure your exchanges and queues once before all test runs, many frameworks provide a facility to do this.
I have a build file that has different variety of tasks. Some of these are in-house tasks that I am able to control the amount of logging/output generated.
The other tasks are libraries that I have no control over. They do not provide a way to control the amount of output. There is one very trivial task and I am comfortable with turning off the output of the task all together.
My question is if there a way to turn off this specific tasks output in the ant execution. Or does ant provide a way to wrap this task in another task that has echo set to 'off' or something similar?
-Syam
Ant has no builtin feature to turn off output for specific task, but there are possibilities via buildlisteners. See Make ant quiet without the -q flag? for answers
outputproperty="devnull"
It works fine for me and allways you can print this var if you need.
When running unit tests, Gradle can execute multiple tests in parallel without any changes to the tests themselves (i.e. special annotations, test runners, etc.). I'd like to achieve the same thing with ant, but I'm not sure how.
I've seen this question but none of the answers really appeal to me. They either involve hacks with ant-contrib, special runners set up with the #RunWith annotation, some other special annotations, etc. I'm also aware of TestNG, but I can't make the Eclipse plug-in migrate our tests - and we have around 10,000 of them so I'm not doing it by hand!
Gradle doesn't need any of this stuff, so how do I do it in ant? I guess Gradle uses a special runner, but if so, it's set up as part of the JUnit setup, and not mentioned on every single test. If that's the case, then that's fine. I just don't really want to go and modify c. 10,000 unit tests!
Gradle doesn't use a special JUnit runner in the strict sense of the word. It "simply" has a sophisticated test task that knows how to spin up multiple JVMs, run a subset of test classes in each of them (by invoking JUnit), and report back the results to the JVM that executes the build. There the results get aggregated to make it look like a single-JVM, single-threaded test execution. This even works for builds that define their own test listeners.
To get parallel test execution in Ant, you would need an Ant task that supports this feature (not sure if one exists). An alternative is to import your Ant build into Gradle (ant.importBuild "build.xml") and add a test task on the Gradle side.
I have some hudson servers for our CI process.
The build tasks use Ant scripts and also old-school *.bat files.
What do you prefer? What are the pros and cons?
(I think of readability, familiarity to developers and extensibility...)
Are there any other options? We have .Net, Java and PHP apps to test.
Batch is a programming language (and not a very good one at that). Ant is a dependency matrix language. What's the difference?
In a programming language, you specify the order everything occurs in. You're responsible to say what is built and the order.
In a dependency matrix language, you merely state the dependencies, and the program figures out what to do and the order it should be done in. One of the biggest issues developers have with Ant or Make is to try to force a build order instead of letting the build system take care of it.
Builds should always be done with a dependency matrix language like Ant.
Let Ant determine what needs to be built and the order it should be built. Don't use Batch. If you're using Batch scripts to call a bunch of Ant script in the order you think they should be called, you're doing it wrong. Have a master Ant script do it and use <subant> calls. Let Ant do the tricky stuff.
You can use batch script to do preliminary work (such as setting ANT_OPTS if Ant needs more memory, or setting environment variables like ANT_HOME and JAVA_HOME and your %PATH% variable to make sure you're using the correct Java and Ant versions. In Hudson, you can set all of this in the Hudson job itself, so you don't have to call the Batch script.
*.bat files pretty much restrict you to dos/windows, like how shell scripts are for linux, whereas Ant/Maven is cross-platform and gives you the option to use a non-Windows CI server