AWS DevOps
AWS DevOps triggers Testsigma test plans two ways: a CodeBuild project running the trigger script, or a CodePipeline running that build project between its source and deploy stages.
Prerequisites
- An API key and the test plan ID.
- The shell script (
cicd-api.sh) in your repository.
Trigger from a CodeBuild project
Section titled “Trigger from a CodeBuild project”-
Create a build project: under the Build section, click Build projects and create a new build project.
-
Fill in the project configuration: select the Source Provider and Repository (the example uses GitHub). Set the Buildspec name to your
.ymlfile name. -
Commit the buildspec: update the
.ymlfile in the repository. The sample here isaws_codebuild.yml:aws_codebuild.yml version: 0.2phases:install:runtime-versions:java: corretto11pre_build:commands:- echo Nothing to do in the pre_build phase...build:commands:- bash cicd-api.shpost_build:commands:- echo Build completed on `date` -
Set the script inputs:
cicd-api.sh, called in thebuildphase, carries the test plan details. Update its inputs and add it to the repository:cicd-api.sh inputs #********START USER_INPUTS ********TESTSIGMA_API_KEY= <Give in an API Key Generated in the Configuration-> API Keys tab in Testsigma>TESTSIGMA_TEST_PLAN_ID= <Test Plan ID for the run which you need to trigger>MAX_WAIT_TIME_FOR_SCRIPT_TO_EXIT=180REPORT_FILE_PATH=./junit-report.xmlRUNTIME_DATA_INPUT="buildurl=http://test.testsigma.com,data1=testdata"#********END USER_INPUTS*********** -
Start the build: in CodeBuild, click Start build. Track progress in the build logs. The execution ID for the test plan appears in the REST API call to start Test Plan section.
Trigger from a CodePipeline
Section titled “Trigger from a CodePipeline”CodePipeline runs the source, build, and deploy stages together. Reuse the CodeBuild project you created above as the build stage; the tests then gate the deploy.
-
Create a pipeline: in the CodePipeline service, click Create pipeline.
-
Fill in the build details: select the repository, then pick the CodeBuild project created earlier as the build stage.
-
Review and create: complete the pipeline settings, source, and deploy stage details, then click Create Pipeline. The run triggers as soon as the pipeline is created.
Was this page helpful?
Thanks for the feedback.