Whilst we continue to explore Cloud Testing and what it means for us all as testers in the future, we really feel that getting comfortable with the Command Line is sound, practical advise. In fact if you want to contribute effectively to testing an application built in the cloud, using the CLI to interact with cloud services and programmatically execute actions is mandatory!
If your comfortable with this already then this blog post probably isn't for you, we won't be offended if you decided to stop reading a make coffee instead....
For context this is not tutorial on linux or a dive into shell specific syntax, but we think its a great idea to go research and learn about them if you haven't already!
When we think about the work we have done with clients and more recently some our own in-house R&D, we found ourselves using the cli more and more to interact with the cloud provider we were using, with the console GUI being more of a quick and easy.
You can read about a basic example of that in the last blog post we did about Introducing Infrastructure as Code as a concept for testers.
On top of that, if you want your tests to run within your CI pipeline, those tests will be need to be triggered via some kind of shell command.
I imagine that a lot of people reading this will be familiar with Postman as an API development and testing tool. Postman Collections can be ran via the Newman CLI, allowing for integration into a CI pipeline. An easy task with great rewards if you are comfortable with the concept and practice of using a CLI.
We recently shared a great guide put out on the AWS Devops blog, which walks through setting up a pipeline to build and deploy an API, then run postman test collections. The guide encourages the use of the AWS CLI to create then upload files to an S3 Bucket, then trigger the creation of a CloudFormation stack that creates a CodePipeline pipeline to do its magic.
For us there's one real piece of golden information in this guide that we will definitely use going forward to build awesome pipelines. Its the how-to guide on how to get the URL of a the API Gateway dynamically created by the pipeline, and pass it into the Postman Collection to be ran. And it's done via a bash script.
The challenge this solves is how you send a request to an endpoint that you don't know the URL for, as the URL is created on the fly during build.
So if you're a tester and want to work towards developing yourself to be effective working with cloud hosted systems delivered by a team using devops techniques, the one thing we would like you to take away from this post it to read and importantly FOLLOW the AWS guide above, we think it will gear you up for working in that environment!
We wish you luck with your cloud testing adventures!