Skip to content
You're viewing the v2 docs. Looking for v1?Go to v1 docs
Docs
Testsigma
Popular questions
↑↓ to navigate↵ to selectesc to close
Book a demo

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.
  1. Create a build project: under the Build section, click Build projects and create a new build project.

  2. Fill in the project configuration: select the Source Provider and Repository (the example uses GitHub). Set the Buildspec name to your .yml file name.

  3. Commit the buildspec: update the .yml file in the repository. The sample here is aws_codebuild.yml:

    aws_codebuild.yml
    version: 0.2
    phases:
    install:
    runtime-versions:
    java: corretto11
    pre_build:
    commands:
    - echo Nothing to do in the pre_build phase...
    build:
    commands:
    - bash cicd-api.sh
    post_build:
    commands:
    - echo Build completed on `date`
  4. Set the script inputs: cicd-api.sh, called in the build phase, 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=180
    REPORT_FILE_PATH=./junit-report.xml
    RUNTIME_DATA_INPUT="buildurl=http://test.testsigma.com,data1=testdata"
    #********END USER_INPUTS***********
  5. 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.

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.

  1. Create a pipeline: in the CodePipeline service, click Create pipeline.

  2. Fill in the build details: select the repository, then pick the CodeBuild project created earlier as the build stage.

  3. 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?