linagora / openpaas-gatling

Load test scenarios for the OpenPaaS software suite
Other
1 stars 7 forks source link

Gatling OpenPaaS

This project enables to proceed to OpenPaaS load testing using Gatling technology.
It aims to provide building blocks, specific OpenPaaS APIs steps as well as more complex scenarios.

Configuration

The configuration is defined in the src/main/scala/com/linagora/openpaas/gatling/Configuration.scala file. However, all the parameters can be set through environment variables. Just copy the env.sh.tpl file as env.sh, update the values and source it: source env.sh

Available settings:

Environment variables:

For example, to run with OpenPaaS port 8000:

$ export OPENPAAS_PORT="8000"
$ sbt
  > gatling:test

User pool

There are two ways of creating a user pool for running tests:

  1. Using a src/test/resources/users.csv file containing credentials of users. This is the default method to retrieve user credentials. It is expected to have all users provisioned in the testing platform.

  2. Including the provisioning steps in each scenario. This method requires platform admin credentials in configuration.

Running tests in LemonLDAP integrated platform

For OpenPaaS instances that are protected by LemonLDAP, you need to provide the LemonLDAP portal page url in the configuration. You also have to change the AUTHENTICATION_STRATEGY configuration to lemonldap. Plus, all users credentials must be stored in src/test/resources/users.csv file.

Gatling Recorder

The Gatling Recorder helps you to quickly generate scenarios, by either acting as a HTTP proxy between the browser and the HTTP server or converting HAR (Http ARchive) files. Either way, the Recorder generates a simple simulation that mimics your recorded navigation.

All the instructions to install and use are available at this documentation

Run scenario

You can run all the scenario via sbt:

$ sbt
 > gatling:test

Run a specific scenario via sbt:

$ sbt
 > gatling:testOnly SCENARIO_FQDN

For example, you can run this scenario to open Calendar and open an event to view it details:

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewEventDetailsSimulation

Scenarios for Inbox

Send an email

Scenario

In this scenario, each user will:

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.unifiedinbox.SendEmailSimulation

Scenarios for Calendar

1. List calendars

Scenario

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ListCalendarsSimulation

2. Create a new calendar

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateCalendarSimulation

3. View a calendar's details and update the calendar

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndUpdateCalendarSimulation

4. View a calendar's details and then delete the calendar

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndDeleteCalendarSimulation

5. Create a new event

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventSimulation

6. Create a new event with a lot of attendees

In this scenario, each user will:

The equivalent simulation will ramp 20 users over 1 second. These numbers are configurable (see the commands below).

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventWithLotsOfAttendeesSimulation
$ sbt
> ;-DrampUserCount=40;-DrampUserDuration=2;gatling:testOnly com.linagora.openpaas.gatling.calendar.CreateEventWithLotsOfAttendeesSimulation

7. Open an event

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewEventDetailsSimulation

8. Open an event and update the event

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndUpdateEventSimulation

9. Open an event and delete the event

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.ViewAndDeleteEventSimulation

10. Mixed scenario

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.calendar.CalendarMixSimulation

Scenarios for Contacts

Open a contact in the default address book

Scenario

In this scenario, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION.

Run

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.addressbook.OpenContactInCollectedAddressBookSimulation

Platform Test Simulations

Calendar & Contacts

In this simulation, each user will:

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.CalendarAndContactsWithRefreshTokenSimulation

Inbox

In this simulation, each user will:

The equivalent simulation will ramp USER_COUNT users over INJECT_DURATION with SCENARIO_DURATION as the scenario duration for a user.

$ sbt
> gatling:testOnly com.linagora.openpaas.gatling.InboxPlatformSimulation