Daily integration tests

Integration tests

Integration tests, E2E tests, browser testing: these types of tests examine the final form of the application before it can be shipped to the client. For example, Selenium tests "click" through every component on the website, checking if everything works according to the expectations (backend, frontend, databases, etc.).

Integration tests usually take more time than unit tests, often lasting even a few hours. In such case, it's a good practice to configure the testing pipeline at a specific time. In this article, we'll show you how to configure a pipeline that will run your tests once a day.

Daily integration tests

The first thing is selecting the Git provider and the project that you want to test:

Creating a new projectCreating a new project

Now you can configure the pipeline details. Select the branch, switch the trigger mode to On schedule and set the hour and time interval at which you want the tests to run. In this example, we set it to run at 17:00 (5 PM):

Adding a new pipelineAdding a new pipeline

Cron configuration

If you need more advanced timing, you can define the recurrence with a cron string. For example, setting the string to 0 0 17 ? \* MON,TUE,WED,THU,FRI \* will force Buddy to run the pipeline at 17:00 from Monday to Friday only. To set up the cron, switch the config mode to Cron:

Pipeline configurationPipeline configuration

Tests configuration

The last step is setting up the tests. Buddy uses isolated containers with preconfigured testing environment. All you need to do is select the build action from the action roster and enter the commands that will run your tests:

Test configurationTest configuration

Integration tests can be split and run in parallel to drastically shorten the execution time:

Split tests pipeline exampleSplit tests pipeline example

You can also add a notification action in the On failure section in the pipeline that will notify your team in case the tests detect any errors.

Notification actionNotification action

Recommended
Last update:
Aug 27, 2024