torus-tools / stack

Deploy static websites to the AWS Cloud using a single command.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Implement full tests

gkpty opened this issue · comments

tests should be implemented for:

  • resourceExists methods
  • create Stack
  • update Stack
  • pull stack
  • push stack
  • delete stack

proposed solutions

  1. Localstack is a local (self-hosted) copy of AWS cloud that can be used to test AWS services. https://github.com/localstack/localstack.
    With localstack a stack can be created with torus, and then all of the resources can be tested using the resource exists method.
    This should be implemented locally and in the CI/CD service (travis).
  2. Test the resourceExists methods for an existing stack within our account (for example the stack for the torus.host site)
  3. Use aws-sdk-mock to mock the aws-sdk calls and assert for the method responses. https://www.npmjs.com/package/aws-sdk-mock
  4. A combination of these options

Could I take a crack at it?

Hi @StephenTomlin Sure! I assigned the issue to you. Feel free to go about it however you like and im glad to discuss any options/hurdles you might run into. Also, if you prefer another testing framework feel free to switch out mocha.

P.S. i just merged a PR that fixes the test for the generateTemplate method and i added CI with travis CI