From 7727e3d7d2bd3dae54cdadf6fe585ba2cee08541 Mon Sep 17 00:00:00 2001 From: confusdcodr Date: Tue, 1 Oct 2019 15:44:47 -0400 Subject: [PATCH 1/2] Improve output of tests --- .gitignore | 3 +++ CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++---- Makefile | 2 +- tests/module_test.go | 30 +++++++++++++------------- 4 files changed, 64 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 631ccab..a72784f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ terraform.tfstate* # ignore go files vendor/ + +# ignore log files +*.log diff --git a/CHANGELOG.md b/CHANGELOG.md index e35b081..ceef9bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -### 1.0.2 +### 1.0.4 + +**Commit Delta**: [Change from 1.0.3 release] (https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/1.0.3...1.0.4) + +**Released**: 2019.10.01 + +**Summary**: + +* Update testing framework to have a more user-friendly output +* Update CHANGELOG + +### 1.0.3 -**Commit Delta**: https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/1.0.1...1.0.2 +**Commit Delta**: [Change from 1.0.2 release] (https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/1.0.2...1.0.3) **Released**: 2019.09.19 @@ -16,9 +27,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p * Add an additional test * Update go module versions +### 1.0.2 + +**Commit Delta**: [Change from 1.0.1 release] (https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/1.0.1...1.0.2) + +**Released**: 2019.09.06 + +**Summary**: + +* Update dependabot configuration to include test cases and go:modules +* Add test cases + ### 1.0.1 -**Commit Delta**: https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/1.0.0...1.0.1 +**Commit Delta**: [Change from 1.0.0 release] (https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/1.0.0...1.0.1) **Released**: 2019.09.05 @@ -28,7 +50,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p ### 1.0.0 -**Commit Delta**: https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/0.0.2...1.0.0 +**Commit Delta**: [Change from 0.0.2 release] (https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/0.0.2...1.0.0) **Released**: 2019.09.04 @@ -36,6 +58,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p * Upgrade module to use terraform 0.12.x. This is not backwards compatible +### 0.0.2 + +**Commit Delta**: [Change from 0.0.1 release] (https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/0.0.1...0.0.2) + +**Released**: 2019.08.21 + +**Summary**: + +* Add dependabot + +### 0.0.1 + +**Commit Delta**: [Change from 0.0.0 release] (https://github.com/plus3it/terraform-aws-tardigrade-inspector/compare/0.0.0...0.0.1) + +**Released**: 2019.08.19 + +**Summary**: + +* Add testing framework + ### 0.0.0 **Commit Delta**: N/A diff --git a/Makefile b/Makefile index 36d423a..58c83ff 100644 --- a/Makefile +++ b/Makefile @@ -124,6 +124,6 @@ terratest/install: | guard/program/go cd tests && go mod tidy terratest/test: | guard/program/go - cd tests && go test -timeout 20m + cd tests && go test -count=1 -timeout 20m test: terratest/test diff --git a/tests/module_test.go b/tests/module_test.go index 61254e3..f5ad2ef 100644 --- a/tests/module_test.go +++ b/tests/module_test.go @@ -19,26 +19,24 @@ func TestModule(t *testing.T) { for _, f := range files { // look for directories with test cases in it if f.IsDir() && f.Name() != "vendor" { - investigateDirectory(t, f) + t.Run(f.Name(), func(t *testing.T) { + // check if a prereq directory exists + prereqDir := f.Name() + "/prereq/" + if _, err := os.Stat(prereqDir); err == nil { + prereqOptions := createTerraformOptions(prereqDir) + defer terraform.Destroy(t, prereqOptions) + terraform.InitAndApply(t, prereqOptions) + } + + // run terraform code for test case + terraformOptions := createTerraformOptions(f.Name()) + defer terraform.Destroy(t, terraformOptions) + terraform.InitAndApply(t, terraformOptions) + }) } } } -func investigateDirectory(t *testing.T, directory os.FileInfo) { - // check if a prereq directory exists - prereqDir := directory.Name() + "/prereq/" - if _, err := os.Stat(prereqDir); err == nil { - prereqOptions := createTerraformOptions(prereqDir) - defer terraform.Destroy(t, prereqOptions) - terraform.InitAndApply(t, prereqOptions) - } - - // run terraform code for test case - terraformOptions := createTerraformOptions(directory.Name()) - defer terraform.Destroy(t, terraformOptions) - terraform.InitAndApply(t, terraformOptions) -} - func createTerraformOptions(directory string) *terraform.Options { terraformOptions := &terraform.Options{ TerraformDir: directory, From d806b5682cb50b7143d57e04d5f150ed0b0a6c55 Mon Sep 17 00:00:00 2001 From: confusdcodr Date: Tue, 1 Oct 2019 16:47:55 -0400 Subject: [PATCH 2/2] =?UTF-8?q?Bump=20version:=201.0.3=20=E2=86=92=201.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 89690d7..6809bc3 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.3 +current_version = 1.0.4 commit = True tag = False tag_name = {new_version}