Triggering tests from Buildkite CI/CD to LambdaTest
Buildkite is a continuous integration (CI) and continuous deployment (CD) platform that integrates with version control systems to automate the testing and release of software. Unlike traditional CI/CD solutions, Buildkite allows developers to run builds on their own infrastructure, offering a hybrid model that combines the flexibility of self-hosted runners with the convenience of a cloud-based UI. This ensures faster build times, high levels of security, and scalability to meet the demands of projects of any size.
LambdaTest now integrates with Buildkite to boost your go-to-market delivery. Perform automated cross browser testing with LambdaTest to ensure your development code renders seamlessly through an online Selenium grid providing 3000+ real browsers running through machines on the cloud. Perform automation testing in parallel with LambdaTest’s Selenium grid to trim down your test cycles drastically.
Prerequisites
- Buildkite account
- A GitHub repository. Here is our sample GitHub repository for Buildkite.
Integrating Buildkite with LambdaTest
Step 1: Login to Buildkite and click the + icon to create a new pipeline
Step 2: Connect your GitHub repository. Fill the name and description fields.
You can select the GitHub account where your repository is and add the repository to setup the pipeline for it. Provide an appropriate name and description for this pipeline.
Step 3: Add LambdaTest Credentials to Environment Variables
You need to set your LambdaTest username and accesskey as your environment variables. You can retrieve them from your LambdaTest automation dashboard by clicking on the key icon near the help button or the key icon in the side navbar. The format should be as following:
LT_USERNAME=YOUR_LAMBDATEST_USERNAME
LT_ACCESS_KEY=YOUR_LAMBDATEST_ACCESS_KEY
Step 4: Add steps to add lambdatest-buildkite plugin
To add a plugin to a command
step, use the plugins
attribute. The plugins
attribute accepts an array, so you can add multiple plugins to the same step.
steps:
- command: 'yarn && yarn LT test'
plugins:
- lambdatest/lambdatest~
Step 5: Add steps for execution
The commands to run for test execution are to be mentioned as steps here. For example, the steps can be prerequisite package installs, executing the testing code etc.
In the example repository, there is only a single step - executing the lambdatest.py
file. That can be done with the following code:
python3 lambdatest.py
You can add additional steps by clicking on the Add
button. Once all the steps are added, you can click Create Pipeline
.
Step 6: Adding an agent
The next step is adding an agent. In this example, a local MacOS agent is used. If you have a custom agent already setup, this step is skipped.
Step 7: Create and run a build
After the pipeline is created, we can create a build. To create a build, click the New Build
button. In the popup, add the name of the build and the branch to build. Click Create Build.
Now the build should be created and run. After the build runs successfully, you should be able to see your builds on LambdaTest Automation Dashboard.
That is it! You can also add a webhook to your repository to trigger the build whenever a change is done in the repository.
Monitor and analyze your test result on the LambdaTest automation dashboard.
Reliably deploy your code at scale using Buildkite integration with LambdaTest, and ensure it looks robust across every browser to provide a seamless user experience to all your visitors. Happy Testing!