This folder contains automated tests for this Module. All of the tests are written in Go.
Most of these are "integration tests" that deploy real infrastructure using Terraform and verify that infrastructure
works as expected using a helper library called Terratest.
WARNING: These Tests May Cost You Money!
Note #1: Many of these tests create real resources in a GCP account and then try to clean those resources up at
the end of a test run. That means these tests may cost you money to run! When adding tests, please be considerate of
the resources you create and take extra care to clean everything up when you're done!
Note #2: Never forcefully shut the tests down (e.g. by hitting CTRL + C) or the cleanup tasks won't run!
Note #3: We set -timeout 60m on all tests not because they necessarily take that long, but because Go has a
default test timeout of 10 minutes, after which it forcefully kills the tests with a SIGQUIT, preventing the cleanup
tasks from running. Therefore, we set an overlying long timeout to make sure all tests have enough time to finish and
clean up.
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"310ac2e197373e974a3a1b59be2a0adf188c2cce"}]},{"name":".gitignore","path":".gitignore","sha":"1126bffabd62465b897cca526c36429656704cb8"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"1b848ef901cc69bf0207a6715cab173e30f6f95d"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"e47d027ad15beb415e4f619397c8a3ef1ccd2497"},{"name":"CONTRIBUTING.md","path":"CONTRIBUTING.md","sha":"9069f862a8bc86aca934eb6b46d25ccdd0890adc"},{"name":"GRUNTWORK_PHILOSOPHY.md","path":"GRUNTWORK_PHILOSOPHY.md","sha":"02d9873a74c99fe6d9b6b26bd9f8eb4a7a699c32"},{"name":"LICENSE","path":"LICENSE","sha":"d645695673349e3947e8e5ae42332d0ac3164cd7"},{"name":"NOTICE","path":"NOTICE","sha":"87a256bde643610e57c37ddc30bd5184b763f461"},{"name":"README.md","path":"README.md","sha":"f04b58d61790b562c49ebbb295f45feb75f59414"},{"name":"examples","children":[{"name":"gke-basic-helm","children":[{"name":"README.md","path":"examples/gke-basic-helm/README.md","sha":"b1ad67c90bd5ef4663cc792c06396875ec83bbc2"}]},{"name":"gke-private-cluster","children":[{"name":"README.md","path":"examples/gke-private-cluster/README.md","sha":"70597859aef8c841ef547007f0c5abf0daa639c7"},{"name":"example-app","children":[{"name":"nginx.yml","path":"examples/gke-private-cluster/example-app/nginx.yml","sha":"e4b2476d18dfcee49acbc823babbfc44c76ac1b3"}]},{"name":"main.tf","path":"examples/gke-private-cluster/main.tf","sha":"8dbd94c30bf549eff48045c5cacba799cd52afb4"},{"name":"outputs.tf","path":"examples/gke-private-cluster/outputs.tf","sha":"431590d8fd52bec033e24a6c47aa6f1d66e3f95e"},{"name":"variables.tf","path":"examples/gke-private-cluster/variables.tf","sha":"74f403c2ab1cf221c825a2f8e391dcef997267f1"}]},{"name":"gke-public-cluster","children":[{"name":"README.md","path":"examples/gke-public-cluster/README.md","sha":"55bf1839dfd506d2fb9aaebdcd8b05011a612d6a"},{"name":"main.tf","path":"examples/gke-public-cluster/main.tf","sha":"5bfe269d074fbdadef7195768da63889cabee3e6"},{"name":"outputs.tf","path":"examples/gke-public-cluster/outputs.tf","sha":"431590d8fd52bec033e24a6c47aa6f1d66e3f95e"},{"name":"variables.tf","path":"examples/gke-public-cluster/variables.tf","sha":"181685530bc8f6545caa252b7804ef97cede932b"}]}]},{"name":"main.tf","path":"main.tf","sha":"dab4502ad924779d8293595c2881c29d95f0cd4d"},{"name":"modules","children":[{"name":"gke-cluster","children":[{"name":"README.md","path":"modules/gke-cluster/README.md","sha":"19bad2de5bb4ba3cf982d6ac5080cbb47ac4a6a7"},{"name":"main.tf","path":"modules/gke-cluster/main.tf","sha":"fa38889a624cbb449d312cd5d691fb5a32d3606a"},{"name":"outputs.tf","path":"modules/gke-cluster/outputs.tf","sha":"b6d00fc16ffdd39b74e80230f2ead8fc17b75098"},{"name":"variables.tf","path":"modules/gke-cluster/variables.tf","sha":"c441061edfca9a23860d51a54f088b9b312233a5"}]},{"name":"gke-service-account","children":[{"name":"README.md","path":"modules/gke-service-account/README.md","sha":"38e6ede2d087dcdba2df7a7ae97810c16b72d8d8"},{"name":"main.tf","path":"modules/gke-service-account/main.tf","sha":"35c0cf2922f244fefa75ad13b2c4103bda4b7ddf"},{"name":"outputs.tf","path":"modules/gke-service-account/outputs.tf","sha":"6655c1fb7275d26722c483af07d1820f33697e3a"},{"name":"variables.tf","path":"modules/gke-service-account/variables.tf","sha":"16ababc6c790759a0e1d1dd1c62557f747dfa9a1"}]}]},{"name":"outputs.tf","path":"outputs.tf","sha":"431590d8fd52bec033e24a6c47aa6f1d66e3f95e"},{"name":"test","children":[{"name":"README.md","path":"test/README.md","sha":"efd43a3b31a2b93a64f8a6a9b0eff22b09caa0a6","toggled":true},{"name":"charts","children":[{"name":"minimal-pod","children":[{"name":".helmignore","path":"test/charts/minimal-pod/.helmignore","sha":"f0c13194444163d1cba5c67d9e79231a62bc8f44"},{"name":"Chart.yaml","path":"test/charts/minimal-pod/Chart.yaml","sha":"9b6289f1c43dbc2c4b1f9d0ae9933a5a9ca06e1b"},{"name":"templates","children":[{"name":"_helpers.tpl","path":"test/charts/minimal-pod/templates/_helpers.tpl","sha":"3e013e603b8292ed9c493e4b46522cbffaaf16d3"},{"name":"pod.yaml","path":"test/charts/minimal-pod/templates/pod.yaml","sha":"6d84a9a5c72dcb3e493e1f4a5b869fea92abff54"}]},{"name":"values.yaml","path":"test/charts/minimal-pod/values.yaml","sha":"c3a88d09ca9e077599eb8362fa910171270e0ad6"}]}]},{"name":"gke_basic_helm_test.go","path":"test/gke_basic_helm_test.go","sha":"55a969c1110c41335a78bf62bd1b25e686827409"},{"name":"gke_cluster_test.go","path":"test/gke_cluster_test.go","sha":"38d2068465d0f98c61e40774ab44d5534c620bcc"},{"name":"go.mod","path":"test/go.mod","sha":"cbec165db3063f19f1be1d11adc84e5fa35deb5e"},{"name":"go.sum","path":"test/go.sum","sha":"e7c9ba4756d884f5051efa5037352722d2e55ad9"},{"name":"terratest_options.go","path":"test/terratest_options.go","sha":"875cb013a44955910fce1bc5909103f2a2241a47"},{"name":"test_helpers.go","path":"test/test_helpers.go","sha":"33ef675bb7206ab6fb5176d60115e0f261e5c190"},{"name":"validation","children":[{"name":"validate_all_modules_and_examples_test.go","path":"test/validation/validate_all_modules_and_examples_test.go","sha":"74c928d0cbc2914e5cd708277bd857cb2375b660"}]}],"toggled":true},{"name":"variables.tf","path":"variables.tf","sha":"3c24dc1b8c5e8e0528f405a97e6f18e409c161b3"}]},"detailsContent":"<h1 class=\"preview__body--title\" id=\"tests\">Tests</h1><div class=\"preview__body--border\"></div><p>This folder contains automated tests for this Module. All of the tests are written in <a href=\"https://golang.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Go</a>.\nMost of these are "integration tests" that deploy real infrastructure using Terraform and verify that infrastructure\nworks as expected using a helper library called <a href=\"/repos/terratest\" class=\"preview__body--description--blue\">Terratest</a>.</p>\n<h2 class=\"preview__body--subtitle\" id=\"warning-these-tests-may-cost-you-money\">WARNING: These Tests May Cost You Money!</h2>\n<p><strong>Note #1</strong>: Many of these tests create real resources in a GCP account and then try to clean those resources up at\nthe end of a test run. That means these tests may cost you money to run! When adding tests, please be considerate of\nthe resources you create and take extra care to clean everything up when you're done!</p>\n<p><strong>Note #2</strong>: Never forcefully shut the tests down (e.g. by hitting <code>CTRL + C</code>) or the cleanup tasks won't run!</p>\n<p><strong>Note #3</strong>: We set <code>-timeout 60m</code> on all tests not because they necessarily take that long, but because Go has a\ndefault test timeout of 10 minutes, after which it forcefully kills the tests with a <code>SIGQUIT</code>, preventing the cleanup\ntasks from running. Therefore, we set an overlying long timeout to make sure all tests have enough time to finish and\nclean up.</p>\n<h2 class=\"preview__body--subtitle\" id=\"running-the-tests\">Running the tests</h2>\n<h3 class=\"preview__body--subtitle\" id=\"prerequisites\">Prerequisites</h3>\n<ul>\n<li>Install the latest version of <a href=\"https://golang.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Go</a>.</li>\n<li>Install <a href=\"https://www.terraform.io/downloads.html\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform</a>.</li>\n<li>Configure your GCP credentials using one of the <a href=\"https://cloud.google.com/sdk/docs/authorizing\" class=\"preview__body--description--blue\" target=\"_blank\">options supported by the Google Cloud SDK</a>.</li>\n</ul>\n<h3 class=\"preview__body--subtitle\" id=\"one-time-setup\">One-time setup</h3>\n<p>Download Go dependencies:</p>\n<pre><span class=\"hljs-keyword\">cd</span> test\n<span class=\"hljs-keyword\">go</span> <span class=\"hljs-keyword\">mod</span> download\n</pre>\n<h3 class=\"preview__body--subtitle\" id=\"run-all-the-tests\">Run all the tests</h3>\n<pre><span class=\"hljs-built_in\">cd</span> <span class=\"hljs-built_in\">test</span>\ngo <span class=\"hljs-built_in\">test</span> -v -timeout 60m\n</pre>\n<h3 class=\"preview__body--subtitle\" id=\"run-a-specific-test\">Run a specific test</h3>\n<p>To run a specific test called <code>TestFoo</code>:</p>\n<pre><span class=\"hljs-keyword\">cd</span> <span class=\"hljs-keyword\">test</span>\ngo <span class=\"hljs-keyword\">test</span> -v -timeout 60m -<span class=\"hljs-keyword\">run</span> TestFoo\n</pre>\n","repoName":"terraform-google-gke","repoRef":"v0.10.0","serviceDescriptor":{"serviceName":"Google Kubernetes Engine (GKE) Cluster","serviceRepoName":"terraform-google-gke","serviceRepoOrg":"gruntwork-io","cloudProviders":["gcp"],"description":"Deploy a Kubernetes cluster on top of Google Kubernetes Engine (GKE).","imageUrl":"grunt.png","licenseType":"open-source","technologies":["Terraform","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"Docker orchestration","fileName":"README.md","filePath":"/test","title":"Repo Browser: Google Kubernetes Engine (GKE) Cluster","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}