pre-commit-terraform icon indicating copy to clipboard operation
pre-commit-terraform copied to clipboard

Add unit-tests that will found problems with new code

Open MaxymVlasov opened this issue 2 years ago β€’ 4 comments

What problem are you facing?

New PR's time to time break existing functional, and that can't be found by PR review. Here one of the examples why we should test corner cases on PR's: https://github.com/antonbabenko/pre-commit-terraform/pull/302

Try to use https://github.com/bach-sh/bach Reason: https://github.com/antonbabenko/pre-commit-terraform/pull/252#issuecomment-951414283 Or https://github.com/bats-core/bats-core

MaxymVlasov avatar Dec 16 '21 12:12 MaxymVlasov

Tried bach - no idea how to test $ARGS value after common::parse_cmdline execution. Test just not go inside for-loop

Branch: https://github.com/antonbabenko/pre-commit-terraform/compare/chore/GH-303/add_unit_tests-BACH Commit: https://github.com/antonbabenko/pre-commit-terraform/commit/5e563bea26dfe5def1267910a5c891e44fb57ef9

MaxymVlasov avatar Apr 16 '22 17:04 MaxymVlasov

Need to check https://opensource.com/article/19/2/testing-bash-bats

MaxymVlasov avatar Apr 16 '22 19:04 MaxymVlasov

Go/Ruby https://github.com/cloudfoundry-incubator/kubo-deployment/tree/v0.14.0/src/kubo-deployment-tests

https://t.me/catops_chat/61258

MaxymVlasov avatar Apr 16 '22 21:04 MaxymVlasov

That works awesome https://github.com/kward/shunit2

MaxymVlasov avatar Jan 27 '23 18:01 MaxymVlasov