Giter VIP home page Giter VIP logo

aws-codepipeline-codebuild-with-postman's Introduction

Automating API Testing with AWS Code Pipeline, AWS Code Build, and Postman

This post demonstrates the use of AWS CodeBuild, CodePipeline and Postman to deploy, functionally test an API, and view the generated reports using a new feature from CodeBuild called Reports.

Please refer to the following blog post for instructions: https://aws.amazon.com/blogs/devops/automating-your-api-testing-with-aws-codebuild-aws-codepipeline-and-postman/

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-codepipeline-codebuild-with-postman's People

Contributors

amazon-auto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aws-codepipeline-codebuild-with-postman's Issues

Build fails command execution error message

Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: aws cloudformation package --template-file petstore-api.yaml --s3-bucket <redacted bucket name> --s3-prefix api-code --output-template-file petstore-api-output.yaml. Reason: exit status 255

I received this error message after changing the placeholder for the bucket name in the main branch of my forked repo since my build was not reading the branch I created despite specifying the new branch during configuration.

I am trying to follow the tutorial to automate tests using Postman at [https://aws.amazon.com/blogs/devops/automating-your-api-testing-with-aws-codebuild-aws-codepipeline-and-postman/]; I am new to AWS.

newman command failure & assesrtion failure

Hi,

Firstly, thanks for the nice work and I've learned few things after working through this.
I have experienced 2 issues and my pipeline was successful after applying the fixes.
I can understand Issue 2 is kind of intentionally created to demonstrate the capability of CodeBuild reports. However it would be good to explain the steps to fix the test assertion failure.

Issue 1: newman command failed (refer below error)

Command did not exit successfully newman run PetStoreAPI.postman_collection.json --environment PetStoreAPIEnvironment.postman_environment.json -r junit exit status 1

Phase complete: BUILD State: FAILED
Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: newman run PetStoreAPI.postman_collection.json --environment PetStoreAPIEnvironment.postman_environment.json -r junit. Reason: exit status 1
Entering phase POST_BUILD

Fix: add cli in the command (refer below) in postman-newman-buildspec.yml
newman run PetStoreAPI.postman_collection.json
--environment PetStoreAPIEnvironment.postman_environment.json
-r cli,junit

Issue 2: Assertion failure for Is response time is less than 200ms. Reason: It's taking up to ~600ms
I've updated PetStoreAPI.postman_collection.json with 600 in 3 locations and copied the file to S3 bucket
pm.expect(pm.response.responseTime).to.be.below(600)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.