Loading repository data…
Loading repository data…
Elmasekar / repository
A sample repo to help you integrate Jenkins pipeline for UnitTest on LambdaTest. Run your python automation test scripts on Lambdatest.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Jenkins Pipeline is also referred to as "Pipeline" offers a suite of plugins to help integrate your continuous delivery pipeline into Jenkins. Jenkins Pipeline does so with the help of Pipeline DSL(Domain Specific Language) syntax that facilitates easy modelling of even the most complex delivery pipeline.
You can easily create a Jenkins pipeline for UnitTest automation tests on LambdaTest using the following steps. You can refer to sample test repo here.
For Linux/Mac:
$ export LT_USERNAME= {YOUR_LAMBDATEST_USERNAME}$ export LT_ACCESS_KEY= {YOUR_LAMBDATEST_ACCESS_KEY}
For Windows:
$ set LT_USERNAME= {YOUR_LAMBDATEST_USERNAME}$ set LT_ACCESS_KEY= {YOUR_LAMBDATEST_ACCESS_KEY}
Find the code for setting up a pipeline for the sample UnitTest repo.
pipline
{
withEnv(["LT_USERNAME=Your LambdaTest UserName",
"LT_ACCESS_KEY=Your LambdaTest Access Key",
"LT_TUNNEL=true"]){
echo env.LT_USERNAME
echo env.LT_ACCESS_KEY
stages{
stage('setup') {
// Get some code from a GitHub repository
try{
git 'https://github.com/LambdaTest/Python-UnitTest-Selenium'
//Download Tunnel Binary
sh "wget https://s3.amazonaws.com/lambda-tunnel/LT_Linux.zip"
//Required if unzip is not installed
sh 'sudo apt-get install --no-act unzip'
sh 'unzip -o LT_Linux.zip'
//Starting Tunnel Process
sh "./LT -user ${env.LT_USERNAME} -key ${env.LT_ACCESS_KEY} &"
sh "rm -rf LT_Linux.zip"
}
catch (err){
echo err
}
}
stage('build') {
// Installing Dependencies
sh 'pip install -r requirements.txt'
}
stage('test') {
try{
sh 'python lambdatest_test.py'
}
catch (err){
echo err
}
}
stage('end') {
echo "Success"
}
}
}
}
You can now add this script when creating the pipeline by using the following steps:
Note: To run on the tunnel, Either you can use LT_TUNNEL Environment variable to set the tunnelling capability or you can pass in the code. Instructions on the tunnel are are available in the sample repo readme.