binbashar / leverage

Binbash Leverage CLI intended to orchestrate Leverage Reference Architecture for AWS (www.binbash.co/leverage)
https://pypi.org/project/leverage/
Apache License 2.0
17 stars 2 forks source link

Feature | Testing: unit + integration + functional e2e CI automation #40

Closed exequielrafaela closed 2 years ago

exequielrafaela commented 3 years ago

What?

Why?

Having the proper level of testings

➕ Makes the Process Agile ➕ Quality of Code ➕ Finds Software Bugs Early ➕ Facilitates Changes and Simplifies Integration ➕ Provides Documentation ➕ Debugging Process ➕ Design ➕ Reduce Costs


@diego-ojeda-binbash OJ we'll wait for your review and feedback here in order to segregate this Testing Epic in the proper specific issues. Thanks in advance!

CC: @binbashar/leverage-ref-architecture-aws-dev @binbashar/leverage-ref-architecture-aws-admin

angelofenoglio commented 3 years ago

Proposal for testing Ref Arch Repo:

Layer directories can be concatenated and bats only invoked once

Bats test per layer:

Setup
  1. Copy .tfvars to layer directory
    Test
  2. leverage tf init
  3. leverage tf plan -detailed-exitcode
  4. If exit code is 0: 3.1. leverage tf apply 3.2. leverage tf output -json 3.3. Use jq and bats_assert to compare against .tfvars
    1. If exit code is not 0: 4.1. Post leverage tf plan output as comment to PR

Layers to test initially

exequielrafaela commented 3 years ago

@angelofenoglio @diego-ojeda-binbash the testing approach looks very promising. Couldn't wait to see the 1st workflow in place 🙌🏼 💪🏼

angelofenoglio commented 2 years ago
exequielrafaela commented 2 years ago

@angelofenoglio thanks for everything, @juanmatias will be collaborating with this task from now on 💪🏼

exequielrafaela commented 2 years ago

@juanmatias let's create another issue in order to test the leverage CLI dependency package binaries that could be found here:

Eg test-cases (1st document and in a 2nd iteration automte)

CC: @angelofenoglio @diego-ojeda-binbash

juanmatias commented 2 years ago

Regarding the Leverage CLI / RefArch integration

Prev Situation

tests were not working

Curr Situation

tests will work as soon as PR are merged in both repos

Notes

Things that have been done here:

cc @exequielrafaela @angelofenoglio @diego-ojeda-binbash

exequielrafaela commented 2 years ago

@juanmatias as agreed we'll migrate all the test to the leverage cli repo instead of having them segregated in the ref arch one. Since this tests will give us a good testing baseline for the cli, we've also discussed about creating a new issue to start the discussions of the ref arch v1 specific minimum set of tests that could also help to have a better understanding of the different components versions (bringing more certainties for the current compatibility matrix that could be found in the doc).

CC: @diego-ojeda-binbash @angelofenoglio

juanmatias commented 2 years ago

A test was created in the Leverage CLI repo.

Now the test action has three jobs:

this last job does the following:

Please, @exequielrafaela @diego-ojeda-binbash @angelofenoglio , check this PR https://github.com/binbashar/leverage/pull/136