How can Geb functional tests be used for performance/capacity testing?
Asked Answered
O

1

7

Is anyone aware of any tools that would allow Geb functional tests to be used for performance testing?

In the "Continuous Delivery" book, it's suggested that functional tests can be used for performance testing, just wondering if anyone has any ideas how this could be implemented using Gradle, Spock and Geb.

To give context, at present, we are using a JMeter script that simulates a number of users crawling through our site, following random links on the page. This gives relatively good coverage of the linked to content, but some areas of the site, such as searches and logged in functionality don't get touched.

Thanks in advance.

Outmost answered 30/11, 2012 at 12:35 Comment(0)
G
0

You can just start the relevant Geb tests from your suite multiple times on several machine or even multiple times on a single machine, using headless drivers like HtmlUnit or PhantomJS. That gets you the load for capacity testing.

Of course you can also combine that with data tables in where: blocks, repeating the same test with different parametrisations. A very nice tool for generating data for parametrised test is Spock Genesis which I assume would come in handy for your scenario.


Update: Even if your test is not parametrised you can easily repeat it by annotating the feature method with @Unroll and just adding a where: block like this:

@Unroll
def "test"() {
  expect:
  println n

  where:
  n << (1..100)
}

Et voilà - the test runs 100 times.

Gyrus answered 23/2, 2017 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.