ShahradR / action-taskcat

GitHub Action to run taskcat against CloudFormation templates
MIT License
3 stars 2 forks source link

Mock AWS endpoints to simulate taskcat outputs without an AWS account #12

Open ShahradR opened 4 years ago

ShahradR commented 4 years ago

To test the GitHub Action, we need to ensure that the action properly responds to taskcat's different outputs.

Because taskcat is a black box, we need to modify its dependencies and force it down different paths, and produce the outputs we need to test. AWS itself is its main dependency, and largely controls taskcat's behaviors and outputs.

This issue is to investigate a method of mocking those calls, and controlling taskcat's output without using an actual AWS account.

ShahradR commented 4 years ago

spulec/moto is a library that mocks AWS's boto library. boto is used by taskcat to communicate with the Amazon cloud.

From our perspective, taskcat is a black box – we can't modify the code and inject moto mocks. To work around this, moto provides a stand-alone server mode, which creates a web server that mocks AWS endpoints, outside the application.

To make this testing viable, we need a seam where the moto server's URL is passed to taskcat and used instead of the actual AWS endpoints.