├── .circleci └── config.yml ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── no-response.yml ├── pull_request_template.md └── workflows │ └── ci.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CODEOWNERS ├── LICENSE ├── NOTICE ├── README.md ├── REFACTOR.md ├── cmd ├── pick-instance-type │ └── main.go └── terratest_log_parser │ └── main.go ├── docs ├── .gitignore ├── CNAME ├── Dockerfile ├── Gemfile ├── Gemfile.lock ├── README.md ├── _config.yml ├── _data │ ├── examples.yml │ └── prism_extends.yml ├── _docs │ ├── 01_getting-started │ │ ├── examples.md │ │ ├── godoc.md │ │ ├── introduction.md │ │ ├── packages-overview.md │ │ └── quick-start.md │ ├── 02_testing-best-practices │ │ ├── alternative-testing-tools.md │ │ ├── avoid-test-caching.md │ │ ├── cleanup.md │ │ ├── debugging-interleaved-test-output.md │ │ ├── error-handling.md │ │ ├── idempotent.md │ │ ├── iterating-locally-using-docker.md │ │ ├── iterating-locally-using-test-stages.md │ │ ├── namespacing.md │ │ ├── picking-instance-types.md │ │ ├── testing-environment.md │ │ ├── timeouts-and-logging.md │ │ ├── tools-and-plugins.md │ │ └── unit-integration-end-to-end-test.md │ └── 04_community │ │ ├── contributing.md │ │ ├── license.md │ │ └── support.md ├── _includes │ ├── built-by.html │ ├── canonical-url.html │ ├── collection_browser │ │ ├── _cta-section.html │ │ ├── _doc-header.html │ │ ├── _doc-page.html │ │ ├── _doc-thumb.html │ │ ├── _doc-thumb__excerpt.html │ │ ├── _docs-list.html │ │ ├── _no-search-results.html │ │ ├── _search.html │ │ ├── _sidebar.html │ │ ├── browser.html │ │ └── navigation │ │ │ └── _collection_toc.html │ ├── examples │ │ ├── example.html │ │ └── explorer.html │ ├── favicon.html │ ├── footer.html │ ├── get-access.html │ ├── head.html │ ├── header-min.html │ ├── header.html │ ├── links-n-built-by.html │ ├── links-n-get-access.html │ ├── links-section.html │ ├── logo.html │ ├── navbar.html │ ├── scripts.html │ ├── share-meta.html │ ├── styles.html │ ├── switch.html │ └── video-player.html ├── _layouts │ ├── collection-browser-doc.html │ ├── collection-browser.html │ ├── contact.html │ ├── default.html │ ├── post.html │ └── subpage.html ├── _pages │ ├── 404 │ │ └── 404.md │ ├── commercial-support │ │ └── index.html │ ├── contact │ │ ├── _contact-form.html │ │ └── index.html │ ├── cookie-policy │ │ └── index.md │ ├── docs │ │ └── index.html │ ├── examples │ │ └── index.html │ ├── index │ │ ├── _built_by.html │ │ ├── _cta_section.html │ │ ├── _header.html │ │ ├── _terratest-in-4-steps.html │ │ ├── _test-with-terratest.html │ │ ├── _watch.html │ │ └── index.html │ └── thanks │ │ └── index.html ├── _posts │ └── .keep ├── assets │ ├── css │ │ ├── _variables.scss │ │ ├── bootstrap │ │ │ └── scss │ │ │ │ └── bootstrap.scss │ │ ├── collection_browser.scss │ │ ├── components.scss │ │ ├── examples.scss │ │ ├── global.scss │ │ ├── pages │ │ │ ├── contact.scss │ │ │ ├── cookie-policy.scss │ │ │ ├── home.scss │ │ │ └── support.scss │ │ ├── prism.css │ │ ├── prism_custom.scss │ │ ├── styles.scss │ │ ├── subpage.scss │ │ └── utilities.scss │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── img │ │ ├── Terratest_video_button.svg │ │ ├── arrows │ │ │ ├── arrow-down.svg │ │ │ ├── arrow-right.svg │ │ │ ├── arrow-thin-down.svg │ │ │ ├── arrow-thin-right.svg │ │ │ └── dash-thin.svg │ │ ├── collections │ │ │ └── documentation │ │ │ │ └── promote-immutable-Terraform-code-across-envs.png │ │ ├── contact │ │ │ ├── bottom.svg │ │ │ ├── bottom@3x.png │ │ │ ├── contact-mobile-bottom.svg │ │ │ ├── right.svg │ │ │ ├── right@3x.png │ │ │ ├── top.svg │ │ │ └── top@3x.png │ │ ├── docs │ │ │ └── debugging-interleaved-test-output │ │ │ │ ├── circleci-logs.png │ │ │ │ └── circleci-test-summary.png │ │ ├── favicon │ │ │ ├── android-icon-144x144.png │ │ │ ├── android-icon-192x192.png │ │ │ ├── android-icon-36x36.png │ │ │ ├── android-icon-48x48.png │ │ │ ├── android-icon-72x72.png │ │ │ ├── android-icon-96x96.png │ │ │ ├── apple-icon-114x114.png │ │ │ ├── apple-icon-120x120.png │ │ │ ├── apple-icon-144x144.png │ │ │ ├── apple-icon-152x152.png │ │ │ ├── apple-icon-180x180.png │ │ │ ├── apple-icon-57x57.png │ │ │ ├── apple-icon-60x60.png │ │ │ ├── apple-icon-72x72.png │ │ │ ├── apple-icon-76x76.png │ │ │ ├── apple-icon-precomposed.png │ │ │ ├── apple-icon.png │ │ │ ├── browserconfig.xml │ │ │ ├── favicon-16x16.png │ │ │ ├── favicon-32x32.png │ │ │ ├── favicon-96x96.png │ │ │ ├── favicon.ico │ │ │ ├── manifest.json │ │ │ ├── ms-icon-144x144.png │ │ │ ├── ms-icon-150x150.png │ │ │ ├── ms-icon-310x310.png │ │ │ └── ms-icon-70x70.png │ │ ├── home │ │ │ ├── built-by-bg.svg │ │ │ ├── built-by-left.png │ │ │ ├── built-by-right.png │ │ │ ├── terratest_icon_1.svg │ │ │ ├── terratest_icon_2.svg │ │ │ ├── terratest_icon_3.svg │ │ │ ├── terratest_icon_4.svg │ │ │ ├── terratest_middle_left.svg │ │ │ ├── terratest_middle_right.svg │ │ │ ├── terratest_top_left.svg │ │ │ └── terratest_top_right.svg │ │ ├── icons │ │ │ ├── bug.svg │ │ │ ├── chatbubbles.svg │ │ │ ├── checkmark-blue.svg │ │ │ ├── checkmark-darkblue.svg │ │ │ ├── codereviews.svg │ │ │ ├── menu-dots-icon.png │ │ │ ├── play_icon.png │ │ │ ├── quote.svg │ │ │ ├── wand.svg │ │ │ └── xmark.svg │ │ ├── key-features │ │ │ ├── key-features-backend-dry-sm.png │ │ │ ├── key-features-backend-dry.png │ │ │ ├── key-features-backend-dry.svg │ │ │ ├── key-features-cli-dry-sm.png │ │ │ ├── key-features-cli-dry.svg │ │ │ ├── key-features-multiple-modules-at-once-sm.png │ │ │ ├── key-features-multiple-modules-at-once.png │ │ │ ├── key-features-multiple-modules-at-once.svg │ │ │ ├── key-features-terraform-code-dry-sm.png │ │ │ ├── key-features-terraform-code-dry.png │ │ │ └── key-features-terraform-code-dry.svg │ │ ├── link-icon.png │ │ ├── link-icon.svg │ │ ├── logos │ │ │ ├── aws-logo.png │ │ │ ├── azure-logo.png │ │ │ ├── docker-logo.png │ │ │ ├── gcp-logo.png │ │ │ ├── github-logo.png │ │ │ ├── kubernetes-logo.png │ │ │ ├── opa-logo.png │ │ │ ├── packer-logo.png │ │ │ ├── terraform-logo.png │ │ │ └── terragrunt-logo.png │ │ ├── no-search-results.png │ │ ├── temp_logos.PNG │ │ ├── terratest-thumbnail.png │ │ ├── terratest_subpage_left.svg │ │ ├── terratest_subpage_right.svg │ │ ├── terratest_subpage_short_top.svg │ │ ├── terratest_video_frame.png │ │ ├── terratest_video_frame.svg │ │ └── video_thumb.png │ └── js │ │ ├── collection-browser_scroll.js │ │ ├── collection-browser_search.js │ │ ├── collection-browser_toc.js │ │ ├── contact-form.js │ │ ├── cookie.js │ │ ├── examples.js │ │ ├── main.js │ │ ├── prism.js │ │ └── video-player.js ├── docker-compose.yml ├── jekyll-serve.sh └── scripts │ ├── convert_adoc_to_md.sh │ └── convert_md_to_adoc.sh ├── examples ├── azure │ ├── README.md │ ├── terraform-azure-aci-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── terraform-azure-acr-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── terraform-azure-actiongroup-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── terraform-azure-aks-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── nginx-deployment.yml │ │ ├── output.tf │ │ └── variables.tf │ ├── terraform-azure-availabilityset-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-container-apps-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-cosmosdb-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-datafactory-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-disk-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-frontdoor-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── terraform-azure-functionapp-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── terraform-azure-keyvault-example │ │ ├── README.md │ │ ├── example.pfx │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-loadbalancer-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-loganalytics-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-monitor-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-mysqldb-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-network-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-nsg-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-postgresql-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── terraform-azure-recoveryservices-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-resourcegroup-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-servicebus-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-sqldb-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-sqlmanagedinstance-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-storage-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ ├── terraform-azure-synapse-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf │ └── terraform-azure-vm-example │ │ ├── README.md │ │ ├── main.tf │ │ ├── outputs.tf │ │ └── variables.tf ├── docker-compose-stdout-example │ ├── Dockerfile │ ├── bash_script.sh │ └── docker-compose.yml ├── docker-hello-world-example │ ├── Dockerfile │ └── README.md ├── helm-basic-example │ ├── Chart.yaml │ ├── README.md │ ├── templates │ │ ├── _helpers.tpl │ │ ├── deployment.yaml │ │ └── service.yaml │ └── values.yaml ├── helm-dependency-example │ ├── .gitignore │ ├── Chart.yaml │ ├── README.md │ ├── templates │ │ ├── _helpers.tpl │ │ ├── deployment.yaml │ │ └── service.yaml │ └── values.yaml ├── kubernetes-basic-example │ ├── README.md │ ├── nginx-deployment.yml │ └── podinfo-daemonset.yml ├── kubernetes-hello-world-example │ ├── README.md │ └── hello-world-deployment.yml ├── kubernetes-kustomize-example │ ├── README.md │ ├── deployment.yaml │ ├── kustomization.yaml │ └── service.yaml ├── kubernetes-rbac-example │ ├── README.md │ └── namespace-service-account.yml ├── packer-basic-example │ ├── README.md │ ├── build-gcp.pkr.hcl │ └── build.pkr.hcl ├── packer-docker-example │ ├── .env │ ├── README.md │ ├── app.rb │ ├── build.json │ ├── build.pkr.hcl │ ├── configure-sinatra-app.sh │ └── docker-compose.yml ├── packer-hello-world-example │ ├── README.md │ └── build.pkr.hcl ├── terraform-asg-scp-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-aws-dynamodb-example │ ├── README.md │ ├── main.tf │ └── variables.tf ├── terraform-aws-ec2-windows-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── packer │ │ ├── build.pkr.hcl │ │ └── scripts │ │ │ ├── bootstrap_windows.txt │ │ │ ├── install_chocolatey.ps1 │ │ │ └── install_packages.ps1 │ └── variables.tf ├── terraform-aws-ecs-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-aws-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-aws-hello-world-example │ ├── README.md │ └── main.tf ├── terraform-aws-lambda-example │ ├── .gitignore │ ├── README.md │ ├── main.tf │ ├── src │ │ ├── README.md │ │ └── bootstrap.go │ └── variables.tf ├── terraform-aws-network-example │ ├── README.md │ ├── main.tf │ ├── output.tf │ └── variables.tf ├── terraform-aws-rds-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-aws-s3-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-aws-ssm-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-backend-example │ ├── README.md │ └── main.tf ├── terraform-basic-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── varfile.tfvars │ └── variables.tf ├── terraform-database-example │ ├── REAME.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-gcp-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-gcp-hello-world-example │ ├── README.md │ └── main.tf ├── terraform-gcp-ig-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-hello-world-example │ ├── README.md │ └── main.tf ├── terraform-http-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf ├── terraform-opa-example │ ├── README.md │ ├── fail │ │ ├── main_fail.tf │ │ ├── output.tf │ │ └── variables.tf │ ├── pass │ │ ├── main_pass.tf │ │ ├── output.tf │ │ └── variables.tf │ └── policy │ │ └── enforce_source.rego ├── terraform-packer-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf ├── terraform-redeploy-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── user-data │ │ └── user-data.sh │ └── variables.tf ├── terraform-remote-exec-example │ ├── README.md │ ├── files │ │ └── get-public-ip.sh │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-ssh-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ └── variables.tf ├── terraform-ssh-password-example │ ├── README.md │ ├── main.tf │ ├── outputs.tf │ ├── user_data.sh │ └── variables.tf ├── terragrunt-example │ ├── README.md │ ├── main.tf │ └── terragrunt.hcl └── terragrunt-second-example │ ├── main.tf │ └── terragrunt.hcl ├── go.mod ├── go.sum ├── modules ├── aws │ ├── account.go │ ├── account_test.go │ ├── acm.go │ ├── ami.go │ ├── ami_test.go │ ├── asg.go │ ├── asg_test.go │ ├── auth.go │ ├── aws.go │ ├── cloudwatch.go │ ├── dynamodb.go │ ├── ebs.go │ ├── ec2-files.go │ ├── ec2-syslog.go │ ├── ec2.go │ ├── ec2_test.go │ ├── ecr.go │ ├── ecr_test.go │ ├── ecs.go │ ├── ecs_test.go │ ├── errors.go │ ├── iam.go │ ├── iam_test.go │ ├── keypair.go │ ├── keypair_test.go │ ├── kms.go │ ├── lambda.go │ ├── lambda_test.go │ ├── rds.go │ ├── rds_test.go │ ├── region.go │ ├── region_test.go │ ├── route53.go │ ├── route53_test.go │ ├── s3.go │ ├── s3_test.go │ ├── secretsmanager.go │ ├── secretsmanager_test.go │ ├── sns.go │ ├── sns_test.go │ ├── sqs.go │ ├── sqs_test.go │ ├── ssm.go │ ├── ssm_test.go │ ├── vpc.go │ └── vpc_test.go ├── azure │ ├── actiongroup.go │ ├── actiongroup_test.go │ ├── aks.go │ ├── appService.go │ ├── appService_test.go │ ├── authorizer.go │ ├── availabilityset.go │ ├── availabilityset_test.go │ ├── azure.go │ ├── client_factory.go │ ├── client_factory_test.go │ ├── common.go │ ├── common_test.go │ ├── compute.go │ ├── compute_test.go │ ├── container_apps.go │ ├── container_apps_test.go │ ├── containers.go │ ├── containers_test.go │ ├── cosmosdb.go │ ├── datafactory.go │ ├── datafactory_test.go │ ├── disk.go │ ├── disk_test.go │ ├── enums.go │ ├── errors.go │ ├── frontdoor.go │ ├── frontdoor_test.go │ ├── keyvault.go │ ├── keyvault_test.go │ ├── loadbalancer.go │ ├── loadbalancer_test.go │ ├── loganalytics.go │ ├── loganalytics_test.go │ ├── monitor.go │ ├── monitor_test.go │ ├── mysql.go │ ├── mysql_test.go │ ├── networkinterface.go │ ├── networkinterface_test.go │ ├── nsg.go │ ├── nsg_test.go │ ├── postgresql.go │ ├── postgresql_test.go │ ├── privatednszone.go │ ├── privatednszone_test.go │ ├── publicaddress.go │ ├── publicaddress_test.go │ ├── recoveryservices.go │ ├── recoveryservices_test.go │ ├── region.go │ ├── region_test.go │ ├── resourcegroup.go │ ├── resourcegroup_test.go │ ├── resourcegroupv2.go │ ├── resourcegroupv2_test.go │ ├── resourceid.go │ ├── resourceid_test.go │ ├── servicebus.go │ ├── servicebus_test.go │ ├── sql.go │ ├── sql_managedinstance.go │ ├── sql_managedinstance_test.go │ ├── sql_test.go │ ├── storage.go │ ├── storage_test.go │ ├── subscription.go │ ├── synapse.go │ ├── synapse_test.go │ ├── virtualnetwork.go │ └── virtualnetwork_test.go ├── collections │ ├── collections.go │ ├── errors.go │ ├── lists.go │ ├── lists_test.go │ ├── stringslicevalue.go │ └── stringslicevalue_test.go ├── database │ └── database.go ├── dns-helper │ ├── dns_helper.go │ ├── dns_helper_test.go │ ├── dns_local_server.go │ └── errors.go ├── docker │ ├── build.go │ ├── build_test.go │ ├── docker.go │ ├── docker_compose.go │ ├── docker_compose_test.go │ ├── host.go │ ├── host_test.go │ ├── images.go │ ├── images_test.go │ ├── inspect.go │ ├── inspect_test.go │ ├── push.go │ ├── run.go │ ├── run_test.go │ ├── stop.go │ └── stop_test.go ├── environment │ ├── environment.go │ ├── envvar.go │ └── envvar_test.go ├── files │ ├── errors.go │ ├── files.go │ └── files_test.go ├── gcp │ ├── cloudbuild.go │ ├── cloudbuild_test.go │ ├── compute.go │ ├── compute_test.go │ ├── gcp.go │ ├── gcr.go │ ├── oslogin.go │ ├── oslogin_test.go │ ├── provider.go │ ├── region.go │ ├── region_test.go │ ├── static_token.go │ ├── static_token_test.go │ ├── storage.go │ └── storage_test.go ├── git │ ├── git.go │ └── git_test.go ├── helm │ ├── cmd.go │ ├── cmd_test.go │ ├── delete.go │ ├── errors.go │ ├── format.go │ ├── format_test.go │ ├── helm.go │ ├── install.go │ ├── install_test.go │ ├── options.go │ ├── repo.go │ ├── rollback.go │ ├── template.go │ ├── template_test.go │ ├── testdata │ │ ├── configmap-literalblock.yaml │ │ ├── deployment.yaml │ │ ├── deployments-array.yaml │ │ ├── deployments.yaml │ │ ├── deprecated-chart │ │ │ ├── Chart.yaml │ │ │ └── templates │ │ │ │ └── deployment.yaml │ │ ├── invalid-duplicate.yaml │ │ └── multiple-manifests │ │ │ ├── Chart.yaml │ │ │ └── templates │ │ │ ├── configmap.yaml │ │ │ └── deployment.yaml │ ├── upgrade.go │ └── upgrade_test.go ├── http-helper │ ├── continuous.go │ ├── dummy_server.go │ ├── dummy_server_test.go │ ├── errors.go │ ├── http_helper.go │ └── http_helper_test.go ├── k8s │ ├── client.go │ ├── cluster_role.go │ ├── cluster_role_test.go │ ├── config.go │ ├── config_test.go │ ├── configmap.go │ ├── configmap_test.go │ ├── cronjob.go │ ├── cronjob_test.go │ ├── daemonset.go │ ├── daemonset_test.go │ ├── deployment.go │ ├── deployment_test.go │ ├── errors.go │ ├── errors_test.go │ ├── event.go │ ├── event_test.go │ ├── ingress.go │ ├── ingress_test.go │ ├── job.go │ ├── job_test.go │ ├── jsonpath.go │ ├── jsonpath_test.go │ ├── k8s.go │ ├── kubectl.go │ ├── kubectl_options.go │ ├── kubectl_test.go │ ├── minikube.go │ ├── minikube_test.go │ ├── namespace.go │ ├── namespace_test.go │ ├── networkpolicy.go │ ├── networkpolicy_test.go │ ├── node.go │ ├── node_test.go │ ├── persistent_volume.go │ ├── persistent_volume_claim.go │ ├── persistent_volume_claim_test.go │ ├── persistent_volume_test.go │ ├── pod.go │ ├── pod_test.go │ ├── replicaset.go │ ├── replicaset_test.go │ ├── role.go │ ├── role_test.go │ ├── secret.go │ ├── secret_test.go │ ├── self_subject_access_review.go │ ├── self_subject_access_review_test.go │ ├── service.go │ ├── service_account.go │ ├── service_account_test.go │ ├── service_test.go │ ├── tunnel.go │ ├── tunnel_test.go │ ├── version.go │ └── version_test.go ├── logger │ ├── logger.go │ ├── logger_test.go │ └── parser │ │ ├── failed_test_marker.go │ │ ├── failed_test_marker_test.go │ │ ├── fixtures │ │ ├── basic_example.log │ │ ├── basic_example_expected │ │ │ ├── TestCloseChannelsClosesAll.log │ │ │ ├── TestEnsureDirectoryExistsCreatesDirectory.log │ │ │ ├── TestEnsureDirectoryExistsHandlesExistingDirectory.log │ │ │ ├── TestGetIndent.log │ │ │ ├── TestGetIndent │ │ │ │ ├── BaseCase.log │ │ │ │ ├── EmptyString.log │ │ │ │ ├── MixTabSpace.log │ │ │ │ ├── NoIndent.log │ │ │ │ └── Tabs.log │ │ │ ├── TestGetOrCreateChannelCreatesNewChannel.log │ │ │ ├── TestGetOrCreateChannelReturnsExistingChannel.log │ │ │ ├── TestGetOrCreateChannelSpawnsLogCollectorOnCreate.log │ │ │ ├── TestGetTestNameFromResultLine.log │ │ │ ├── TestGetTestNameFromResultLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── SpecialChars.log │ │ │ │ └── WhenFailed.log │ │ │ ├── TestGetTestNameFromStatusLine.log │ │ │ ├── TestGetTestNameFromStatusLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── SpecialChars.log │ │ │ │ ├── WhenCont.log │ │ │ │ └── WhenPaused.log │ │ │ ├── TestIsEmpty.log │ │ │ ├── TestIsPanicLine.log │ │ │ ├── TestIsPanicLine │ │ │ │ ├── BaseCase.log │ │ │ │ └── NotPanic.log │ │ │ ├── TestIsResultLine.log │ │ │ ├── TestIsResultLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── NonResultLine.log │ │ │ │ ├── SpecialChars.log │ │ │ │ └── WhenFailed.log │ │ │ ├── TestIsStatusLine.log │ │ │ ├── TestIsStatusLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── NonStatusLine.log │ │ │ │ ├── SpecialChars.log │ │ │ │ ├── WhenCont.log │ │ │ │ └── WhenPaused.log │ │ │ ├── TestIsSummaryLine.log │ │ │ ├── TestIsSummaryLine │ │ │ │ ├── BaseCase.log │ │ │ │ └── NotSummary.log │ │ │ ├── TestLogCollectorCreatesAndWritesToFile.log │ │ │ ├── TestPeek.log │ │ │ ├── TestPeekEmpty.log │ │ │ ├── TestRemoveDedentedTestResultMarkers.log │ │ │ ├── TestRemoveDedentedTestResultMarkersAll.log │ │ │ ├── TestRemoveDedentedTestResultMarkersEmpty.log │ │ │ ├── TestStackPop.log │ │ │ ├── TestStackPopEmpty.log │ │ │ ├── TestStackPush.log │ │ │ ├── report.xml │ │ │ └── summary.log │ │ ├── failing_example.log │ │ ├── failing_example_expected │ │ │ ├── TestBasicExample.log │ │ │ ├── TestCloseChannelsClosesAll.log │ │ │ ├── TestEnsureDirectoryExistsCreatesDirectory.log │ │ │ ├── TestEnsureDirectoryExistsHandlesExistingDirectory.log │ │ │ ├── TestGetIndent.log │ │ │ ├── TestGetIndent │ │ │ │ ├── BaseCase.log │ │ │ │ ├── EmptyString.log │ │ │ │ ├── MixTabSpace.log │ │ │ │ ├── NoIndent.log │ │ │ │ └── Tabs.log │ │ │ ├── TestGetOrCreateChannelCreatesNewChannel.log │ │ │ ├── TestGetOrCreateChannelReturnsExistingChannel.log │ │ │ ├── TestGetOrCreateChannelSpawnsLogCollectorOnCreate.log │ │ │ ├── TestGetTestNameFromResultLine.log │ │ │ ├── TestGetTestNameFromResultLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── SpecialChars.log │ │ │ │ └── WhenFailed.log │ │ │ ├── TestGetTestNameFromStatusLine.log │ │ │ ├── TestGetTestNameFromStatusLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── SpecialChars.log │ │ │ │ ├── WhenCont.log │ │ │ │ └── WhenPaused.log │ │ │ ├── TestIsEmpty.log │ │ │ ├── TestIsPanicLine.log │ │ │ ├── TestIsPanicLine │ │ │ │ ├── BaseCase.log │ │ │ │ └── NotPanic.log │ │ │ ├── TestIsResultLine.log │ │ │ ├── TestIsResultLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── NonResultLine.log │ │ │ │ ├── SpecialChars.log │ │ │ │ └── WhenFailed.log │ │ │ ├── TestIsStatusLine.log │ │ │ ├── TestIsStatusLine │ │ │ │ ├── BaseCase.log │ │ │ │ ├── Indented.log │ │ │ │ ├── NonStatusLine.log │ │ │ │ ├── SpecialChars.log │ │ │ │ ├── WhenCont.log │ │ │ │ └── WhenPaused.log │ │ │ ├── TestIsSummaryLine.log │ │ │ ├── TestIsSummaryLine │ │ │ │ ├── BaseCase.log │ │ │ │ └── NotSummary.log │ │ │ ├── TestLogCollectorCreatesAndWritesToFile.log │ │ │ ├── TestPanicExample.log │ │ │ ├── TestPeek.log │ │ │ ├── TestPeekEmpty.log │ │ │ ├── TestRealWorldExample.log │ │ │ ├── TestRemoveDedentedTestResultMarkers.log │ │ │ ├── TestRemoveDedentedTestResultMarkersAll.log │ │ │ ├── TestRemoveDedentedTestResultMarkersEmpty.log │ │ │ ├── TestStackPop.log │ │ │ ├── TestStackPopEmpty.log │ │ │ ├── TestStackPush.log │ │ │ ├── report.xml │ │ │ └── summary.log │ │ ├── new_go_failing_example.log │ │ ├── new_go_failing_example_expected │ │ │ ├── TestIntegrationBasicExample.log │ │ │ ├── TestIntegrationFailingExample.log │ │ │ ├── TestIntegrationPanicExample.log │ │ │ ├── report.xml │ │ │ └── summary.log │ │ ├── panic_example.log │ │ └── panic_example_expected │ │ │ ├── TestCloseChannelsClosesAll.log │ │ │ ├── TestEnsureDirectoryExistsCreatesDirectory.log │ │ │ ├── TestEnsureDirectoryExistsHandlesExistingDirectory.log │ │ │ ├── TestGetIndent.log │ │ │ ├── TestGetIndent │ │ │ ├── BaseCase.log │ │ │ ├── EmptyString.log │ │ │ ├── MixTabSpace.log │ │ │ ├── NoIndent.log │ │ │ └── Tabs.log │ │ │ ├── TestGetOrCreateChannelCreatesNewChannel.log │ │ │ ├── TestGetOrCreateChannelReturnsExistingChannel.log │ │ │ ├── TestGetOrCreateChannelSpawnsLogCollectorOnCreate.log │ │ │ ├── TestGetTestNameFromResultLine.log │ │ │ ├── TestGetTestNameFromResultLine │ │ │ ├── BaseCase.log │ │ │ ├── Indented.log │ │ │ ├── SpecialChars.log │ │ │ └── WhenFailed.log │ │ │ ├── TestGetTestNameFromStatusLine.log │ │ │ ├── TestGetTestNameFromStatusLine │ │ │ ├── BaseCase.log │ │ │ ├── Indented.log │ │ │ ├── SpecialChars.log │ │ │ ├── WhenCont.log │ │ │ └── WhenPaused.log │ │ │ ├── TestIsEmpty.log │ │ │ ├── TestIsPanicLine.log │ │ │ ├── TestIsPanicLine │ │ │ ├── BaseCase.log │ │ │ └── NotPanic.log │ │ │ ├── TestIsResultLine.log │ │ │ ├── TestIsResultLine │ │ │ ├── BaseCase.log │ │ │ ├── Indented.log │ │ │ ├── NonResultLine.log │ │ │ ├── SpecialChars.log │ │ │ └── WhenFailed.log │ │ │ ├── TestIsStatusLine.log │ │ │ ├── TestIsStatusLine │ │ │ ├── BaseCase.log │ │ │ ├── Indented.log │ │ │ ├── NonStatusLine.log │ │ │ ├── SpecialChars.log │ │ │ ├── WhenCont.log │ │ │ └── WhenPaused.log │ │ │ ├── TestIsSummaryLine.log │ │ │ ├── TestIsSummaryLine │ │ │ ├── BaseCase.log │ │ │ └── NotSummary.log │ │ │ ├── TestLogCollectorCreatesAndWritesToFile.log │ │ │ ├── TestPeek.log │ │ │ ├── TestPeekEmpty.log │ │ │ ├── TestRemoveDedentedTestResultMarkers.log │ │ │ ├── TestRemoveDedentedTestResultMarkersAll.log │ │ │ ├── TestRemoveDedentedTestResultMarkersEmpty.log │ │ │ ├── TestStackPop.log │ │ │ ├── TestStackPopEmpty.log │ │ │ ├── TestStackPush.log │ │ │ ├── report.xml │ │ │ └── summary.log │ │ ├── helpers_for_test.go │ │ ├── integration_test.go │ │ ├── parser.go │ │ ├── parser_test.go │ │ ├── store.go │ │ └── store_test.go ├── oci │ ├── compute.go │ ├── identity.go │ ├── network.go │ └── provider.go ├── opa │ ├── download_policy.go │ ├── download_policy_test.go │ ├── eval.go │ └── eval_test.go ├── packer │ ├── packer.go │ └── packer_test.go ├── random │ ├── random.go │ └── random_test.go ├── retry │ ├── retry.go │ └── retry_test.go ├── shell │ ├── command.go │ ├── command_test.go │ ├── output.go │ └── shell.go ├── slack │ ├── doc.go │ ├── validate.go │ └── validate_test.go ├── ssh │ ├── agent.go │ ├── agent_test.go │ ├── key_pair.go │ ├── key_pair_test.go │ ├── session.go │ ├── session_test.go │ ├── ssh.go │ └── ssh_test.go ├── terraform │ ├── apply.go │ ├── apply_test.go │ ├── cmd.go │ ├── cmd_test.go │ ├── count.go │ ├── count_test.go │ ├── destroy.go │ ├── errors.go │ ├── format.go │ ├── format_test.go │ ├── get.go │ ├── init.go │ ├── init_test.go │ ├── opa_check.go │ ├── options.go │ ├── options_test.go │ ├── output.go │ ├── output_test.go │ ├── plan.go │ ├── plan_struct.go │ ├── plan_struct_test.go │ ├── plan_test.go │ ├── show.go │ ├── show_test.go │ ├── terraform.go │ ├── validate.go │ ├── validate_test.go │ ├── var-file.go │ ├── var-file_test.go │ ├── var.go │ ├── workspace.go │ └── workspace_test.go ├── test-structure │ ├── save_test_data.go │ ├── save_test_data_test.go │ ├── test_structure.go │ ├── test_structure_test.go │ └── validate_struct.go ├── testing │ └── types.go └── version-checker │ ├── errors.go │ ├── version_checker.go │ └── version_checker_test.go ├── test-docker-images ├── README.md ├── gruntwork-amazon-linux-test │ ├── Dockerfile │ └── README.md ├── gruntwork-centos-test │ ├── Dockerfile │ └── README.md ├── gruntwork-ubuntu-test │ ├── Dockerfile │ └── README.md └── moto │ ├── Dockerfile │ └── README.md └── test ├── azure ├── terraform_azure_aci_example_test.go ├── terraform_azure_acr_example_test.go ├── terraform_azure_actiongroup_example_test.go ├── terraform_azure_aks_example_test.go ├── terraform_azure_availabilityset_example_test.go ├── terraform_azure_container_apps_example_test.go ├── terraform_azure_cosmosdb_example_test.go ├── terraform_azure_datafactory_example_test.go ├── terraform_azure_disk_example_test.go ├── terraform_azure_example_test.go ├── terraform_azure_frontdoor_example_test.go ├── terraform_azure_functionapp_example_test.go ├── terraform_azure_keyvault_example_test.go ├── terraform_azure_loadbalancer_example_test.go ├── terraform_azure_loganalytics_example_test.go ├── terraform_azure_monitor_example_test.go ├── terraform_azure_mysqldb_example_test.go ├── terraform_azure_network_example_test.go ├── terraform_azure_nsg_example_test.go ├── terraform_azure_postgresql_example_test.go ├── terraform_azure_recoveryservices_example_test.go ├── terraform_azure_resourcegroup_example_test.go ├── terraform_azure_servicebus_example_test.go ├── terraform_azure_sqldb_example_test.go ├── terraform_azure_sqlmanagedinstance_example_test.go ├── terraform_azure_storage_example_test.go ├── terraform_azure_synapse_example_test.go └── terraform_azure_vm_example_test.go ├── docker_hello_world_example_test.go ├── docker_stdout_example_test.go ├── fixtures ├── copy-folder-contents │ ├── full-copy │ │ ├── .hidden-file.txt │ │ ├── .terraform-version │ │ ├── foo.txt │ │ └── subfolder │ │ │ ├── .hidden-folder │ │ │ └── baz.txt │ │ │ └── bar.txt │ ├── no-hidden-files-no-terraform-files │ │ ├── .terraform-version │ │ ├── foo.txt │ │ └── subfolder │ │ │ └── bar.txt │ ├── no-hidden-files │ │ ├── foo.txt │ │ └── subfolder │ │ │ └── bar.txt │ ├── no-state-files │ │ └── terragrunt.hcl │ ├── original │ │ ├── .hidden-file.txt │ │ ├── .terraform-version │ │ ├── foo.txt │ │ └── subfolder │ │ │ ├── .hidden-folder │ │ │ └── baz.txt │ │ │ └── bar.txt │ ├── symlinks-broken │ │ ├── foo.txt │ │ └── subfolder │ │ │ └── bar.txt │ ├── symlinks │ │ ├── bar.txt │ │ ├── foo.txt │ │ └── subfolder │ │ │ └── bar.txt │ └── terragrunt-files │ │ └── terragrunt.hcl ├── docker-compose-with-buildkit │ ├── Dockerfile │ ├── bash_script.sh │ └── docker-compose.yml ├── docker-compose-with-custom-project-name │ └── docker-compose.yml ├── docker-with-buildkit │ └── Dockerfile ├── docker │ └── Dockerfile ├── helm │ └── keda-values.yaml ├── terraform-backend │ ├── backend.hcl │ └── main.tf ├── terraform-basic-configuration │ └── main.tf ├── terraform-no-error │ └── main.tf ├── terraform-not-idempotent │ └── main.tf ├── terraform-null │ └── main.tf ├── terraform-output-all │ └── output.tf ├── terraform-output-list │ └── output.tf ├── terraform-output-listofobjects │ └── output.tf ├── terraform-output-map │ └── output.tf ├── terraform-output-mapofobjects │ └── output.tf ├── terraform-output-struct │ └── output.tf ├── terraform-output │ └── output.tf ├── terraform-parallelism │ └── main.tf ├── terraform-validation-valid │ ├── main.tf │ ├── outputs.tf │ └── vars.tf ├── terraform-with-error │ └── main.tf ├── terraform-with-plan-error │ └── main.tf ├── terraform-with-warning │ └── main.tf ├── terraform-workspace │ └── main.tf └── terragrunt │ ├── terragrunt-multi-plan │ ├── bar │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── terragrunt.hcl │ └── foo │ │ ├── main.tf │ │ ├── terraform.tfvars │ │ └── terragrunt.hcl │ ├── terragrunt-no-error │ ├── main.tf │ ├── terraform.tfvars │ └── terragrunt.hcl │ ├── terragrunt-output │ ├── main.tf │ ├── terraform.tfvars │ └── terragrunt.hcl │ ├── terragrunt-with-error │ ├── main.tf │ ├── terraform.tfvars │ └── terragrunt.hcl │ └── terragrunt-with-plan-error │ ├── main.tf │ ├── terraform.tfvars │ └── terragrunt.hcl ├── gcp ├── packer_gcp_basic_example_test.go ├── terraform_gcp_example_test.go ├── terraform_gcp_hello_world_example_test.go └── terraform_gcp_ig_example_test.go ├── helm_basic_example_integration_test.go ├── helm_basic_example_template_test.go ├── helm_dependency_example_template_test.go ├── helm_keda_remote_example_template_snapshot_test.go ├── helm_keda_remote_example_template_test.go ├── helm_log_redirect_integration_test.go ├── kubernetes_basic_example_logs_test.go ├── kubernetes_basic_example_service_check_test.go ├── kubernetes_basic_example_test.go ├── kubernetes_hello_world_example_test.go ├── kubernetes_kustomize_example_test.go ├── kubernetes_rbac_example_test.go ├── kubernetes_rest_config_example_test.go ├── packer_basic_example_test.go ├── packer_docker_example_test.go ├── packer_hello_world_example_test.go ├── packer_oci_example_test.go ├── terraform_aws_dynamodb_example_test.go ├── terraform_aws_ec2_windows_test.go ├── terraform_aws_ecs_example_test.go ├── terraform_aws_example_plan_test.go ├── terraform_aws_example_test.go ├── terraform_aws_hello_world_example_test.go ├── terraform_aws_lambda_example_test.go ├── terraform_aws_network_example_test.go ├── terraform_aws_rds_example_test.go ├── terraform_aws_s3_example_test.go ├── terraform_aws_ssm_example_test.go ├── terraform_backend_example_test.go ├── terraform_basic_example_regression_test.go ├── terraform_basic_example_test.go ├── terraform_database_example_test.go ├── terraform_hello_world_example_test.go ├── terraform_http_example_test.go ├── terraform_opa_example_test.go ├── terraform_packer_example_test.go ├── terraform_redeploy_example_test.go ├── terraform_remote_exec_example_test.go ├── terraform_scp_example_test.go ├── terraform_ssh_example_test.go ├── terraform_ssh_password_example_test.go ├── terraform_unit_null_test.go └── terragrunt_example_test.go /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: gruntwork-io 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a bug report to help us improve Terratest. 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior, code snippets and examples which can be used to reproduce the issue. 15 | 16 | ```go 17 | // paste code snippets here 18 | ``` 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Nice to have** 24 | - [ ] Terminal output 25 | - [ ] Screenshots 26 | 27 | **Versions** 28 | - Terratest version: 29 | - Environment details (Ubuntu 20.04, Windows 10, etc.): 30 | 31 | **Additional context** 32 | Add any other context about the problem here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Submit a feature request to improve Terratest. 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-no-response - https://github.com/probot/no-response 2 | 3 | # Number of days of inactivity before an Issue is closed for lack of response 4 | daysUntilClose: 30 5 | # Label requiring a response 6 | responseRequiredLabel: more-information-needed 7 | # Comment to post when closing an Issue for lack of response. Set to `false` to disable 8 | closeComment: > 9 | This issue has been automatically closed because there has been no response 10 | to our request for more information from the original author. With only the 11 | information that is currently in the issue, we don't have enough information 12 | to take action. Please feel free to reach out if you have or find the answers we need so 13 | that we can investigate further. Thank you! -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Terraform files 2 | .terraform 3 | terraform.tfstate 4 | terraform.tfvars 5 | terraform.tfvars.json 6 | *.tfstate* 7 | .terragrunt 8 | .terragrunt-cache 9 | .terraform.lock.hcl 10 | # IDE files 11 | .idea 12 | .vscode 13 | *.iml 14 | vendor 15 | 16 | # Folder used to store temporary test data by Terratest 17 | .test-data 18 | 19 | # rbenv 20 | .ruby-version 21 | 22 | # OS X 23 | .DS_Store 24 | # Intermediate file for testing 25 | kubeconfig 26 | 27 | # environment files 28 | .env 29 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/gruntwork-io/pre-commit 3 | rev: v0.1.10 4 | hooks: 5 | - id: goimports 6 | - id: terraform-fmt 7 | - repo: local 8 | hooks: 9 | - id: test-interfaces-used 10 | name: test-interfaces-used 11 | entry: bash -c 'grep -Rw "*testing.T" modules | grep -v _test.go | wc -l' 12 | language: system 13 | types: [go] 14 | pass_filenames: false 15 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @denis256 @yhakbar @james03160927 2 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | terratest 2 | Copyright 2018 Gruntwork, Inc. 3 | 4 | This product includes software developed at Gruntwork (https://www.gruntwork.io/). -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | .jekyll-cache 2 | _site 3 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | terratest.gruntwork.io -------------------------------------------------------------------------------- /docs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.6.2-stretch 2 | MAINTAINER Gruntwork 3 | 4 | # This project requires bundler 2, but the docker image comes with bundler 1 so we need to upgrade 5 | RUN gem install bundler 6 | 7 | # Copy the Gemfile and Gemfile.lock into the image and run bundle install in a way that will be cached 8 | WORKDIR /tmp 9 | ADD Gemfile Gemfile 10 | ADD Gemfile.lock Gemfile.lock 11 | RUN bundle install 12 | 13 | RUN mkdir -p /src 14 | VOLUME ["/src"] 15 | WORKDIR /src 16 | COPY . /src 17 | 18 | # Jekyll runs on port 4000 by default 19 | EXPOSE 4000 20 | 21 | # Run jekyll serve - jekyll will build first to create a plain html file for TOS update 22 | CMD ["./jekyll-serve.sh"] 23 | -------------------------------------------------------------------------------- /docs/_data/prism_extends.yml: -------------------------------------------------------------------------------- 1 | sh: bash 2 | tpl: yaml 3 | tf: hcl 4 | tfvars: hcl 5 | yml: yaml 6 | -------------------------------------------------------------------------------- /docs/_docs/01_getting-started/examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Examples 3 | category: getting-started 4 | excerpt: Examples are the best way to start testing Terraform, Docker, Packer, Kubernetes, AWS, GCP, and more with Terratest. 5 | tags: ["example"] 6 | redirect_to: 7 | - /examples/ 8 | order: 102 9 | nav_title: Documentation 10 | nav_title_link: /docs/ 11 | --- 12 | -------------------------------------------------------------------------------- /docs/_docs/01_getting-started/godoc.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: collection-browser-doc 3 | title: GoDoc 4 | category: getting-started 5 | excerpt: >- 6 | Browse Terratest methods and types in GoDoc. 7 | tags: ["packages"] 8 | redirect_to: 9 | - https://godoc.org/github.com/gruntwork-io/terratest 10 | target_blank: true 11 | order: 104 12 | nav_title: Documentation 13 | nav_title_link: /docs/ 14 | --- 15 | -------------------------------------------------------------------------------- /docs/_docs/04_community/license.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: collection-browser-doc 3 | title: License 4 | category: community 5 | excerpt: >- 6 | This code is released under the Apache 2.0 License. Read more here. 7 | tags: ["license"] 8 | order: 402 9 | nav_title: Documentation 10 | nav_title_link: /docs/ 11 | --- 12 | 13 | ## License 14 | 15 | This code is released under the Apache 2.0 License. See [LICENSE](https://github.com/gruntwork-io/terratest/blob/main/LICENSE){:target="_blank"} and [NOTICE](https://github.com/gruntwork-io/terratest/blob/main/NOTICE){:target="_blank"} for more details. 16 | -------------------------------------------------------------------------------- /docs/_includes/built-by.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Built by Gruntwork

4 |

Your entire infrastructure. Defined as code. In about a day.

5 | Explore Gruntwork.io 6 |
7 |
8 | -------------------------------------------------------------------------------- /docs/_includes/canonical-url.html: -------------------------------------------------------------------------------- 1 | {% if include.url %}{% assign url = include.url %}{% else %}{% assign url = page.url %}{% endif %}{{ site.url | replace:'www.','' }}{{site.baseurl}}{{ url | replace:'index.html','' }} 2 | -------------------------------------------------------------------------------- /docs/_includes/collection_browser/_cta-section.html: -------------------------------------------------------------------------------- 1 | {% include links-n-built-by.html %} 2 | -------------------------------------------------------------------------------- /docs/_includes/collection_browser/_doc-page.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | {% include collection_browser/_doc-header.html %} 6 |
7 |
8 |
9 |
10 |
11 | {% assign data_scroll_after_selector = '.cb-doc-header' %} 12 | {% assign data_scroll_until_selector = '.cb-doc-detail' %} 13 | {% include collection_browser/_sidebar.html data_scroll_until_selector=data_scroll_until_selector data_scroll_after_selector=data_scroll_after_selector %} 14 |
15 |
16 | {{ content }} 17 |
18 |
19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /docs/_includes/collection_browser/_doc-thumb__excerpt.html: -------------------------------------------------------------------------------- 1 | {% if doc.excerpt_md %} 2 | {{ doc.excerpt_md | markdownify }} 3 | {% elsif doc.excerpt_html %} 4 | {{ doc.excerpt_html }} 5 | {% else %} 6 |

{{ doc.excerpt | strip_html }}

7 | {% endif %} 8 | -------------------------------------------------------------------------------- /docs/_includes/collection_browser/_docs-list.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | {% for doc_group in include.docs_grouped %} 5 |

{{ doc_group.name | capitalize | replace: '-',' ' | replace: '%20', ' ' }}

6 | {% assign sorted = doc_group.items | sort: 'order' %} 7 | {% for doc in sorted %} 8 | {% include collection_browser/_doc-thumb.html doc=doc %} 9 | {% endfor %} 10 | {% endfor %} 11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /docs/_includes/collection_browser/_no-search-results.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | no search results
6 | 7 |

We couldn’t find any results matching your search.

8 |
9 |
10 |
11 |
12 | -------------------------------------------------------------------------------- /docs/_includes/get-access.html: -------------------------------------------------------------------------------- 1 |
2 | Get access to a library of over 300,000 lines of battle-tested, production grade infrastructure code, all thoroughly tested with Terratest. 3 | Explore Gruntwork.io 4 |
5 | -------------------------------------------------------------------------------- /docs/_includes/header-min.html: -------------------------------------------------------------------------------- 1 |
2 | {% include navbar.html %} 3 | Shape 4 |
5 | -------------------------------------------------------------------------------- /docs/_includes/header.html: -------------------------------------------------------------------------------- 1 |
2 | {% include navbar.html %} 3 |
4 |

{{ page.title }}

5 | {{ page.subtitle }} 6 |
7 |
8 |
9 |
10 | Shape 11 | Hero 12 |
13 |
14 | -------------------------------------------------------------------------------- /docs/_includes/links-n-built-by.html: -------------------------------------------------------------------------------- 1 |
2 | {% include built-by.html %} 3 | {% include links-section.html %} 4 |
5 | -------------------------------------------------------------------------------- /docs/_includes/links-n-get-access.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /docs/_includes/links-section.html: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /docs/_includes/logo.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /docs/_includes/styles.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/_includes/switch.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /docs/_includes/video-player.html: -------------------------------------------------------------------------------- 1 |
2 | video 3 | video 4 |
5 | -------------------------------------------------------------------------------- /docs/_layouts/collection-browser-doc.html: -------------------------------------------------------------------------------- 1 | --- 2 | custom_js: 3 | - prism 4 | - collection-browser_scroll 5 | - collection-browser_search 6 | - collection-browser_toc 7 | - video-player 8 | --- 9 | 10 | 11 | 12 | 13 | {% include head.html %} 14 | 15 | 16 | {% include header-min.html %} 17 | {% include collection_browser/_doc-page.html content=content %} 18 | {% include links-n-built-by.html %} 19 | {% include footer.html %} 20 | {% include scripts.html %} 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/_layouts/collection-browser.html: -------------------------------------------------------------------------------- 1 | --- 2 | custom_js: 3 | - prism 4 | - collection-browser_scroll 5 | - collection-browser_search 6 | - collection-browser_toc 7 | - video-player 8 | --- 9 | 10 | 11 | 12 | 13 | {% include head.html %} 14 | 15 | 16 | {% include header.html %} 17 | {{ content }} 18 | {% include footer.html %} 19 | {% include scripts.html %} 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/_layouts/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include head.html %} 5 | 6 | 7 |
8 | {% include navbar.html %} 9 | Shape 10 | Shape 11 |
12 |
13 | {{ content }} 14 |
15 |
16 | {% include links-section.html %} 17 |
18 | {% include footer.html %} 19 | {% include scripts.html %} 20 | 21 | 22 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | --- 2 | custom_js: 3 | - video-player 4 | - examples 5 | - prism 6 | --- 7 | 8 | 9 | 10 | 11 | {% include head.html %} 12 | 13 | 14 | {{ content }} 15 | {% include footer.html %} 16 | {% include scripts.html %} 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | custom_js: 4 | - prism 5 | - video-player 6 | --- 7 | 8 |
9 | {{ content }} 10 |
11 | -------------------------------------------------------------------------------- /docs/_layouts/subpage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include head.html %} 5 | 6 | 7 | {% include header.html %} 8 |
9 | {{ content }} 10 |
11 | {% include links-n-built-by.html %} 12 | {% include footer.html %} 13 | {% include scripts.html %} 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/_pages/404/404.md: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /404.html 3 | slug: 404 4 | layout: subpage 5 | title: 404 6 | subtitle: Page not found :( 7 | classes: text-large text-center subpage-404 8 | --- 9 | 10 | The requested page could not be found. 11 | -------------------------------------------------------------------------------- /docs/_pages/commercial-support/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | permalink: /commercial-support/ 3 | redirect_to: 4 | - https://gruntwork.io/support 5 | --- 6 | -------------------------------------------------------------------------------- /docs/_pages/cookie-policy/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: subpage 3 | permalink: /cookie-policy/ 4 | slug: cookie-policy 5 | redirect_to: 6 | - https://gruntwork.io/cookie-policy/ 7 | --- 8 | -------------------------------------------------------------------------------- /docs/_pages/docs/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: collection-browser 3 | title: Documentation 4 | subtitle: Learn how to work with Terratest. 5 | excerpt: Learn how to work with Terratest. 6 | permalink: /docs/ 7 | slug: docs 8 | nav_title: Documentation 9 | --- 10 | 11 | {% include collection_browser/browser.html collection=site.docs collection_name='docs' %} 12 | -------------------------------------------------------------------------------- /docs/_pages/index/_built_by.html: -------------------------------------------------------------------------------- 1 |
2 |

Built by Gruntwork

3 |

Your entire infrastructure. Defined as code. In about a day.

4 | Explore Gruntwork.io 5 | shapes 6 |
7 | -------------------------------------------------------------------------------- /docs/_pages/index/_cta_section.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /docs/_pages/index/_test-with-terratest.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |
6 |

Test with Terratest

7 |
8 |
9 |
10 | 11 | {% include examples/explorer.html id='index_page' %} 12 | 13 |
14 | -------------------------------------------------------------------------------- /docs/_pages/index/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | permalink: / 4 | slug: index-page 5 | --- 6 | 7 |
8 | {% include_relative _header.html %} 9 | {% include_relative _terratest-in-4-steps.html %} 10 |
11 | {% include_relative _test-with-terratest.html %} 12 | {% include_relative _cta_section.html %} 13 | {% include_relative _watch.html %} 14 |
15 | {% include links-n-built-by.html %} 16 |
17 | -------------------------------------------------------------------------------- /docs/_pages/thanks/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Thank you. 4 | excerpt: Thank you for contacting us. A Grunt will be in touch soon! 5 | permalink: /thanks/ 6 | --- 7 | 8 |
9 | {% include navbar.html %} 10 |
11 |
12 |
13 |
14 |
15 |

{{ page.title }}

16 |

{{ page.excerpt }}

17 |

18 | Go to the Terratest home page 21 |

22 |
23 |
24 |
25 |
26 |
27 |
-------------------------------------------------------------------------------- /docs/_posts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/_posts/.keep -------------------------------------------------------------------------------- /docs/assets/css/_variables.scss: -------------------------------------------------------------------------------- 1 | $primary-color: #07a7fd; 2 | $primary-color-2: #068ee4; 3 | 4 | $gray-color-1: #f0f0f1; 5 | $gray-color-2: #dedede; 6 | $gray-color-3: #bbbdc0; 7 | 8 | $text-color: #1e252f; 9 | $inline-code-color-base: #0352c2; 10 | $inline-code-bg-color-base: $gray-color-1; 11 | 12 | $primary-gradient-start-color: #001191; 13 | $primary-gradient-stop-color: #06a3ff; 14 | 15 | $secondary-gradient-start-color: #4eb9fb; 16 | $secondary-gradient-stop-color: #2683f5; 17 | 18 | $font-size-base: 16px; 19 | $font-size-xxs: 11px; 20 | $font-size-xs: 13px; 21 | $font-size-sm: 14px; 22 | $font-size-lg: 20px; 23 | 24 | $font-size-h1: 35px; 25 | $font-size-h2: 28px; 26 | 27 | $box-shadow-sm: 0 2px 34px 0 rgba(0, 0, 0, 0.1); 28 | -------------------------------------------------------------------------------- /docs/assets/css/pages/cookie-policy.scss: -------------------------------------------------------------------------------- 1 | .page-cookie-policy { 2 | .container > .row + .row { 3 | padding-top: 28px; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/assets/css/pages/support.scss: -------------------------------------------------------------------------------- 1 | .page-support { 2 | .subheader { 3 | font-weight: bold; font-style:italic; margin: -16px 0 10px 0; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/assets/css/prism_custom.scss: -------------------------------------------------------------------------------- 1 | .token.atrule, .token.attr-value, .token.keyword { 2 | color: #07a7fd; 3 | } 4 | 5 | .token.function, .token.class-name { 6 | color: #0352c2; 7 | } 8 | 9 | .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.url, .token.inserted { 10 | color: #7fae17; 11 | } 12 | 13 | code[class*="language-"], pre[class*="language-"] { 14 | color: #1e252f; 15 | } 16 | 17 | .token.punctuation { 18 | color: #1e252f; 19 | } 20 | 21 | .token.regex, .token.important, .token.variable { 22 | color: #ea1473; 23 | } 24 | 25 | 26 | .highlight pre[class*="language-"] { 27 | line-height: 25px; 28 | } -------------------------------------------------------------------------------- /docs/assets/css/styles.scss: -------------------------------------------------------------------------------- 1 | --- 2 | # Frontmatter 3 | --- 4 | 5 | @import "_variables"; 6 | @import "bootstrap/scss/bootstrap"; 7 | @import "global"; 8 | @import "components"; 9 | @import "collection_browser"; 10 | @import "examples"; 11 | @import "subpage"; 12 | @import "prism_custom"; 13 | 14 | @import "pages/cookie-policy"; 15 | @import "pages/home"; 16 | @import "pages/support"; 17 | @import "pages/contact"; 18 | 19 | @import "utilities"; 20 | 21 | body.index-page { 22 | .header-shapes-bottom { 23 | background-image: url('{{site.baseurl}}/assets/img/home/terratest_top_right.svg'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /docs/assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /docs/assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/assets/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /docs/assets/img/arrows/arrow-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/img/arrows/arrow-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/img/arrows/arrow-thin-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/img/arrows/arrow-thin-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/img/arrows/dash-thin.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/assets/img/collections/documentation/promote-immutable-Terraform-code-across-envs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/collections/documentation/promote-immutable-Terraform-code-across-envs.png -------------------------------------------------------------------------------- /docs/assets/img/contact/bottom@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/contact/bottom@3x.png -------------------------------------------------------------------------------- /docs/assets/img/contact/right@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/contact/right@3x.png -------------------------------------------------------------------------------- /docs/assets/img/contact/top@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/contact/top@3x.png -------------------------------------------------------------------------------- /docs/assets/img/docs/debugging-interleaved-test-output/circleci-logs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/docs/debugging-interleaved-test-output/circleci-logs.png -------------------------------------------------------------------------------- /docs/assets/img/docs/debugging-interleaved-test-output/circleci-test-summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/docs/debugging-interleaved-test-output/circleci-test-summary.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/android-icon-144x144.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/android-icon-192x192.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/android-icon-36x36.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/android-icon-48x48.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/android-icon-72x72.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/android-icon-96x96.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-114x114.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-120x120.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-144x144.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-152x152.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-180x180.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-57x57.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-60x60.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-72x72.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-76x76.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon-precomposed.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/apple-icon.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /docs/assets/img/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/favicon-96x96.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/favicon.ico -------------------------------------------------------------------------------- /docs/assets/img/favicon/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/ms-icon-144x144.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/ms-icon-150x150.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/ms-icon-310x310.png -------------------------------------------------------------------------------- /docs/assets/img/favicon/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/favicon/ms-icon-70x70.png -------------------------------------------------------------------------------- /docs/assets/img/home/built-by-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/home/built-by-left.png -------------------------------------------------------------------------------- /docs/assets/img/home/built-by-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/home/built-by-right.png -------------------------------------------------------------------------------- /docs/assets/img/icons/bug.svg: -------------------------------------------------------------------------------- 1 | Bug -------------------------------------------------------------------------------- /docs/assets/img/icons/chatbubbles.svg: -------------------------------------------------------------------------------- 1 | Chatbubbles -------------------------------------------------------------------------------- /docs/assets/img/icons/checkmark-blue.svg: -------------------------------------------------------------------------------- 1 | Checkmark -------------------------------------------------------------------------------- /docs/assets/img/icons/checkmark-darkblue.svg: -------------------------------------------------------------------------------- 1 | Checkmark -------------------------------------------------------------------------------- /docs/assets/img/icons/codereviews.svg: -------------------------------------------------------------------------------- 1 | Code Download -------------------------------------------------------------------------------- /docs/assets/img/icons/menu-dots-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/icons/menu-dots-icon.png -------------------------------------------------------------------------------- /docs/assets/img/icons/play_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/icons/play_icon.png -------------------------------------------------------------------------------- /docs/assets/img/icons/wand.svg: -------------------------------------------------------------------------------- 1 | Color Wand -------------------------------------------------------------------------------- /docs/assets/img/icons/xmark.svg: -------------------------------------------------------------------------------- 1 | Close -------------------------------------------------------------------------------- /docs/assets/img/key-features/key-features-backend-dry-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/key-features/key-features-backend-dry-sm.png -------------------------------------------------------------------------------- /docs/assets/img/key-features/key-features-backend-dry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/key-features/key-features-backend-dry.png -------------------------------------------------------------------------------- /docs/assets/img/key-features/key-features-cli-dry-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/key-features/key-features-cli-dry-sm.png -------------------------------------------------------------------------------- /docs/assets/img/key-features/key-features-multiple-modules-at-once-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/key-features/key-features-multiple-modules-at-once-sm.png -------------------------------------------------------------------------------- /docs/assets/img/key-features/key-features-multiple-modules-at-once.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/key-features/key-features-multiple-modules-at-once.png -------------------------------------------------------------------------------- /docs/assets/img/key-features/key-features-terraform-code-dry-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/key-features/key-features-terraform-code-dry-sm.png -------------------------------------------------------------------------------- /docs/assets/img/key-features/key-features-terraform-code-dry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/key-features/key-features-terraform-code-dry.png -------------------------------------------------------------------------------- /docs/assets/img/link-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/link-icon.png -------------------------------------------------------------------------------- /docs/assets/img/logos/aws-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/aws-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/azure-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/azure-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/docker-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/docker-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/gcp-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/gcp-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/github-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/github-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/kubernetes-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/kubernetes-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/opa-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/opa-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/packer-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/packer-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/terraform-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/terraform-logo.png -------------------------------------------------------------------------------- /docs/assets/img/logos/terragrunt-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/logos/terragrunt-logo.png -------------------------------------------------------------------------------- /docs/assets/img/no-search-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/no-search-results.png -------------------------------------------------------------------------------- /docs/assets/img/temp_logos.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/temp_logos.PNG -------------------------------------------------------------------------------- /docs/assets/img/terratest-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/terratest-thumbnail.png -------------------------------------------------------------------------------- /docs/assets/img/terratest_video_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/terratest_video_frame.png -------------------------------------------------------------------------------- /docs/assets/img/video_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/docs/assets/img/video_thumb.png -------------------------------------------------------------------------------- /docs/assets/js/video-player.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | $('.video-player').on('click', function() { 3 | if ($(this).find('.frame').length > 0) { 4 | $(this).addClass('played') 5 | const video_url = $(this).data('video-url') 6 | $(this).append('') 11 | $(this).find('.frame').remove() 12 | $(this).find('.btn-video').remove() 13 | } 14 | }) 15 | }) 16 | -------------------------------------------------------------------------------- /docs/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | web: 5 | build: . 6 | volumes: 7 | # Bind mount the working dir so the app reloads automatically every time you make a change 8 | # Note that we use 'delegated' to improve perf on OSX: https://docs.docker.com/docker-for-mac/osxfs-caching/ 9 | - .:/src:delegated 10 | # Bind a Docker-only volume to the generated _site folder to make it clear we don't need to sync that folder 11 | # back to the host OS. That makes Jekyll in Docker work much faster. 12 | - generated_site:/src/_site 13 | ports: 14 | - "4000:4000" 15 | # Expose port for jekyll livereload 16 | - "35729:35729" 17 | environment: 18 | - JEKYLL_ENV=development 19 | 20 | volumes: 21 | generated_site: 22 | -------------------------------------------------------------------------------- /docs/jekyll-serve.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | echo -e "\e[1;31mRun Jekyll serve to watch for changes" 6 | bundle exec jekyll serve --no-watch --livereload --drafts --host 0.0.0.0 7 | -------------------------------------------------------------------------------- /docs/scripts/convert_adoc_to_md.sh: -------------------------------------------------------------------------------- 1 | # Required: 2 | # - asciidoctor 3 | # - pandoc 4 | # 5 | # Install Asciidoctor: 6 | # $ sudo apt-get install asciidoctor 7 | # 8 | # Install Pandoc 9 | # https://pandoc.org/installing.html 10 | # 11 | # 1. Create input.adoc file 12 | # 2. paste adoc-formatted content to input.adoc 13 | # 3. run script 14 | # 4. The output will be printed to the output.md file. 15 | asciidoctor -b docbook input.adoc && pandoc -f docbook -t gfm input.xml -o output.md --wrap=none --atx-headers 16 | -------------------------------------------------------------------------------- /docs/scripts/convert_md_to_adoc.sh: -------------------------------------------------------------------------------- 1 | # Create input.md file, paste markdown text, and run script. The output will be printed to the output.adoc file. 2 | pandoc --from=gfm --to=asciidoc --wrap=none --atx-headers input.md > output.adoc 3 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-aci-example/output.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.rg.name 3 | } 4 | 5 | output "ip_address" { 6 | value = azurerm_container_group.aci.ip_address 7 | } 8 | 9 | output "fqdn" { 10 | value = azurerm_container_group.aci.fqdn 11 | } 12 | 13 | output "container_instance_name" { 14 | value = azurerm_container_group.aci.name 15 | } 16 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-acr-example/output.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.rg.name 3 | } 4 | 5 | output "container_registry_name" { 6 | value = azurerm_container_registry.acr.name 7 | } 8 | 9 | output "login_server" { 10 | value = azurerm_container_registry.acr.login_server 11 | } 12 | 13 | output "admin_username" { 14 | value = azurerm_container_registry.acr.admin_username 15 | sensitive = true 16 | } 17 | 18 | output "admin_password" { 19 | value = azurerm_container_registry.acr.admin_password 20 | sensitive = true 21 | } 22 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-actiongroup-example/output.tf: -------------------------------------------------------------------------------- 1 | output "action_group_id" { 2 | value = azurerm_monitor_action_group.actionGroup.id 3 | } -------------------------------------------------------------------------------- /examples/azure/terraform-azure-aks-example/nginx-deployment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: nginx-deployment 6 | spec: 7 | selector: 8 | matchLabels: 9 | app: nginx 10 | replicas: 1 11 | template: 12 | metadata: 13 | labels: 14 | app: nginx 15 | spec: 16 | containers: 17 | - name: nginx 18 | image: nginx:1.15.7 19 | ports: 20 | - containerPort: 80 21 | --- 22 | kind: Service 23 | apiVersion: v1 24 | metadata: 25 | name: nginx-service 26 | spec: 27 | selector: 28 | app: nginx 29 | ports: 30 | - protocol: TCP 31 | targetPort: 80 32 | port: 80 33 | type: LoadBalancer 34 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-aks-example/output.tf: -------------------------------------------------------------------------------- 1 | output "client_key" { 2 | value = azurerm_kubernetes_cluster.k8s.kube_config.0.client_key 3 | } 4 | 5 | output "client_certificate" { 6 | value = azurerm_kubernetes_cluster.k8s.kube_config.0.client_certificate 7 | sensitive = true 8 | } 9 | 10 | output "cluster_ca_certificate" { 11 | value = azurerm_kubernetes_cluster.k8s.kube_config.0.cluster_ca_certificate 12 | sensitive = true 13 | } 14 | 15 | output "cluster_username" { 16 | value = azurerm_kubernetes_cluster.k8s.kube_config.0.username 17 | sensitive = true 18 | } 19 | 20 | output "cluster_password" { 21 | value = azurerm_kubernetes_cluster.k8s.kube_config.0.password 22 | sensitive = true 23 | } 24 | 25 | output "kube_config" { 26 | value = azurerm_kubernetes_cluster.k8s.kube_config_raw 27 | sensitive = true 28 | } 29 | 30 | output "host" { 31 | value = azurerm_kubernetes_cluster.k8s.kube_config.0.host 32 | sensitive = true 33 | } -------------------------------------------------------------------------------- /examples/azure/terraform-azure-availabilityset-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.avs.name 3 | } 4 | 5 | output "availability_set_name" { 6 | value = azurerm_availability_set.avs.name 7 | } 8 | 9 | output "availability_set_fdc" { 10 | value = azurerm_availability_set.avs.platform_fault_domain_count 11 | } 12 | 13 | output "vm_name" { 14 | value = azurerm_virtual_machine.avs.name 15 | } 16 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-container-apps-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.aca.name 3 | } 4 | 5 | output "container_app_env_name" { 6 | value = azurerm_container_app_environment.aca.name 7 | } 8 | 9 | output "container_app_name" { 10 | value = azurerm_container_app.aca.name 11 | } 12 | 13 | output "container_app_job_name" { 14 | value = azurerm_container_app_job.aca.name 15 | } 16 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-cosmosdb-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.rg.name 3 | } 4 | 5 | output "account_name" { 6 | value = azurerm_cosmosdb_account.test.name 7 | } 8 | 9 | output "endpoint" { 10 | value = azurerm_cosmosdb_account.test.endpoint 11 | } 12 | 13 | output "primary_key" { 14 | value = azurerm_cosmosdb_account.test.primary_key 15 | sensitive = true 16 | } 17 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-datafactory-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.datafactory_rg.name 3 | } 4 | 5 | output "datafactory_name" { 6 | value = azurerm_data_factory.data_factory.name 7 | } 8 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-disk-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.disk_rg.name 3 | } 4 | 5 | output "disk_name" { 6 | value = azurerm_managed_disk.disk.name 7 | } 8 | 9 | output "disk_type" { 10 | value = azurerm_managed_disk.disk.storage_account_type 11 | } 12 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.main.name 3 | } 4 | 5 | output "vm_name" { 6 | value = azurerm_virtual_machine.main.name 7 | } 8 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-frontdoor-example/output.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.rg.name 3 | } 4 | 5 | output "front_door_name" { 6 | description = "Specifies the name of the Front Door service." 7 | value = azurerm_frontdoor.frontdoor.name 8 | } 9 | 10 | output "front_door_url" { 11 | description = "Specifies the host name of the frontend_endpoint. Must be a domain name." 12 | value = azurerm_frontdoor.frontdoor.frontend_endpoint[0].host_name 13 | } 14 | 15 | output "front_door_endpoint_name" { 16 | description = "Specifies the friendly name of the frontend_endpoint" 17 | value = azurerm_frontdoor.frontdoor.frontend_endpoint[0].name 18 | } -------------------------------------------------------------------------------- /examples/azure/terraform-azure-functionapp-example/output.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.app_rg.name 3 | } 4 | 5 | output "function_app_id" { 6 | value = azurerm_function_app.function_app.id 7 | } 8 | 9 | output "default_hostname" { 10 | value = azurerm_function_app.function_app.default_hostname 11 | } 12 | 13 | output "function_app_kind" { 14 | value = azurerm_function_app.function_app.kind 15 | } 16 | 17 | output "function_app_name" { 18 | value = azurerm_function_app.function_app.name 19 | } 20 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-keyvault-example/example.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gruntwork-io/terratest/5c7c088d4cab2d5db3f7cc5b1af8617d46c2e0b9/examples/azure/terraform-azure-keyvault-example/example.pfx -------------------------------------------------------------------------------- /examples/azure/terraform-azure-keyvault-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.resource_group.name 3 | } 4 | 5 | output "key_vault_name" { 6 | value = azurerm_key_vault.key_vault.name 7 | } 8 | 9 | output "secret_name" { 10 | value = azurerm_key_vault_secret.key_vault_secret.name 11 | } 12 | 13 | output "key_name" { 14 | value = azurerm_key_vault_key.key_vault_key.name 15 | } 16 | 17 | output "certificate_name" { 18 | value = azurerm_key_vault_certificate.key_vault_certificate.name 19 | } -------------------------------------------------------------------------------- /examples/azure/terraform-azure-loganalytics-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.resource_group.name 3 | } 4 | 5 | output "loganalytics_workspace_name" { 6 | value = azurerm_log_analytics_workspace.log_analytics_workspace.name 7 | } 8 | 9 | output "loganalytics_workspace_sku" { 10 | value = azurerm_log_analytics_workspace.log_analytics_workspace.sku 11 | } 12 | 13 | output "loganalytics_workspace_retention" { 14 | value = azurerm_log_analytics_workspace.log_analytics_workspace.retention_in_days 15 | } 16 | 17 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-monitor-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.monitor.name 3 | } 4 | 5 | output "diagnostic_setting_name" { 6 | value = azurerm_monitor_diagnostic_setting.monitor.name 7 | } 8 | 9 | output "diagnostic_setting_id" { 10 | value = azurerm_monitor_diagnostic_setting.monitor.id 11 | } 12 | 13 | output "keyvault_id" { 14 | value = azurerm_key_vault.monitor.id 15 | } 16 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-mysqldb-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.mysql_rg.name 3 | } 4 | 5 | output "mysql_server_name" { 6 | value = azurerm_mysql_server.mysqlserver.name 7 | } 8 | 9 | output "sql_server_full_domain_name" { 10 | value = azurerm_mysql_server.mysqlserver.fqdn 11 | } 12 | 13 | output "sql_server_admin_login" { 14 | value = azurerm_mysql_server.mysqlserver.administrator_login 15 | } 16 | 17 | output "sql_server_admin_login_pass" { 18 | value = azurerm_mysql_server.mysqlserver.administrator_login_password 19 | sensitive = true 20 | } 21 | 22 | output "mysql_database_name" { 23 | value = azurerm_mysql_database.mysqldb.name 24 | } 25 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-network-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.net.name 3 | } 4 | 5 | output "virtual_network_name" { 6 | value = azurerm_virtual_network.net.name 7 | } 8 | 9 | output "subnet_name" { 10 | value = azurerm_subnet.net.name 11 | } 12 | 13 | output "public_address_name" { 14 | value = azurerm_public_ip.net.name 15 | } 16 | 17 | output "network_interface_internal" { 18 | value = azurerm_network_interface.net01.name 19 | } 20 | 21 | output "network_interface_external" { 22 | value = azurerm_network_interface.net02.name 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-nsg-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "vm_name" { 2 | value = azurerm_virtual_machine.vm_example.name 3 | } 4 | 5 | output "resource_group_name" { 6 | value = azurerm_resource_group.nsg_rg.name 7 | } 8 | 9 | output "nsg_name" { 10 | value = azurerm_network_security_group.nsg_example.name 11 | } 12 | 13 | output "ssh_rule_name" { 14 | value = azurerm_network_security_rule.allow_ssh.name 15 | } 16 | 17 | output "http_rule_name" { 18 | value = azurerm_network_security_rule.block_http.name 19 | } 20 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-postgresql-example/output.tf: -------------------------------------------------------------------------------- 1 | output "sku_name" { 2 | value = azurerm_postgresql_server.postgresqlserver.sku_name 3 | } 4 | 5 | output "servername" { 6 | value = azurerm_postgresql_server.postgresqlserver.name 7 | 8 | } 9 | 10 | output "rgname" { 11 | value = azurerm_resource_group.rg.name 12 | } -------------------------------------------------------------------------------- /examples/azure/terraform-azure-recoveryservices-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.resource_group.name 3 | } 4 | 5 | output "recovery_service_vault_name" { 6 | value = azurerm_recovery_services_vault.vault.name 7 | } 8 | 9 | output "backup_policy_vm_name" { 10 | value = azurerm_backup_policy_vm.vm_policy.name 11 | } 12 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-resourcegroup-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.resource_group.name 3 | } -------------------------------------------------------------------------------- /examples/azure/terraform-azure-sqldb-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.sql_rg.name 3 | } 4 | 5 | output "sql_database_id" { 6 | value = azurerm_sql_database.sqldb.id 7 | } 8 | 9 | output "sql_database_name" { 10 | value = azurerm_sql_database.sqldb.name 11 | } 12 | 13 | output "sql_server_id" { 14 | value = azurerm_sql_server.sqlserver.id 15 | } 16 | 17 | output "sql_server_name" { 18 | value = azurerm_sql_server.sqlserver.name 19 | } 20 | 21 | output "sql_server_full_domain_name" { 22 | value = azurerm_sql_server.sqlserver.fully_qualified_domain_name 23 | } 24 | 25 | output "sql_server_admin_login" { 26 | value = azurerm_sql_server.sqlserver.administrator_login 27 | } 28 | 29 | output "sql_server_admin_login_pass" { 30 | value = azurerm_sql_server.sqlserver.administrator_login_password 31 | sensitive = true 32 | } 33 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-sqlmanagedinstance-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.sqlmi_rg.name 3 | } 4 | 5 | output "network_security_group_name" { 6 | value = azurerm_network_security_group.sqlmi_nt_sec_grp.name 7 | } 8 | 9 | output "virtual_network_name" { 10 | value = azurerm_virtual_network.sqlmi_vm.name 11 | } 12 | 13 | output "subnet_name" { 14 | value = azurerm_subnet.sqlmi_sub.name 15 | } 16 | 17 | output "managed_instance_name" { 18 | value = azurerm_mssql_managed_instance.sqlmi_mi.name 19 | } 20 | 21 | output "managed_instance_db_name" { 22 | value = azurerm_mssql_managed_database.sqlmi_db.name 23 | } -------------------------------------------------------------------------------- /examples/azure/terraform-azure-storage-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.resource_group.name 3 | } 4 | 5 | output "storage_account_name" { 6 | value = azurerm_storage_account.storage_account.name 7 | } 8 | 9 | output "storage_account_account_tier" { 10 | value = azurerm_storage_account.storage_account.account_tier 11 | } 12 | 13 | output "storage_account_account_kind" { 14 | value = azurerm_storage_account.storage_account.account_kind 15 | } 16 | 17 | output "storage_container_name" { 18 | value = azurerm_storage_container.container.name 19 | } 20 | -------------------------------------------------------------------------------- /examples/azure/terraform-azure-synapse-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "resource_group_name" { 2 | value = azurerm_resource_group.synapse_rg.name 3 | } 4 | 5 | output "synapse_storage_name" { 6 | value = azurerm_storage_account.storage_account.name 7 | } 8 | 9 | output "synapse_dlgen2_name" { 10 | value = azurerm_storage_data_lake_gen2_filesystem.dl_gen2.name 11 | } 12 | 13 | output "synapse_workspace_name" { 14 | value = azurerm_synapse_workspace.synapse_workspace.name 15 | } 16 | 17 | output "synapse_sqlpool_name" { 18 | value = azurerm_synapse_sql_pool.synapse_pool.name 19 | } 20 | -------------------------------------------------------------------------------- /examples/docker-compose-stdout-example/Dockerfile: -------------------------------------------------------------------------------- 1 | # website::tag::1:: Build a simple Docker image that contains a text file with the contents "Hello, World!" 2 | FROM ubuntu:20.04 3 | COPY ./bash_script.sh /usr/local/bin/bash_script.sh 4 | -------------------------------------------------------------------------------- /examples/docker-compose-stdout-example/bash_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | echo "stdout: message" 5 | >&2 echo -e "stderr: error" 6 | -------------------------------------------------------------------------------- /examples/docker-compose-stdout-example/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2.0' 2 | services: 3 | bash_script: 4 | build: 5 | context: . 6 | entrypoint: bash_script.sh 7 | -------------------------------------------------------------------------------- /examples/docker-hello-world-example/Dockerfile: -------------------------------------------------------------------------------- 1 | # website::tag::1:: Build a simple Docker image that contains a text file with the contents "Hello, World!" 2 | FROM ubuntu:18.04 3 | RUN echo 'Hello, World!' > /test.txt 4 | -------------------------------------------------------------------------------- /examples/helm-basic-example/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: helm-basic-example 3 | description: A minimal Helm chart to demonstrate how to use terratest to test helm charts 4 | version: 0.0.1 5 | -------------------------------------------------------------------------------- /examples/helm-basic-example/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "helm-basic-example.fullname" . }} 5 | labels: 6 | # These labels are required by helm. You can read more about required labels in the chart best practices guide: 7 | # https://docs.helm.sh/chart_best_practices/#standard-labels 8 | helm.sh/chart: {{ include "helm-basic-example.chart" . }} 9 | app.kubernetes.io/name: {{ include "helm-basic-example.name" . }} 10 | app.kubernetes.io/instance: {{ .Release.Name }} 11 | app.kubernetes.io/managed-by: {{ .Release.Service }} 12 | spec: 13 | selector: 14 | app.kubernetes.io/name: {{ include "helm-basic-example.name" . }} 15 | app.kubernetes.io/instance: {{ .Release.Name }} 16 | type: NodePort 17 | ports: 18 | - protocol: TCP 19 | targetPort: 80 20 | port: 80 21 | -------------------------------------------------------------------------------- /examples/helm-basic-example/values.yaml: -------------------------------------------------------------------------------- 1 | # This chart purposefully does not provide any values, to demonstrate how to test required values. 2 | # Note that the following two values must be specified if you wish to deploy this chart: 3 | 4 | # containerImageRepo is a string that describes the image repository to pull the container image from. 5 | # containerImageRepo: nginx 6 | 7 | # containerImageTag is a string that describes the image tag to use when pulling the container image. 8 | # containerImageTag: v1.15.4 9 | -------------------------------------------------------------------------------- /examples/helm-dependency-example/.gitignore: -------------------------------------------------------------------------------- 1 | charts/ 2 | requirements.lock -------------------------------------------------------------------------------- /examples/helm-dependency-example/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | name: helm-dependency-example 3 | description: A minimal Helm chart to demonstrate how to use terratest to test helm charts with dependency 4 | version: 0.0.1 5 | dependencies: 6 | - name: helm-basic-example 7 | alias: basic 8 | repository: file://../helm-basic-example 9 | condition: basic.enabled 10 | version: 0.0.1 11 | -------------------------------------------------------------------------------- /examples/helm-dependency-example/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "helm-dependency-example.fullname" . }} 5 | labels: 6 | # These labels are required by helm. You can read more about required labels in the chart best practices guide: 7 | # https://docs.helm.sh/chart_best_practices/#standard-labels 8 | helm.sh/chart: {{ include "helm-dependency-example.chart" . }} 9 | app.kubernetes.io/name: {{ include "helm-dependency-example.name" . }} 10 | app.kubernetes.io/instance: {{ .Release.Name }} 11 | app.kubernetes.io/managed-by: {{ .Release.Service }} 12 | spec: 13 | selector: 14 | app.kubernetes.io/name: {{ include "helm-dependency-example.name" . }} 15 | app.kubernetes.io/instance: {{ .Release.Name }} 16 | type: NodePort 17 | ports: 18 | - protocol: TCP 19 | targetPort: 80 20 | port: 80 21 | -------------------------------------------------------------------------------- /examples/helm-dependency-example/values.yaml: -------------------------------------------------------------------------------- 1 | # This chart purposefully does not provide any values, to demonstrate how to test required values. 2 | # Note that the following two values must be specified if you wish to deploy this chart: 3 | 4 | # containerImageRepo is a string that describes the image repository to pull the container image from. 5 | # containerImageRepo: nginx 6 | 7 | # containerImageTag is a string that describes the image tag to use when pulling the container image. 8 | # containerImageTag: v1.15.4 9 | -------------------------------------------------------------------------------- /examples/kubernetes-basic-example/nginx-deployment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: nginx-deployment 6 | spec: 7 | selector: 8 | matchLabels: 9 | app: nginx 10 | replicas: 1 11 | template: 12 | metadata: 13 | labels: 14 | app: nginx 15 | spec: 16 | containers: 17 | - name: nginx 18 | image: nginx:1.15.7 19 | ports: 20 | - containerPort: 80 21 | --- 22 | kind: Service 23 | apiVersion: v1 24 | metadata: 25 | name: nginx-service 26 | spec: 27 | selector: 28 | app: nginx 29 | ports: 30 | - protocol: TCP 31 | targetPort: 80 32 | port: 80 33 | type: NodePort 34 | -------------------------------------------------------------------------------- /examples/kubernetes-basic-example/podinfo-daemonset.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: DaemonSet 4 | metadata: 5 | name: podinfo-deamonset 6 | spec: 7 | selector: 8 | matchLabels: 9 | app: podinfo 10 | template: 11 | metadata: 12 | labels: 13 | app: podinfo 14 | spec: 15 | containers: 16 | - name: podinfo 17 | image: ghcr.io/stefanprodan/podinfo:6.3.0 18 | ports: 19 | - containerPort: 9898 20 | -------------------------------------------------------------------------------- /examples/kubernetes-kustomize-example/deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: nginx-deployment 6 | spec: 7 | selector: 8 | matchLabels: 9 | app: nginx 10 | replicas: 1 11 | template: 12 | metadata: 13 | labels: 14 | app: nginx 15 | spec: 16 | containers: 17 | - name: nginx 18 | image: nginx:1.15.7 19 | ports: 20 | - containerPort: 80 21 | -------------------------------------------------------------------------------- /examples/kubernetes-kustomize-example/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - ./deployment.yaml 3 | - ./service.yaml 4 | -------------------------------------------------------------------------------- /examples/kubernetes-kustomize-example/service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: Service 3 | apiVersion: v1 4 | metadata: 5 | name: nginx-service 6 | spec: 7 | selector: 8 | app: nginx 9 | ports: 10 | - protocol: TCP 11 | targetPort: 80 12 | port: 1080 13 | type: NodePort 14 | -------------------------------------------------------------------------------- /examples/packer-docker-example/.env: -------------------------------------------------------------------------------- 1 | # Default values for the environment variables in docker-compose.yml 2 | SERVER_PORT=8080 3 | SERVER_TEXT=Hello, World! -------------------------------------------------------------------------------- /examples/packer-docker-example/app.rb: -------------------------------------------------------------------------------- 1 | # A simple web app built on top of Ruby and Sinatra. 2 | 3 | require 'sinatra' 4 | require 'json' 5 | 6 | if ARGV.length != 2 7 | raise 'Expected exactly two arguments: SERVER_PORT SERVER_TEXT' 8 | end 9 | 10 | server_port = ARGV[0] 11 | server_text = ARGV[1] 12 | 13 | set :port, server_port 14 | set :bind, '0.0.0.0' 15 | set :server, 'puma' 16 | 17 | get '/' do 18 | server_text 19 | end 20 | -------------------------------------------------------------------------------- /examples/packer-docker-example/configure-sinatra-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Install and configure a simple web app built on top of Ruby and Sinatra 3 | 4 | set -e 5 | 6 | readonly APP_RB_SRC="/tmp/packer-docker-example/app.rb" 7 | readonly APP_RB_DST="/home/ubuntu/app.rb" 8 | 9 | echo "Installing Ruby" 10 | sudo apt-get update 11 | sudo apt-get install -y make zlib1g-dev build-essential ruby ruby-dev 12 | 13 | echo "Installing Sinatra" 14 | sudo gem install sinatra json rackup puma 15 | 16 | echo "Moving $APP_RB_SRC to $APP_RB_DST" 17 | mkdir -p "$(dirname "$APP_RB_DST")" 18 | mv "$APP_RB_SRC" "$APP_RB_DST" -------------------------------------------------------------------------------- /examples/packer-docker-example/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # This file can be used with Docker and Docker Compose to run the web app in the Packer template 100% locally, without 2 | # having to deploy anything to AWS. 3 | version: '3' 4 | services: 5 | web_app: 6 | # The name we use for the Docker image in build.json (or build.pkr.hcl) 7 | image: gruntwork/packer-docker-example 8 | 9 | # Run the sample web app on port 8080 10 | command: ["ruby", "/home/ubuntu/app.rb", "${SERVER_PORT}", "${SERVER_TEXT}"] 11 | 12 | # Bind-mount the Ruby app so we can have "hot reload" during testing 13 | volumes: 14 | - ./app.rb:/home/ubuntu/app.rb 15 | 16 | # Expose the sample app's port on the host OS 17 | ports: 18 | - "${SERVER_PORT}:${SERVER_PORT}" 19 | -------------------------------------------------------------------------------- /examples/packer-hello-world-example/build.pkr.hcl: -------------------------------------------------------------------------------- 1 | packer { 2 | required_plugins { 3 | docker = { 4 | version = ">=v1.0.1" 5 | source = "github.com/hashicorp/docker" 6 | } 7 | } 8 | } 9 | 10 | source "docker" "ubuntu-docker" { 11 | changes = ["ENTRYPOINT [\"\"]"] 12 | 13 | commit = true 14 | image = "gruntwork/ubuntu-test:16.04" 15 | platform = "linux/amd64" 16 | } 17 | 18 | build { 19 | sources = ["source.docker.ubuntu-docker"] 20 | 21 | provisioner "shell" { 22 | inline = ["echo 'Hello, World!' > /test.txt"] 23 | } 24 | 25 | post-processor "docker-tag" { 26 | repository = "gruntwork/packer-hello-world-example" 27 | tag = ["latest"] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/terraform-asg-scp-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "asg_name" { 2 | value = aws_autoscaling_group.sample_asg.name 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/terraform-aws-dynamodb-example/variables.tf: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------------------------------------------------- 2 | # REQUIRED PARAMETERS 3 | # --------------------------------------------------------------------------------------------------------------------- 4 | variable "region" { 5 | description = "The AWS region to deploy to" 6 | type = string 7 | } 8 | 9 | # --------------------------------------------------------------------------------------------------------------------- 10 | # OPTIONAL PARAMETERS 11 | # These parameters have reasonable defaults. 12 | # --------------------------------------------------------------------------------------------------------------------- 13 | 14 | variable "table_name" { 15 | description = "The name to set for the dynamoDB table." 16 | type = string 17 | default = "terratest-example" 18 | } 19 | -------------------------------------------------------------------------------- /examples/terraform-aws-ec2-windows-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "windows_instance_public_ip" { 2 | description = "The IPv4 address of the Windows instance. Enter this value into your RDP client when connecting to your instance." 3 | value = aws_instance.instance.public_ip 4 | } 5 | -------------------------------------------------------------------------------- /examples/terraform-aws-ec2-windows-example/packer/scripts/install_chocolatey.ps1: -------------------------------------------------------------------------------- 1 | Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 2 | -------------------------------------------------------------------------------- /examples/terraform-aws-ec2-windows-example/packer/scripts/install_packages.ps1: -------------------------------------------------------------------------------- 1 | choco install -y python3 2 | choco install -y git 3 | -------------------------------------------------------------------------------- /examples/terraform-aws-ecs-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "task_definition" { 2 | value = aws_ecs_task_definition.example.arn 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/terraform-aws-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "instance_id" { 2 | value = aws_instance.example.id 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/terraform-aws-lambda-example/.gitignore: -------------------------------------------------------------------------------- 1 | *.zip -------------------------------------------------------------------------------- /examples/terraform-aws-lambda-example/src/README.md: -------------------------------------------------------------------------------- 1 | # AWS Lambda Function Handler Source 2 | 3 | The lambda executable `handler` was built using 4 | 5 | ``` shell 6 | go get github.com/aws/aws-lambda-go/lambda 7 | GOOS=linux GOARCH=amd64 go build -tags lambda.norpc -o bootstrap . 8 | ``` 9 | -------------------------------------------------------------------------------- /examples/terraform-aws-lambda-example/src/bootstrap.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | 7 | "github.com/aws/aws-lambda-go/lambda" 8 | ) 9 | 10 | type Event struct { 11 | ShouldFail bool `json:"ShouldFail"` 12 | Echo string `json:"Echo"` 13 | } 14 | 15 | // HandleRequest Fails if ShouldFail is `true`, otherwise echos the input. 16 | func HandleRequest(ctx context.Context, evnt *Event) (string, error) { 17 | if evnt == nil { 18 | return "", fmt.Errorf("received nil event") 19 | } 20 | if evnt.ShouldFail { 21 | return "", fmt.Errorf("failed to handle %#v", evnt) 22 | } 23 | return evnt.Echo, nil 24 | } 25 | 26 | func main() { 27 | lambda.Start(HandleRequest) 28 | } 29 | -------------------------------------------------------------------------------- /examples/terraform-aws-network-example/output.tf: -------------------------------------------------------------------------------- 1 | output "main_vpc_id" { 2 | value = aws_vpc.main.id 3 | description = "The main VPC id" 4 | } 5 | 6 | output "public_subnet_id" { 7 | value = aws_subnet.public.id 8 | description = "The public subnet id" 9 | } 10 | 11 | output "private_subnet_id" { 12 | value = aws_subnet.private.id 13 | description = "The private subnet id" 14 | } 15 | 16 | -------------------------------------------------------------------------------- /examples/terraform-aws-rds-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "db_instance_id" { 2 | value = aws_db_instance.example.id 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/terraform-aws-s3-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "bucket_id" { 2 | value = aws_s3_bucket.test_bucket.id 3 | } 4 | 5 | output "bucket_arn" { 6 | value = aws_s3_bucket.test_bucket.arn 7 | } 8 | 9 | output "logging_target_bucket" { 10 | value = aws_s3_bucket_logging.test_bucket.target_bucket 11 | } 12 | 13 | output "logging_target_prefix" { 14 | value = aws_s3_bucket_logging.test_bucket.target_prefix 15 | } 16 | -------------------------------------------------------------------------------- /examples/terraform-aws-ssm-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "instance_id" { 2 | value = aws_instance.example.id 3 | } 4 | -------------------------------------------------------------------------------- /examples/terraform-basic-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "example" { 2 | value = var.example 3 | } 4 | 5 | output "example2" { 6 | value = var.example2 7 | } 8 | 9 | output "example_list" { 10 | value = var.example_list 11 | } 12 | 13 | output "example_map" { 14 | value = var.example_map 15 | } 16 | 17 | output "example_any" { 18 | value = var.example_any 19 | } 20 | -------------------------------------------------------------------------------- /examples/terraform-basic-example/varfile.tfvars: -------------------------------------------------------------------------------- 1 | example2 = "test" 2 | -------------------------------------------------------------------------------- /examples/terraform-database-example/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | docker = { 4 | source = "kreuzwerker/docker" 5 | version = "~> 3.0" 6 | } 7 | } 8 | 9 | required_version = ">= 1.3.0" 10 | } 11 | 12 | provider "docker" { 13 | } 14 | 15 | resource "docker_network" "postgres_network" { 16 | name = "postgres_network" 17 | } 18 | 19 | resource "docker_volume" "postgres_volume" { 20 | name = "postgres_data" 21 | } 22 | 23 | resource "docker_container" "postgres" { 24 | name = "postgres" 25 | image = "postgres:15" 26 | 27 | env = [ 28 | "POSTGRES_USER=${var.username}", 29 | "POSTGRES_PASSWORD=${var.password}", 30 | "POSTGRES_DB=${var.database_name}" 31 | ] 32 | 33 | ports { 34 | internal = 5432 35 | external = var.port 36 | } 37 | 38 | networks_advanced { 39 | name = docker_network.postgres_network.name 40 | } 41 | 42 | restart = "always" 43 | } 44 | -------------------------------------------------------------------------------- /examples/terraform-database-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "host" { 2 | value = var.host 3 | } 4 | 5 | output "port" { 6 | value = var.port 7 | } 8 | 9 | output "username" { 10 | value = var.username 11 | } 12 | 13 | output "password" { 14 | value = var.password 15 | } 16 | 17 | output "database_name" { 18 | value = var.database_name 19 | } 20 | -------------------------------------------------------------------------------- /examples/terraform-database-example/variables.tf: -------------------------------------------------------------------------------- 1 | variable "host" { 2 | default = "localhost" 3 | } 4 | 5 | variable "port" { 6 | default = "32768" 7 | } 8 | 9 | variable "username" { 10 | default = "docker" 11 | } 12 | 13 | variable "password" { 14 | default = "docker" 15 | } 16 | 17 | variable "database_name" { 18 | default = "docker" 19 | } 20 | -------------------------------------------------------------------------------- /examples/terraform-gcp-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "instance_name" { 2 | value = google_compute_instance.example.name 3 | } 4 | 5 | output "public_ip" { 6 | value = google_compute_instance.example.network_interface[0].access_config[0].nat_ip 7 | } 8 | 9 | output "bucket_url" { 10 | value = google_storage_bucket.example_bucket.url 11 | } 12 | 13 | -------------------------------------------------------------------------------- /examples/terraform-gcp-ig-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "instance_group_name" { 2 | value = google_compute_region_instance_group_manager.example.name 3 | } 4 | 5 | -------------------------------------------------------------------------------- /examples/terraform-hello-world-example/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting 3 | # 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it 4 | # forwards compatible with 0.13.x code. 5 | required_version = ">= 0.12.26" 6 | } 7 | 8 | # website::tag::1:: The simplest possible Terraform module: it just outputs "Hello, World!" 9 | output "hello_world" { 10 | value = "Hello, World!" 11 | } -------------------------------------------------------------------------------- /examples/terraform-http-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "instance_id" { 2 | value = aws_instance.example.id 3 | } 4 | 5 | output "public_ip" { 6 | value = aws_instance.example.public_ip 7 | } 8 | 9 | output "instance_url" { 10 | value = "http://${aws_instance.example.public_ip}:${var.instance_port}" 11 | } 12 | 13 | -------------------------------------------------------------------------------- /examples/terraform-http-example/user-data/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script is meant to be run in the User Data of an EC2 Instance while it's booting. It starts a simple 3 | # "Hello, World" web server. 4 | 5 | set -e 6 | 7 | # Send the log output from this script to user-data.log, syslog, and the console 8 | # From: https://alestic.com/2010/12/ec2-user-data-output/ 9 | exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 10 | 11 | # The variables below are filled in using Terraform interpolation 12 | echo "${instance_text}" > index.html 13 | nohup busybox httpd -f -p "${instance_port}" & -------------------------------------------------------------------------------- /examples/terraform-opa-example/fail/main_fail.tf: -------------------------------------------------------------------------------- 1 | module "instance_types" { 2 | # website::tag::1:: We expect this to fail the OPA check since it is sourcing the module locally and not from gruntwork-io GitHub. 3 | source = "../pass" 4 | aws_region = var.aws_region 5 | } 6 | -------------------------------------------------------------------------------- /examples/terraform-opa-example/fail/output.tf: -------------------------------------------------------------------------------- 1 | output "recommended_instance_type" { 2 | description = "The recommended instance type to use in this AWS region. This will be the first instance type in var.instance_types which is available in all AZs in this region." 3 | value = module.instance_types.recommended_instance_type 4 | } 5 | -------------------------------------------------------------------------------- /examples/terraform-opa-example/fail/variables.tf: -------------------------------------------------------------------------------- 1 | variable "aws_region" { 2 | description = "Region to run the instance type checks on" 3 | type = string 4 | } 5 | -------------------------------------------------------------------------------- /examples/terraform-opa-example/pass/main_pass.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = var.aws_region 3 | } 4 | 5 | module "instance_types" { 6 | # website::tag::1:: We expect this to pass the OPA check since it is sourcing the module from gruntwork-io GitHub. 7 | source = "git::git@github.com:gruntwork-io/terraform-aws-utilities.git//modules/instance-type?ref=v0.6.0" 8 | instance_types = ["t2.micro", "t3.micro"] 9 | } 10 | -------------------------------------------------------------------------------- /examples/terraform-opa-example/pass/output.tf: -------------------------------------------------------------------------------- 1 | output "recommended_instance_type" { 2 | description = "The recommended instance type to use in this AWS region. This will be the first instance type in var.instance_types which is available in all AZs in this region." 3 | value = module.instance_types.recommended_instance_type 4 | } 5 | -------------------------------------------------------------------------------- /examples/terraform-opa-example/pass/variables.tf: -------------------------------------------------------------------------------- 1 | variable "aws_region" { 2 | description = "Region to run the instance type checks on" 3 | type = string 4 | } 5 | -------------------------------------------------------------------------------- /examples/terraform-packer-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "instance_id" { 2 | value = aws_instance.example.id 3 | } 4 | 5 | output "public_ip" { 6 | value = aws_instance.example.public_ip 7 | } 8 | 9 | output "instance_url" { 10 | value = "http://${aws_instance.example.public_ip}:${var.instance_port}" 11 | } 12 | 13 | -------------------------------------------------------------------------------- /examples/terraform-packer-example/user-data/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script is meant to be run in the User Data of an EC2 Instance while it's booting. It starts a Ruby web app. 3 | # This script assumes it is running in an AMI built from the Packer templates in examples/packer-docker-example 4 | # (either build.json or build.pkr.hcl). 5 | 6 | set -e 7 | 8 | # Send the log output from this script to user-data.log, syslog, and the console 9 | # From: https://alestic.com/2010/12/ec2-user-data-output/ 10 | exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 11 | 12 | # The variables below are filled in using Terraform interpolation 13 | nohup ruby /home/ubuntu/app.rb "${instance_port}" "${instance_text}" & 14 | -------------------------------------------------------------------------------- /examples/terraform-redeploy-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "alb_dns_name" { 2 | value = aws_alb.web_servers.dns_name 3 | } 4 | 5 | output "url" { 6 | value = "http://${aws_alb.web_servers.dns_name}:${var.alb_port}" 7 | } 8 | 9 | output "asg_name" { 10 | value = aws_autoscaling_group.web_servers.name 11 | } 12 | 13 | -------------------------------------------------------------------------------- /examples/terraform-redeploy-example/user-data/user-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script is meant to be run in the User Data of an EC2 Instance while it's booting. It starts a simple 3 | # "Hello, World" web server. 4 | 5 | set -e 6 | 7 | # Send the log output from this script to user-data.log, syslog, and the console 8 | # From: https://alestic.com/2010/12/ec2-user-data-output/ 9 | exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 10 | 11 | # The variables below are filled in using Terraform interpolation 12 | echo "${instance_text}" > index.html 13 | nohup busybox httpd -f -p "${instance_port}" & -------------------------------------------------------------------------------- /examples/terraform-remote-exec-example/files/get-public-ip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # For example purposes, print the public IP address of this instance. This example uses Instance Metadata Service version 2. 4 | TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") \ 5 | && curl -H "X-aws-ec2-metadata-token: $TOKEN" -s http://169.254.169.254/latest/meta-data/public-ipv4 6 | -------------------------------------------------------------------------------- /examples/terraform-remote-exec-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "public_instance_id" { 2 | value = aws_instance.example_public.id 3 | } 4 | 5 | output "public_instance_ip" { 6 | value = aws_instance.example_public.public_ip 7 | } 8 | 9 | -------------------------------------------------------------------------------- /examples/terraform-ssh-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "public_instance_id" { 2 | value = aws_instance.example_public.id 3 | } 4 | 5 | output "public_instance_ip" { 6 | value = aws_instance.example_public.public_ip 7 | } 8 | 9 | output "private_instance_id" { 10 | value = aws_instance.example_private.id 11 | } 12 | 13 | output "private_instance_ip" { 14 | value = aws_instance.example_private.private_ip 15 | } 16 | 17 | -------------------------------------------------------------------------------- /examples/terraform-ssh-password-example/outputs.tf: -------------------------------------------------------------------------------- 1 | output "public_instance_id" { 2 | value = aws_instance.example_public.id 3 | } 4 | 5 | output "public_instance_ip" { 6 | value = aws_instance.example_public.public_ip 7 | } 8 | 9 | -------------------------------------------------------------------------------- /examples/terraform-ssh-password-example/user_data.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | # Send the log output from this script to user-data.log, syslog, and the console 5 | # From: https://alestic.com/2010/12/ec2-user-data-output/ 6 | exec > >(tee /var/log/user-data.log | logger -t user-data -s 2>/dev/console) 2>&1 7 | 8 | # Create our new 'terratest' user 9 | adduser --disabled-password --gecos "" terratest 10 | 11 | # Set the user's password based on the random input from 'test/terraform_ssh_password_example_test.go' 12 | # shellcheck disable=SC2154 13 | echo "terratest:${terratest_password}" | chpasswd 14 | 15 | # Enable password auth on the SSH service 16 | echo "PasswordAuthentication yes" > /etc/ssh/sshd_config.d/01-password-auth.conf 17 | 18 | # Bounce the service to apply the config change 19 | service ssh restart 20 | -------------------------------------------------------------------------------- /examples/terragrunt-example/main.tf: -------------------------------------------------------------------------------- 1 | variable "input" {} 2 | variable "other_input" {} 3 | 4 | output "output" { 5 | value = "${var.input} ${var.other_input}" 6 | } 7 | -------------------------------------------------------------------------------- /examples/terragrunt-example/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | inputs = { 2 | input = "one input" 3 | other_input = "another input" 4 | extraneous_input = "an unused input" 5 | } 6 | -------------------------------------------------------------------------------- /examples/terragrunt-second-example/main.tf: -------------------------------------------------------------------------------- 1 | variable "input" {} 2 | variable "other_input" {} 3 | 4 | output "output" { 5 | value = "${var.input} ${var.other_input}" 6 | } 7 | -------------------------------------------------------------------------------- /examples/terragrunt-second-example/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | inputs = { 2 | input = "one input" 3 | other_input = "another input" 4 | extraneous_input = "an unused input" 5 | more_extraneous_input = "another unused input" 6 | } 7 | -------------------------------------------------------------------------------- /modules/aws/aws.go: -------------------------------------------------------------------------------- 1 | // Package aws allows to interact with resources on Amazon Web Services. 2 | package aws 3 | -------------------------------------------------------------------------------- /modules/aws/lambda_test.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | func TestFunctionError(t *testing.T) { 10 | t.Parallel() 11 | 12 | // assert that the error message contains all the components of the error, in a readable form 13 | err := &FunctionError{Message: "message", StatusCode: 123, Payload: []byte("payload")} 14 | require.Contains(t, err.Error(), "message") 15 | require.Contains(t, err.Error(), "123") 16 | require.Contains(t, err.Error(), "payload") 17 | } 18 | -------------------------------------------------------------------------------- /modules/azure/azure.go: -------------------------------------------------------------------------------- 1 | // Package `azure` allows users to interact with resources on the Microsoft Azure platform 2 | 3 | package azure 4 | -------------------------------------------------------------------------------- /modules/azure/datafactory_test.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | /* 10 | The below tests are currently stubbed out, with the expectation that they will throw errors. 11 | If/when CRUD methods are introduced for Azure Synapse, these tests can be extended 12 | */ 13 | func TestDataFactoryExists(t *testing.T) { 14 | t.Parallel() 15 | 16 | dataFactoryName := "" 17 | resourceGroupName := "" 18 | subscriptionID := "" 19 | 20 | exists, err := DataFactoryExistsE(dataFactoryName, resourceGroupName, subscriptionID) 21 | 22 | require.False(t, exists) 23 | require.Error(t, err) 24 | } 25 | 26 | func TestGetDataFactoryE(t *testing.T) { 27 | t.Parallel() 28 | 29 | resGroupName := "" 30 | subscriptionID := "" 31 | dataFactoryName := "" 32 | 33 | _, err := GetDataFactoryE(subscriptionID, resGroupName, dataFactoryName) 34 | require.Error(t, err) 35 | } 36 | -------------------------------------------------------------------------------- /modules/azure/disk_test.go: -------------------------------------------------------------------------------- 1 | //go:build azure 2 | // +build azure 3 | 4 | // NOTE: We use build tags to differentiate azure testing because we currently do not have azure access setup for 5 | // CircleCI. 6 | 7 | package azure 8 | 9 | import ( 10 | "testing" 11 | 12 | "github.com/stretchr/testify/require" 13 | ) 14 | 15 | func TestGetDiskE(t *testing.T) { 16 | t.Parallel() 17 | 18 | diskName := "" 19 | rgName := "" 20 | subID := "" 21 | 22 | _, err := GetDiskE(diskName, rgName, subID) 23 | 24 | require.Error(t, err) 25 | } 26 | -------------------------------------------------------------------------------- /modules/azure/enums.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | // LoadBalancerIPType enumerator for types Public, Private or No IP. 4 | type LoadBalancerIPType string 5 | 6 | // LoadBalancerIPType values 7 | const ( 8 | PublicIP LoadBalancerIPType = "PublicIP" 9 | PrivateIP LoadBalancerIPType = "PrivateIP" 10 | NoIP LoadBalancerIPType = "NoIP" 11 | ) 12 | -------------------------------------------------------------------------------- /modules/azure/loganalytics_test.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | "github.com/stretchr/testify/require" 8 | ) 9 | 10 | /* 11 | The below tests are currently stubbed out, with the expectation that they will throw errors. 12 | If/when methods to create and delete log analytics resources are added, these tests can be extended. 13 | */ 14 | 15 | func TestLogAnalyticsWorkspace(t *testing.T) { 16 | t.Parallel() 17 | 18 | _, err := LogAnalyticsWorkspaceExistsE("fake", "", "") 19 | assert.Error(t, err, "Workspace") 20 | } 21 | 22 | func TestGetLogAnalyticsWorkspaceE(t *testing.T) { 23 | t.Parallel() 24 | workspaceName := "" 25 | resourceGroupName := "" 26 | subscriptionID := "" 27 | 28 | _, err := GetLogAnalyticsWorkspaceE(workspaceName, resourceGroupName, subscriptionID) 29 | require.Error(t, err) 30 | } 31 | -------------------------------------------------------------------------------- /modules/azure/monitor_test.go: -------------------------------------------------------------------------------- 1 | //go:build azure 2 | // +build azure 3 | 4 | package azure 5 | 6 | import ( 7 | "testing" 8 | 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | func TestDiagnosticsSettingsResourceExists(t *testing.T) { 13 | t.Parallel() 14 | 15 | diagnosticsSettingResourceName := "fakename" 16 | resGroupName := "fakeresgroup" 17 | subscriptionID := "fakesubid" 18 | 19 | _, err := DiagnosticSettingsResourceExistsE(diagnosticsSettingResourceName, resGroupName, subscriptionID) 20 | require.Error(t, err) 21 | } 22 | -------------------------------------------------------------------------------- /modules/azure/privatednszone_test.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | /* 10 | The below tests are currently stubbed out, with the expectation that they will throw errors. 11 | If/when CRUD methods are introduced for Azure Synapse, these tests can be extended 12 | */ 13 | func TestPrivateDNSZoneExists(t *testing.T) { 14 | t.Parallel() 15 | 16 | zoneName := "" 17 | resourceGroupName := "" 18 | subscriptionID := "" 19 | 20 | exists, err := PrivateDNSZoneExistsE(zoneName, resourceGroupName, subscriptionID) 21 | 22 | require.False(t, exists) 23 | require.Error(t, err) 24 | } 25 | 26 | func TestPrivateDNSZoneExistsE(t *testing.T) { 27 | t.Parallel() 28 | 29 | resGroupName := "" 30 | subscriptionID := "" 31 | zoneName := "" 32 | 33 | _, err := GetPrivateDNSZoneE(subscriptionID, resGroupName, zoneName) 34 | require.Error(t, err) 35 | } 36 | -------------------------------------------------------------------------------- /modules/azure/resourceid.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | import "github.com/gruntwork-io/terratest/modules/collections" 4 | 5 | // GetNameFromResourceID gets the Name from an Azure Resource ID. 6 | func GetNameFromResourceID(resourceID string) string { 7 | id, err := GetNameFromResourceIDE(resourceID) 8 | if err != nil { 9 | return "" 10 | } 11 | return id 12 | } 13 | 14 | // GetNameFromResourceIDE gets the Name from an Azure Resource ID. 15 | // This function would fail the test if there is an error. 16 | func GetNameFromResourceIDE(resourceID string) (string, error) { 17 | id, err := collections.GetSliceLastValueE(resourceID, "/") 18 | if err != nil { 19 | return "", err 20 | } 21 | return id, nil 22 | } 23 | -------------------------------------------------------------------------------- /modules/azure/resourceid_test.go: -------------------------------------------------------------------------------- 1 | //go:build azure 2 | // +build azure 3 | 4 | // NOTE: We use build tags to differentiate azure testing because we currently do not have azure access setup for 5 | // CircleCI. 6 | 7 | package azure 8 | 9 | import ( 10 | "testing" 11 | 12 | "github.com/stretchr/testify/assert" 13 | ) 14 | 15 | func TestGetNameFromResourceID(t *testing.T) { 16 | t.Parallel() 17 | 18 | // set slice variables 19 | sliceSource := "this/is/a/long/slash/separated/string/ResourceID" 20 | sliceResult := "ResourceID" 21 | sliceNotFound := "noresourcepresent" 22 | 23 | // verify success 24 | resultSuccess := GetNameFromResourceID(sliceSource) 25 | assert.Equal(t, sliceResult, resultSuccess) 26 | 27 | // verify error when seperator not found 28 | resultBadSeperator := GetNameFromResourceID(sliceNotFound) 29 | assert.Equal(t, "", resultBadSeperator) 30 | } 31 | -------------------------------------------------------------------------------- /modules/azure/subscription.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | import ( 4 | "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2019-06-01/subscriptions" 5 | ) 6 | 7 | // GetSubscriptionClientE is a helper function that will setup an Azure Subscription client on your behalf 8 | func GetSubscriptionClientE() (*subscriptions.Client, error) { 9 | // Create a Subscription client 10 | client, err := CreateSubscriptionsClientE() 11 | if err != nil { 12 | return nil, err 13 | } 14 | 15 | // Create an authorizer 16 | authorizer, err := NewAuthorizer() 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | // Attach authorizer to the client 22 | client.Authorizer = *authorizer 23 | return &client, nil 24 | } 25 | -------------------------------------------------------------------------------- /modules/azure/synapse_test.go: -------------------------------------------------------------------------------- 1 | package azure 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | /* 10 | The below tests are currently stubbed out, with the expectation that they will throw errors. 11 | If/when CRUD methods are introduced for Azure Synapse, these tests can be extended 12 | */ 13 | 14 | func TestGetSynapseWorkspaceE(t *testing.T) { 15 | t.Parallel() 16 | 17 | resGroupName := "" 18 | subscriptionID := "" 19 | workspaceName := "" 20 | 21 | _, err := GetSynapseWorkspaceE(t, subscriptionID, resGroupName, workspaceName) 22 | require.Error(t, err) 23 | } 24 | 25 | func TestGetSynapseSqlPoolE(t *testing.T) { 26 | t.Parallel() 27 | 28 | resGroupName := "" 29 | subscriptionID := "" 30 | workspaceName := "" 31 | sqlPoolName := "" 32 | 33 | _, err := GetSynapseSqlPoolE(t, subscriptionID, resGroupName, workspaceName, sqlPoolName) 34 | require.Error(t, err) 35 | } 36 | -------------------------------------------------------------------------------- /modules/collections/collections.go: -------------------------------------------------------------------------------- 1 | // Package collections allows to interact with lists of things. 2 | package collections 3 | -------------------------------------------------------------------------------- /modules/collections/errors.go: -------------------------------------------------------------------------------- 1 | package collections 2 | 3 | import "fmt" 4 | 5 | // SliceValueNotFoundError is returned when a provided values file input is not found on the host path. 6 | type SliceValueNotFoundError struct { 7 | sourceString string 8 | } 9 | 10 | func (err SliceValueNotFoundError) Error() string { 11 | return fmt.Sprintf("Could not resolve requested slice value from string %s", err.sourceString) 12 | } 13 | 14 | // NewSliceValueNotFoundError creates a new slice found error 15 | func NewSliceValueNotFoundError(sourceString string) SliceValueNotFoundError { 16 | return SliceValueNotFoundError{sourceString} 17 | } 18 | -------------------------------------------------------------------------------- /modules/docker/docker.go: -------------------------------------------------------------------------------- 1 | // Package docker allows to interact with Docker and docker compose resources. 2 | package docker 3 | -------------------------------------------------------------------------------- /modules/docker/images_test.go: -------------------------------------------------------------------------------- 1 | package docker 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | "testing" 7 | 8 | "github.com/gruntwork-io/terratest/modules/random" 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestListImagesAndDeleteImage(t *testing.T) { 13 | t.Parallel() 14 | 15 | uniqueID := strings.ToLower(random.UniqueId()) 16 | repo := "gruntwork-io/test-image" 17 | tag := fmt.Sprintf("v1-%s", uniqueID) 18 | img := fmt.Sprintf("%s:%s", repo, tag) 19 | 20 | options := &BuildOptions{ 21 | Tags: []string{img}, 22 | } 23 | Build(t, "../../test/fixtures/docker", options) 24 | 25 | assert.True(t, DoesImageExist(t, img, nil)) 26 | DeleteImage(t, img, nil) 27 | assert.False(t, DoesImageExist(t, img, nil)) 28 | } 29 | -------------------------------------------------------------------------------- /modules/docker/push.go: -------------------------------------------------------------------------------- 1 | package docker 2 | 3 | import ( 4 | "github.com/gruntwork-io/terratest/modules/logger" 5 | "github.com/gruntwork-io/terratest/modules/shell" 6 | "github.com/gruntwork-io/terratest/modules/testing" 7 | "github.com/stretchr/testify/require" 8 | ) 9 | 10 | // Push runs the 'docker push' command to push the given tag. This will fail the test if there are any errors. 11 | func Push(t testing.TestingT, logger *logger.Logger, tag string) { 12 | require.NoError(t, PushE(t, logger, tag)) 13 | } 14 | 15 | // PushE runs the 'docker push' command to push the given tag. 16 | func PushE(t testing.TestingT, logger *logger.Logger, tag string) error { 17 | logger.Logf(t, "Running 'docker push' for tag %s", tag) 18 | 19 | cmd := shell.Command{ 20 | Command: "docker", 21 | Args: []string{"push", tag}, 22 | Logger: logger, 23 | } 24 | return shell.RunCommandE(t, cmd) 25 | } 26 | -------------------------------------------------------------------------------- /modules/docker/run_test.go: -------------------------------------------------------------------------------- 1 | package docker 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | func TestRun(t *testing.T) { 10 | t.Parallel() 11 | 12 | options := &RunOptions{ 13 | Command: []string{"-c", `echo "Hello, $NAME!"`}, 14 | Entrypoint: "sh", 15 | EnvironmentVariables: []string{"NAME=World"}, 16 | Remove: true, 17 | } 18 | 19 | out := Run(t, "alpine:3.7", options) 20 | require.Contains(t, out, "Hello, World!") 21 | } 22 | -------------------------------------------------------------------------------- /modules/environment/environment.go: -------------------------------------------------------------------------------- 1 | // Package environment provides utility functions for interacting with the OS environment (e.g environment variables). 2 | package environment 3 | -------------------------------------------------------------------------------- /modules/files/errors.go: -------------------------------------------------------------------------------- 1 | package files 2 | 3 | import "fmt" 4 | 5 | // DirNotFoundError is an error that occurs if a directory doesn't exist 6 | type DirNotFoundError struct { 7 | Directory string 8 | } 9 | 10 | func (err DirNotFoundError) Error() string { 11 | return fmt.Sprintf("Directory was not found: \"%s\"", err.Directory) 12 | } 13 | -------------------------------------------------------------------------------- /modules/gcp/gcp.go: -------------------------------------------------------------------------------- 1 | // Package gcp allows interaction with Google Cloud Platform resources. 2 | package gcp 3 | 4 | import ( 5 | "google.golang.org/api/option" 6 | ) 7 | 8 | func withOptions() (opts []option.ClientOption) { 9 | v, ok := getStaticTokenSource() 10 | if ok { 11 | opts = append(opts, option.WithTokenSource(v)) 12 | } 13 | 14 | return 15 | } 16 | -------------------------------------------------------------------------------- /modules/gcp/static_token.go: -------------------------------------------------------------------------------- 1 | package gcp 2 | 3 | import ( 4 | "os" 5 | 6 | "golang.org/x/oauth2" 7 | ) 8 | 9 | func getStaticTokenSource() (oauth2.TokenSource, bool) { 10 | v, ok := os.LookupEnv("GOOGLE_OAUTH_ACCESS_TOKEN") 11 | if ok { 12 | return oauth2.StaticTokenSource(&oauth2.Token{AccessToken: v}), true 13 | } 14 | return nil, false 15 | } 16 | -------------------------------------------------------------------------------- /modules/helm/helm.go: -------------------------------------------------------------------------------- 1 | // Package helm provides common functionalities for testing helm charts, such as calling out to the helm client. 2 | package helm 3 | -------------------------------------------------------------------------------- /modules/helm/testdata/configmap-literalblock.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | labels: 5 | app: release-name 6 | name: release-name 7 | data: 8 | thisIsSomeDataKey: | 9 | configmap-data-value-1; 10 | configmap-data-value-2; 11 | -------------------------------------------------------------------------------- /modules/helm/testdata/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: nginx 16 | spec: 17 | containers: 18 | - name: nginx 19 | image: nginx:latest 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /modules/helm/testdata/deployments.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: nginx-deployment-1 6 | labels: 7 | app: nginx 8 | spec: 9 | replicas: 3 10 | selector: 11 | matchLabels: 12 | app: nginx 13 | template: 14 | metadata: 15 | labels: 16 | app: nginx 17 | spec: 18 | containers: 19 | - name: nginx 20 | image: nginx:latest 21 | ports: 22 | - containerPort: 80 23 | --- 24 | apiVersion: apps/v1 25 | kind: Deployment 26 | metadata: 27 | name: nginx-deployment-2 28 | labels: 29 | app: nginx 30 | spec: 31 | replicas: 3 32 | selector: 33 | matchLabels: 34 | app: nginx 35 | template: 36 | metadata: 37 | labels: 38 | app: nginx 39 | spec: 40 | containers: 41 | - name: nginx 42 | image: nginx:latest 43 | ports: 44 | - containerPort: 80 45 | -------------------------------------------------------------------------------- /modules/helm/testdata/deprecated-chart/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: test 2 | version: 0.1.0 3 | apiVersion: v1 4 | deprecated: true 5 | -------------------------------------------------------------------------------- /modules/helm/testdata/deprecated-chart/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: nginx 16 | spec: 17 | containers: 18 | - name: nginx 19 | image: nginx:latest 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /modules/helm/testdata/invalid-duplicate.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment 5 | labels: 6 | app: nginx 7 | app: nginx2 8 | spec: 9 | replicas: 3 10 | selector: 11 | matchLabels: 12 | app: nginx 13 | template: 14 | metadata: 15 | labels: 16 | app: nginx 17 | app: nginx2 18 | spec: 19 | containers: 20 | - name: nginx 21 | image: nginx:latest 22 | ports: 23 | - containerPort: 80 24 | -------------------------------------------------------------------------------- /modules/helm/testdata/multiple-manifests/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: test 2 | version: 0.1.0 3 | apiVersion: v1 4 | -------------------------------------------------------------------------------- /modules/helm/testdata/multiple-manifests/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | labels: 5 | app: test 6 | name: test-configmap 7 | data: 8 | hello: world 9 | foo: bar 10 | -------------------------------------------------------------------------------- /modules/helm/testdata/multiple-manifests/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: test-deployment 5 | labels: 6 | app: test 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: test 12 | template: 13 | metadata: 14 | labels: 15 | app: test 16 | spec: 17 | containers: 18 | - name: nginx 19 | image: nginx:latest 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /modules/http-helper/errors.go: -------------------------------------------------------------------------------- 1 | package http_helper 2 | 3 | import "fmt" 4 | 5 | // ValidationFunctionFailed is an error that occurs if a validation function fails. 6 | type ValidationFunctionFailed struct { 7 | Url string 8 | Status int 9 | Body string 10 | } 11 | 12 | func (err ValidationFunctionFailed) Error() string { 13 | return fmt.Sprintf("Validation failed for URL %s. Response status: %d. Response body:\n%s", err.Url, err.Status, err.Body) 14 | } 15 | -------------------------------------------------------------------------------- /modules/k8s/k8s.go: -------------------------------------------------------------------------------- 1 | // Package k8s provides common functionalities for interacting with a Kubernetes cluster in the context of 2 | // infrastructure testing. 3 | package k8s 4 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestCloseChannelsClosesAll.log: -------------------------------------------------------------------------------- 1 | === RUN TestCloseChannelsClosesAll 2 | === PAUSE TestCloseChannelsClosesAll 3 | === CONT TestCloseChannelsClosesAll 4 | TestCloseChannelsClosesAll INFO 2018-10-20T13:03:33-07:00 Closing all the channels in log writer 5 | --- PASS: TestCloseChannelsClosesAll (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestEnsureDirectoryExistsCreatesDirectory.log: -------------------------------------------------------------------------------- 1 | === RUN TestEnsureDirectoryExistsCreatesDirectory 2 | === PAUSE TestEnsureDirectoryExistsCreatesDirectory 3 | === CONT TestEnsureDirectoryExistsCreatesDirectory 4 | TestEnsureDirectoryExistsCreatesDirectory INFO 2018-10-20T13:03:33-07:00 Creating directory /var/folders/n2/pljz6dq52bd1ksmw23qyr3sr0000gn/T/TestEnsureDirectoryCreatesDirectory896401467/tmpdir 5 | --- PASS: TestEnsureDirectoryExistsCreatesDirectory (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestEnsureDirectoryExistsHandlesExistingDirectory.log: -------------------------------------------------------------------------------- 1 | === RUN TestEnsureDirectoryExistsHandlesExistingDirectory 2 | === PAUSE TestEnsureDirectoryExistsHandlesExistingDirectory 3 | === CONT TestEnsureDirectoryExistsHandlesExistingDirectory 4 | TestEnsureDirectoryExistsHandlesExistingDirectory INFO 2018-10-20T13:03:33-07:00 Directory /var/folders/n2/pljz6dq52bd1ksmw23qyr3sr0000gn/T/TestEnsureDirectoryCreatesDirectory503195489 already exists 5 | --- PASS: TestEnsureDirectoryExistsHandlesExistingDirectory (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetIndent.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent 2 | === PAUSE TestGetIndent 3 | === CONT TestGetIndent 4 | --- PASS: TestGetIndent (0.00s) 5 | --- PASS: TestGetIndent/BaseCase (0.00s) 6 | --- PASS: TestGetIndent/NoIndent (0.00s) 7 | --- PASS: TestGetIndent/EmptyString (0.00s) 8 | --- PASS: TestGetIndent/Tabs (0.00s) 9 | --- PASS: TestGetIndent/MixTabSpace (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetIndent/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/BaseCase 2 | --- PASS: TestGetIndent/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetIndent/EmptyString.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/EmptyString 2 | --- PASS: TestGetIndent/EmptyString (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetIndent/MixTabSpace.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/MixTabSpace 2 | --- PASS: TestGetIndent/MixTabSpace (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetIndent/NoIndent.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/NoIndent 2 | --- PASS: TestGetIndent/NoIndent (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetIndent/Tabs.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/Tabs 2 | --- PASS: TestGetIndent/Tabs (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetOrCreateChannelReturnsExistingChannel.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetOrCreateChannelReturnsExistingChannel 2 | === PAUSE TestGetOrCreateChannelReturnsExistingChannel 3 | === CONT TestGetOrCreateChannelReturnsExistingChannel 4 | --- PASS: TestGetOrCreateChannelReturnsExistingChannel (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine 2 | === PAUSE TestGetTestNameFromResultLine 3 | === CONT TestGetTestNameFromResultLine 4 | --- PASS: TestGetTestNameFromResultLine (0.00s) 5 | --- PASS: TestGetTestNameFromResultLine/BaseCase (0.00s) 6 | --- PASS: TestGetTestNameFromResultLine/Indented (0.00s) 7 | --- PASS: TestGetTestNameFromResultLine/SpecialChars (0.00s) 8 | --- PASS: TestGetTestNameFromResultLine/WhenFailed (0.00s) 9 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromResultLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/BaseCase 2 | --- PASS: TestGetTestNameFromResultLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromResultLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/Indented 2 | --- PASS: TestGetTestNameFromResultLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromResultLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/SpecialChars 2 | --- PASS: TestGetTestNameFromResultLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromResultLine/WhenFailed.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/WhenFailed 2 | --- PASS: TestGetTestNameFromResultLine/WhenFailed (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine 2 | === PAUSE TestGetTestNameFromStatusLine 3 | === CONT TestGetTestNameFromStatusLine 4 | --- PASS: TestGetTestNameFromStatusLine (0.00s) 5 | --- PASS: TestGetTestNameFromStatusLine/BaseCase (0.00s) 6 | --- PASS: TestGetTestNameFromStatusLine/Indented (0.00s) 7 | --- PASS: TestGetTestNameFromStatusLine/SpecialChars (0.00s) 8 | --- PASS: TestGetTestNameFromStatusLine/WhenPaused (0.00s) 9 | --- PASS: TestGetTestNameFromStatusLine/WhenCont (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromStatusLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/BaseCase 2 | --- PASS: TestGetTestNameFromStatusLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromStatusLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/Indented 2 | --- PASS: TestGetTestNameFromStatusLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromStatusLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/SpecialChars 2 | --- PASS: TestGetTestNameFromStatusLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromStatusLine/WhenCont.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/WhenCont 2 | --- PASS: TestGetTestNameFromStatusLine/WhenCont (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestGetTestNameFromStatusLine/WhenPaused.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/WhenPaused 2 | --- PASS: TestGetTestNameFromStatusLine/WhenPaused (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsEmpty 2 | === PAUSE TestIsEmpty 3 | === CONT TestIsEmpty 4 | --- PASS: TestIsEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsPanicLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine 2 | === PAUSE TestIsPanicLine 3 | === CONT TestIsPanicLine 4 | --- PASS: TestIsPanicLine (0.00s) 5 | --- PASS: TestIsPanicLine/BaseCase (0.00s) 6 | --- PASS: TestIsPanicLine/NotPanic (0.00s) 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsPanicLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine/BaseCase 2 | --- PASS: TestIsPanicLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsPanicLine/NotPanic.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine/NotPanic 2 | --- PASS: TestIsPanicLine/NotPanic (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine 2 | === PAUSE TestIsResultLine 3 | === CONT TestIsResultLine 4 | --- PASS: TestIsResultLine (0.00s) 5 | --- PASS: TestIsResultLine/BaseCase (0.00s) 6 | --- PASS: TestIsResultLine/Indented (0.00s) 7 | --- PASS: TestIsResultLine/SpecialChars (0.00s) 8 | --- PASS: TestIsResultLine/WhenFailed (0.00s) 9 | --- PASS: TestIsResultLine/NonResultLine (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsResultLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/BaseCase 2 | --- PASS: TestIsResultLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsResultLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/Indented 2 | --- PASS: TestIsResultLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsResultLine/NonResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/NonResultLine 2 | --- PASS: TestIsResultLine/NonResultLine (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsResultLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/SpecialChars 2 | --- PASS: TestIsResultLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsResultLine/WhenFailed.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/WhenFailed 2 | --- PASS: TestIsResultLine/WhenFailed (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine 2 | === PAUSE TestIsStatusLine 3 | === CONT TestIsStatusLine 4 | --- PASS: TestIsStatusLine (0.00s) 5 | --- PASS: TestIsStatusLine/BaseCase (0.00s) 6 | --- PASS: TestIsStatusLine/Indented (0.00s) 7 | --- PASS: TestIsStatusLine/SpecialChars (0.00s) 8 | --- PASS: TestIsStatusLine/WhenPaused (0.00s) 9 | --- PASS: TestIsStatusLine/WhenCont (0.00s) 10 | --- PASS: TestIsStatusLine/NonStatusLine (0.00s) 11 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsStatusLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/BaseCase 2 | --- PASS: TestIsStatusLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsStatusLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/Indented 2 | --- PASS: TestIsStatusLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsStatusLine/NonStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/NonStatusLine 2 | --- PASS: TestIsStatusLine/NonStatusLine (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsStatusLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/SpecialChars 2 | --- PASS: TestIsStatusLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsStatusLine/WhenCont.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/WhenCont 2 | --- PASS: TestIsStatusLine/WhenCont (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsStatusLine/WhenPaused.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/WhenPaused 2 | --- PASS: TestIsStatusLine/WhenPaused (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsSummaryLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine 2 | === PAUSE TestIsSummaryLine 3 | === CONT TestIsSummaryLine 4 | --- PASS: TestIsSummaryLine (0.00s) 5 | --- PASS: TestIsSummaryLine/BaseCase (0.00s) 6 | --- PASS: TestIsSummaryLine/NotSummary (0.00s) 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsSummaryLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine/BaseCase 2 | --- PASS: TestIsSummaryLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestIsSummaryLine/NotSummary.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine/NotSummary 2 | --- PASS: TestIsSummaryLine/NotSummary (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestPeek.log: -------------------------------------------------------------------------------- 1 | === RUN TestPeek 2 | === PAUSE TestPeek 3 | === CONT TestPeek 4 | --- PASS: TestPeek (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestPeekEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestPeekEmpty 2 | === PAUSE TestPeekEmpty 3 | === CONT TestPeekEmpty 4 | --- PASS: TestPeekEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestRemoveDedentedTestResultMarkers.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkers 2 | --- PASS: TestRemoveDedentedTestResultMarkers (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestRemoveDedentedTestResultMarkersAll.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkersAll 2 | --- PASS: TestRemoveDedentedTestResultMarkersAll (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestRemoveDedentedTestResultMarkersEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkersEmpty 2 | --- PASS: TestRemoveDedentedTestResultMarkersEmpty (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestStackPop.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPop 2 | === PAUSE TestStackPop 3 | === CONT TestStackPop 4 | --- PASS: TestStackPop (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestStackPopEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPopEmpty 2 | === PAUSE TestStackPopEmpty 3 | === CONT TestStackPopEmpty 4 | --- PASS: TestStackPopEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/basic_example_expected/TestStackPush.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPush 2 | === PAUSE TestStackPush 3 | === CONT TestStackPush 4 | --- PASS: TestStackPush (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestBasicExample.log: -------------------------------------------------------------------------------- 1 | === RUN TestBasicExample 2 | --- FAIL: TestBasicExample (0.00s) 3 | integration_test.go:10: 4 | Error Trace: integration_test.go:10 5 | Error: Expected value not to be nil. 6 | Test: TestBasicExample 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestCloseChannelsClosesAll.log: -------------------------------------------------------------------------------- 1 | === RUN TestCloseChannelsClosesAll 2 | === PAUSE TestCloseChannelsClosesAll 3 | === CONT TestCloseChannelsClosesAll 4 | TestCloseChannelsClosesAll INFO 2018-10-20T13:15:09-07:00 Closing all the channels in log writer 5 | --- PASS: TestCloseChannelsClosesAll (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestEnsureDirectoryExistsCreatesDirectory.log: -------------------------------------------------------------------------------- 1 | === RUN TestEnsureDirectoryExistsCreatesDirectory 2 | === PAUSE TestEnsureDirectoryExistsCreatesDirectory 3 | === CONT TestEnsureDirectoryExistsCreatesDirectory 4 | TestEnsureDirectoryExistsCreatesDirectory INFO 2018-10-20T13:15:09-07:00 Creating directory /var/folders/n2/pljz6dq52bd1ksmw23qyr3sr0000gn/T/TestEnsureDirectoryCreatesDirectory357603033/tmpdir 5 | --- PASS: TestEnsureDirectoryExistsCreatesDirectory (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestEnsureDirectoryExistsHandlesExistingDirectory.log: -------------------------------------------------------------------------------- 1 | === RUN TestEnsureDirectoryExistsHandlesExistingDirectory 2 | === PAUSE TestEnsureDirectoryExistsHandlesExistingDirectory 3 | === CONT TestEnsureDirectoryExistsHandlesExistingDirectory 4 | TestEnsureDirectoryExistsHandlesExistingDirectory INFO 2018-10-20T13:15:09-07:00 Directory /var/folders/n2/pljz6dq52bd1ksmw23qyr3sr0000gn/T/TestEnsureDirectoryCreatesDirectory292537295 already exists 5 | --- PASS: TestEnsureDirectoryExistsHandlesExistingDirectory (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetIndent.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent 2 | === PAUSE TestGetIndent 3 | === CONT TestGetIndent 4 | --- PASS: TestGetIndent (0.00s) 5 | --- PASS: TestGetIndent/BaseCase (0.00s) 6 | --- PASS: TestGetIndent/NoIndent (0.00s) 7 | --- PASS: TestGetIndent/EmptyString (0.00s) 8 | --- PASS: TestGetIndent/Tabs (0.00s) 9 | --- PASS: TestGetIndent/MixTabSpace (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetIndent/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/BaseCase 2 | --- PASS: TestGetIndent/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetIndent/EmptyString.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/EmptyString 2 | --- PASS: TestGetIndent/EmptyString (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetIndent/MixTabSpace.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/MixTabSpace 2 | --- PASS: TestGetIndent/MixTabSpace (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetIndent/NoIndent.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/NoIndent 2 | --- PASS: TestGetIndent/NoIndent (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetIndent/Tabs.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/Tabs 2 | --- PASS: TestGetIndent/Tabs (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetOrCreateChannelReturnsExistingChannel.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetOrCreateChannelReturnsExistingChannel 2 | === PAUSE TestGetOrCreateChannelReturnsExistingChannel 3 | === CONT TestGetOrCreateChannelReturnsExistingChannel 4 | --- PASS: TestGetOrCreateChannelReturnsExistingChannel (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine 2 | === PAUSE TestGetTestNameFromResultLine 3 | === CONT TestGetTestNameFromResultLine 4 | --- PASS: TestGetTestNameFromResultLine (0.00s) 5 | --- PASS: TestGetTestNameFromResultLine/BaseCase (0.00s) 6 | --- PASS: TestGetTestNameFromResultLine/Indented (0.00s) 7 | --- PASS: TestGetTestNameFromResultLine/SpecialChars (0.00s) 8 | --- PASS: TestGetTestNameFromResultLine/WhenFailed (0.00s) 9 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromResultLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/BaseCase 2 | --- PASS: TestGetTestNameFromResultLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromResultLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/Indented 2 | --- PASS: TestGetTestNameFromResultLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromResultLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/SpecialChars 2 | --- PASS: TestGetTestNameFromResultLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromResultLine/WhenFailed.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/WhenFailed 2 | --- PASS: TestGetTestNameFromResultLine/WhenFailed (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine 2 | === PAUSE TestGetTestNameFromStatusLine 3 | === CONT TestGetTestNameFromStatusLine 4 | --- PASS: TestGetTestNameFromStatusLine (0.00s) 5 | --- PASS: TestGetTestNameFromStatusLine/BaseCase (0.00s) 6 | --- PASS: TestGetTestNameFromStatusLine/Indented (0.00s) 7 | --- PASS: TestGetTestNameFromStatusLine/SpecialChars (0.00s) 8 | --- PASS: TestGetTestNameFromStatusLine/WhenPaused (0.00s) 9 | --- PASS: TestGetTestNameFromStatusLine/WhenCont (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromStatusLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/BaseCase 2 | --- PASS: TestGetTestNameFromStatusLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromStatusLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/Indented 2 | --- PASS: TestGetTestNameFromStatusLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromStatusLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/SpecialChars 2 | --- PASS: TestGetTestNameFromStatusLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromStatusLine/WhenCont.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/WhenCont 2 | --- PASS: TestGetTestNameFromStatusLine/WhenCont (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestGetTestNameFromStatusLine/WhenPaused.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/WhenPaused 2 | --- PASS: TestGetTestNameFromStatusLine/WhenPaused (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsEmpty 2 | === PAUSE TestIsEmpty 3 | === CONT TestIsEmpty 4 | --- PASS: TestIsEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsPanicLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine 2 | === PAUSE TestIsPanicLine 3 | === CONT TestIsPanicLine 4 | --- PASS: TestIsPanicLine (0.00s) 5 | --- PASS: TestIsPanicLine/BaseCase (0.00s) 6 | --- PASS: TestIsPanicLine/NotPanic (0.00s) 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsPanicLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine/BaseCase 2 | --- PASS: TestIsPanicLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsPanicLine/NotPanic.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine/NotPanic 2 | --- PASS: TestIsPanicLine/NotPanic (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine 2 | === PAUSE TestIsResultLine 3 | === CONT TestIsResultLine 4 | --- PASS: TestIsResultLine (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsResultLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/BaseCase 2 | --- PASS: TestIsResultLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsResultLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/Indented 2 | --- PASS: TestIsResultLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsResultLine/NonResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/NonResultLine 2 | --- PASS: TestIsResultLine/NonResultLine (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsResultLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/SpecialChars 2 | --- PASS: TestIsResultLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsResultLine/WhenFailed.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/WhenFailed 2 | --- PASS: TestIsResultLine/WhenFailed (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine 2 | === PAUSE TestIsStatusLine 3 | === CONT TestIsStatusLine 4 | --- PASS: TestIsStatusLine (0.00s) 5 | --- PASS: TestIsStatusLine/BaseCase (0.00s) 6 | --- PASS: TestIsStatusLine/Indented (0.00s) 7 | --- PASS: TestIsStatusLine/SpecialChars (0.00s) 8 | --- PASS: TestIsStatusLine/WhenPaused (0.00s) 9 | --- PASS: TestIsStatusLine/WhenCont (0.00s) 10 | --- PASS: TestIsStatusLine/NonStatusLine (0.00s) 11 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsStatusLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/BaseCase 2 | --- PASS: TestIsStatusLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsStatusLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/Indented 2 | --- PASS: TestIsStatusLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsStatusLine/NonStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/NonStatusLine 2 | --- PASS: TestIsStatusLine/NonStatusLine (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsStatusLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/SpecialChars 2 | --- PASS: TestIsStatusLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsStatusLine/WhenCont.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/WhenCont 2 | --- PASS: TestIsStatusLine/WhenCont (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsStatusLine/WhenPaused.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/WhenPaused 2 | --- PASS: TestIsStatusLine/WhenPaused (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsSummaryLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine 2 | === PAUSE TestIsSummaryLine 3 | === CONT TestIsSummaryLine 4 | --- PASS: TestIsSummaryLine (0.00s) 5 | --- PASS: TestIsSummaryLine/BaseCase (0.00s) 6 | --- PASS: TestIsSummaryLine/NotSummary (0.00s) 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsSummaryLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine/BaseCase 2 | --- PASS: TestIsSummaryLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestIsSummaryLine/NotSummary.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine/NotSummary 2 | --- PASS: TestIsSummaryLine/NotSummary (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestPanicExample.log: -------------------------------------------------------------------------------- 1 | === RUN TestPanicExample 2 | --- FAIL: TestPanicExample (0.00s) 3 | integration_test.go:14: 4 | Error Trace: integration_test.go:14 5 | Error: Expected value not to be nil. 6 | Test: TestPanicExample 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestPeek.log: -------------------------------------------------------------------------------- 1 | === RUN TestPeek 2 | === PAUSE TestPeek 3 | === CONT TestPeek 4 | --- PASS: TestPeek (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestPeekEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestPeekEmpty 2 | === PAUSE TestPeekEmpty 3 | === CONT TestPeekEmpty 4 | --- PASS: TestPeekEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestRealWorldExample.log: -------------------------------------------------------------------------------- 1 | === RUN TestRealWorldExample 2 | --- FAIL: TestRealWorldExample (0.00s) 3 | integration_test.go:18: 4 | Error Trace: integration_test.go:18 5 | Error: Expected value not to be nil. 6 | Test: TestRealWorldExample 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestRemoveDedentedTestResultMarkers.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkers 2 | --- PASS: TestRemoveDedentedTestResultMarkers (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestRemoveDedentedTestResultMarkersAll.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkersAll 2 | --- PASS: TestRemoveDedentedTestResultMarkersAll (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestRemoveDedentedTestResultMarkersEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkersEmpty 2 | --- PASS: TestRemoveDedentedTestResultMarkersEmpty (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestStackPop.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPop 2 | === PAUSE TestStackPop 3 | === CONT TestStackPop 4 | --- PASS: TestStackPop (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestStackPopEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPopEmpty 2 | === PAUSE TestStackPopEmpty 3 | === CONT TestStackPopEmpty 4 | --- PASS: TestStackPopEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/failing_example_expected/TestStackPush.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPush 2 | === PAUSE TestStackPush 3 | === CONT TestStackPush 4 | --- PASS: TestStackPush (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/new_go_failing_example.log: -------------------------------------------------------------------------------- 1 | === RUN TestIntegrationBasicExample 2 | === PAUSE TestIntegrationBasicExample 3 | === RUN TestIntegrationFailingExample 4 | === PAUSE TestIntegrationFailingExample 5 | === RUN TestIntegrationPanicExample 6 | === PAUSE TestIntegrationPanicExample 7 | === CONT TestIntegrationBasicExample 8 | === CONT TestIntegrationPanicExample 9 | === CONT TestIntegrationFailingExample 10 | === CONT TestIntegrationBasicExample 11 | integration_test.go:57: 12 | Error Trace: integration_test.go:57 13 | Error: Should be true 14 | Test: TestIntegrationBasicExample 15 | --- PASS: TestIntegrationPanicExample (0.00s) 16 | --- PASS: TestIntegrationFailingExample (0.00s) 17 | --- FAIL: TestIntegrationBasicExample (0.00s) 18 | FAIL 19 | FAIL github.com/gruntwork-io/terratest/modules/logger/parser 1.589s 20 | FAIL 21 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/new_go_failing_example_expected/TestIntegrationBasicExample.log: -------------------------------------------------------------------------------- 1 | === RUN TestIntegrationBasicExample 2 | === PAUSE TestIntegrationBasicExample 3 | === CONT TestIntegrationBasicExample 4 | === CONT TestIntegrationBasicExample 5 | integration_test.go:57: 6 | Error Trace: integration_test.go:57 7 | Error: Should be true 8 | Test: TestIntegrationBasicExample 9 | --- FAIL: TestIntegrationBasicExample (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/new_go_failing_example_expected/TestIntegrationFailingExample.log: -------------------------------------------------------------------------------- 1 | === RUN TestIntegrationFailingExample 2 | === PAUSE TestIntegrationFailingExample 3 | === CONT TestIntegrationFailingExample 4 | --- PASS: TestIntegrationFailingExample (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/new_go_failing_example_expected/TestIntegrationPanicExample.log: -------------------------------------------------------------------------------- 1 | === RUN TestIntegrationPanicExample 2 | === PAUSE TestIntegrationPanicExample 3 | === CONT TestIntegrationPanicExample 4 | --- PASS: TestIntegrationPanicExample (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/new_go_failing_example_expected/report.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | integration_test.go:57: 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/new_go_failing_example_expected/summary.log: -------------------------------------------------------------------------------- 1 | --- PASS: TestIntegrationPanicExample (0.00s) 2 | --- PASS: TestIntegrationFailingExample (0.00s) 3 | --- FAIL: TestIntegrationBasicExample (0.00s) 4 | FAIL 5 | FAIL github.com/gruntwork-io/terratest/modules/logger/parser 1.589s 6 | FAIL 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestCloseChannelsClosesAll.log: -------------------------------------------------------------------------------- 1 | === RUN TestCloseChannelsClosesAll 2 | === PAUSE TestCloseChannelsClosesAll 3 | === CONT TestCloseChannelsClosesAll 4 | TestCloseChannelsClosesAll INFO 2018-10-20T13:03:19-07:00 Closing all the channels in log writer 5 | --- PASS: TestCloseChannelsClosesAll (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestEnsureDirectoryExistsCreatesDirectory.log: -------------------------------------------------------------------------------- 1 | === RUN TestEnsureDirectoryExistsCreatesDirectory 2 | === PAUSE TestEnsureDirectoryExistsCreatesDirectory 3 | === CONT TestEnsureDirectoryExistsCreatesDirectory 4 | TestEnsureDirectoryExistsCreatesDirectory INFO 2018-10-20T13:03:19-07:00 Creating directory /var/folders/n2/pljz6dq52bd1ksmw23qyr3sr0000gn/T/TestEnsureDirectoryCreatesDirectory601920052/tmpdir 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestEnsureDirectoryExistsHandlesExistingDirectory.log: -------------------------------------------------------------------------------- 1 | === RUN TestEnsureDirectoryExistsHandlesExistingDirectory 2 | === PAUSE TestEnsureDirectoryExistsHandlesExistingDirectory 3 | === CONT TestEnsureDirectoryExistsHandlesExistingDirectory 4 | TestEnsureDirectoryExistsHandlesExistingDirectory INFO 2018-10-20T13:03:19-07:00 Directory /var/folders/n2/pljz6dq52bd1ksmw23qyr3sr0000gn/T/TestEnsureDirectoryCreatesDirectory135329330 already exists 5 | --- PASS: TestEnsureDirectoryExistsHandlesExistingDirectory (0.00s) 6 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetIndent.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent 2 | === PAUSE TestGetIndent 3 | === CONT TestGetIndent 4 | --- PASS: TestGetIndent (0.00s) 5 | --- PASS: TestGetIndent/BaseCase (0.00s) 6 | --- PASS: TestGetIndent/NoIndent (0.00s) 7 | --- PASS: TestGetIndent/EmptyString (0.00s) 8 | --- PASS: TestGetIndent/Tabs (0.00s) 9 | --- PASS: TestGetIndent/MixTabSpace (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetIndent/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/BaseCase 2 | --- PASS: TestGetIndent/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetIndent/EmptyString.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/EmptyString 2 | --- PASS: TestGetIndent/EmptyString (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetIndent/MixTabSpace.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/MixTabSpace 2 | --- PASS: TestGetIndent/MixTabSpace (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetIndent/NoIndent.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/NoIndent 2 | --- PASS: TestGetIndent/NoIndent (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetIndent/Tabs.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetIndent/Tabs 2 | --- PASS: TestGetIndent/Tabs (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetOrCreateChannelCreatesNewChannel.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetOrCreateChannelCreatesNewChannel 2 | === PAUSE TestGetOrCreateChannelCreatesNewChannel 3 | === CONT TestGetOrCreateChannelCreatesNewChannel 4 | --- PASS: TestGetOrCreateChannelCreatesNewChannel (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetOrCreateChannelReturnsExistingChannel.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetOrCreateChannelReturnsExistingChannel 2 | === PAUSE TestGetOrCreateChannelReturnsExistingChannel 3 | === CONT TestGetOrCreateChannelReturnsExistingChannel 4 | --- PASS: TestGetOrCreateChannelReturnsExistingChannel (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine 2 | === PAUSE TestGetTestNameFromResultLine 3 | === CONT TestGetTestNameFromResultLine 4 | --- PASS: TestGetTestNameFromResultLine (0.00s) 5 | --- PASS: TestGetTestNameFromResultLine/BaseCase (0.00s) 6 | --- PASS: TestGetTestNameFromResultLine/Indented (0.00s) 7 | --- PASS: TestGetTestNameFromResultLine/SpecialChars (0.00s) 8 | --- PASS: TestGetTestNameFromResultLine/WhenFailed (0.00s) 9 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromResultLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/BaseCase 2 | --- PASS: TestGetTestNameFromResultLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromResultLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/Indented 2 | --- PASS: TestGetTestNameFromResultLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromResultLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/SpecialChars 2 | --- PASS: TestGetTestNameFromResultLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromResultLine/WhenFailed.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromResultLine/WhenFailed 2 | --- PASS: TestGetTestNameFromResultLine/WhenFailed (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine 2 | === PAUSE TestGetTestNameFromStatusLine 3 | === CONT TestGetTestNameFromStatusLine 4 | --- PASS: TestGetTestNameFromStatusLine (0.00s) 5 | --- PASS: TestGetTestNameFromStatusLine/BaseCase (0.00s) 6 | --- PASS: TestGetTestNameFromStatusLine/Indented (0.00s) 7 | --- PASS: TestGetTestNameFromStatusLine/SpecialChars (0.00s) 8 | --- PASS: TestGetTestNameFromStatusLine/WhenPaused (0.00s) 9 | --- PASS: TestGetTestNameFromStatusLine/WhenCont (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromStatusLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/BaseCase 2 | --- PASS: TestGetTestNameFromStatusLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromStatusLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/Indented 2 | --- PASS: TestGetTestNameFromStatusLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromStatusLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/SpecialChars 2 | --- PASS: TestGetTestNameFromStatusLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromStatusLine/WhenCont.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/WhenCont 2 | --- PASS: TestGetTestNameFromStatusLine/WhenCont (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestGetTestNameFromStatusLine/WhenPaused.log: -------------------------------------------------------------------------------- 1 | === RUN TestGetTestNameFromStatusLine/WhenPaused 2 | --- PASS: TestGetTestNameFromStatusLine/WhenPaused (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsEmpty 2 | === PAUSE TestIsEmpty 3 | === CONT TestIsEmpty 4 | --- PASS: TestIsEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsPanicLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine 2 | === PAUSE TestIsPanicLine 3 | === CONT TestIsPanicLine 4 | --- FAIL: TestIsPanicLine (0.00s) 5 | --- PASS: TestIsPanicLine/BaseCase (0.00s) 6 | --- PASS: TestIsPanicLine/NotPanic (0.00s) 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsPanicLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine/BaseCase 2 | --- PASS: TestIsPanicLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsPanicLine/NotPanic.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsPanicLine/NotPanic 2 | --- PASS: TestIsPanicLine/NotPanic (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine 2 | === PAUSE TestIsResultLine 3 | === CONT TestIsResultLine 4 | --- PASS: TestIsResultLine (0.00s) 5 | --- PASS: TestIsResultLine/BaseCase (0.00s) 6 | --- PASS: TestIsResultLine/Indented (0.00s) 7 | --- PASS: TestIsResultLine/SpecialChars (0.00s) 8 | --- PASS: TestIsResultLine/WhenFailed (0.00s) 9 | --- PASS: TestIsResultLine/NonResultLine (0.00s) 10 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsResultLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/BaseCase 2 | --- PASS: TestIsResultLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsResultLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/Indented 2 | --- PASS: TestIsResultLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsResultLine/NonResultLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/NonResultLine 2 | --- PASS: TestIsResultLine/NonResultLine (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsResultLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/SpecialChars 2 | --- PASS: TestIsResultLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsResultLine/WhenFailed.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsResultLine/WhenFailed 2 | --- PASS: TestIsResultLine/WhenFailed (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine 2 | === PAUSE TestIsStatusLine 3 | === CONT TestIsStatusLine 4 | --- PASS: TestIsStatusLine (0.00s) 5 | --- PASS: TestIsStatusLine/BaseCase (0.00s) 6 | --- PASS: TestIsStatusLine/Indented (0.00s) 7 | --- PASS: TestIsStatusLine/SpecialChars (0.00s) 8 | --- PASS: TestIsStatusLine/WhenPaused (0.00s) 9 | --- PASS: TestIsStatusLine/WhenCont (0.00s) 10 | --- PASS: TestIsStatusLine/NonStatusLine (0.00s) 11 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsStatusLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/BaseCase 2 | --- PASS: TestIsStatusLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsStatusLine/Indented.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/Indented 2 | --- PASS: TestIsStatusLine/Indented (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsStatusLine/NonStatusLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/NonStatusLine 2 | --- PASS: TestIsStatusLine/NonStatusLine (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsStatusLine/SpecialChars.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/SpecialChars 2 | --- PASS: TestIsStatusLine/SpecialChars (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsStatusLine/WhenCont.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/WhenCont 2 | --- PASS: TestIsStatusLine/WhenCont (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsStatusLine/WhenPaused.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsStatusLine/WhenPaused 2 | --- PASS: TestIsStatusLine/WhenPaused (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsSummaryLine.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine 2 | === PAUSE TestIsSummaryLine 3 | === CONT TestIsSummaryLine 4 | --- PASS: TestIsSummaryLine (0.00s) 5 | --- PASS: TestIsSummaryLine/BaseCase (0.00s) 6 | --- PASS: TestIsSummaryLine/NotSummary (0.00s) 7 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsSummaryLine/BaseCase.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine/BaseCase 2 | --- PASS: TestIsSummaryLine/BaseCase (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestIsSummaryLine/NotSummary.log: -------------------------------------------------------------------------------- 1 | === RUN TestIsSummaryLine/NotSummary 2 | --- PASS: TestIsSummaryLine/NotSummary (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestLogCollectorCreatesAndWritesToFile.log: -------------------------------------------------------------------------------- 1 | === RUN TestLogCollectorCreatesAndWritesToFile 2 | === PAUSE TestLogCollectorCreatesAndWritesToFile 3 | === CONT TestLogCollectorCreatesAndWritesToFile 4 | TestLogCollectorCreatesAndWritesToFile INFO 2018-10-20T13:03:19-07:00 Spawned log writer for test TestLogCollectorCreatesAndWritesToFile 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestPeek.log: -------------------------------------------------------------------------------- 1 | === RUN TestPeek 2 | === PAUSE TestPeek 3 | === CONT TestPeek 4 | --- PASS: TestPeek (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestPeekEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestPeekEmpty 2 | === PAUSE TestPeekEmpty 3 | === CONT TestPeekEmpty 4 | --- PASS: TestPeekEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestRemoveDedentedTestResultMarkers.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkers 2 | --- PASS: TestRemoveDedentedTestResultMarkers (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestRemoveDedentedTestResultMarkersAll.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkersAll 2 | --- PASS: TestRemoveDedentedTestResultMarkersAll (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestRemoveDedentedTestResultMarkersEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestRemoveDedentedTestResultMarkersEmpty 2 | --- PASS: TestRemoveDedentedTestResultMarkersEmpty (0.00s) 3 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestStackPop.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPop 2 | === PAUSE TestStackPop 3 | === CONT TestStackPop 4 | --- PASS: TestStackPop (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestStackPopEmpty.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPopEmpty 2 | === PAUSE TestStackPopEmpty 3 | === CONT TestStackPopEmpty 4 | --- PASS: TestStackPopEmpty (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/fixtures/panic_example_expected/TestStackPush.log: -------------------------------------------------------------------------------- 1 | === RUN TestStackPush 2 | === PAUSE TestStackPush 3 | === CONT TestStackPush 4 | --- PASS: TestStackPush (0.00s) 5 | -------------------------------------------------------------------------------- /modules/logger/parser/helpers_for_test.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "strings" 7 | "testing" 8 | "time" 9 | 10 | "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func NewTestLogger(t *testing.T) *logrus.Logger { 14 | logger := logrus.New() 15 | logger.SetFormatter(&LogTestFormatter{TestName: t.Name()}) 16 | return logger 17 | } 18 | 19 | type LogTestFormatter struct { 20 | TestName string 21 | } 22 | 23 | func (formatter *LogTestFormatter) Format(entry *logrus.Entry) ([]byte, error) { 24 | b := bytes.Buffer{} 25 | outStr := fmt.Sprintf( 26 | "%s %s %s %s\n", 27 | formatter.TestName, 28 | strings.ToUpper(entry.Level.String()), 29 | entry.Time.Format(time.RFC3339), 30 | entry.Message, 31 | ) 32 | b.WriteString(outStr) 33 | return b.Bytes(), nil 34 | } 35 | -------------------------------------------------------------------------------- /modules/shell/shell.go: -------------------------------------------------------------------------------- 1 | // Package shell allows to run commands in a shell. 2 | package shell 3 | -------------------------------------------------------------------------------- /modules/slack/doc.go: -------------------------------------------------------------------------------- 1 | // Package slack contains routines useful for testing slack integrations. 2 | package slack 3 | -------------------------------------------------------------------------------- /modules/ssh/key_pair_test.go: -------------------------------------------------------------------------------- 1 | package ssh 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | // Basic test to ensure we can successfully generate key pairs (no explicit validation for now) 10 | func TestGenerateRSAKeyPair(t *testing.T) { 11 | t.Parallel() 12 | 13 | keyPair := GenerateRSAKeyPair(t, 2048) 14 | assert.Contains(t, keyPair.PublicKey, "ssh-rsa") 15 | assert.Contains(t, keyPair.PrivateKey, "-----BEGIN RSA PRIVATE KEY-----") 16 | } 17 | -------------------------------------------------------------------------------- /modules/terraform/get.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/gruntwork-io/terratest/modules/testing" 5 | ) 6 | 7 | // Get calls terraform get and return stdout/stderr. 8 | func Get(t testing.TestingT, options *Options) string { 9 | out, err := GetE(t, options) 10 | if err != nil { 11 | t.Fatal(err) 12 | } 13 | return out 14 | } 15 | 16 | // GetE calls terraform get and return stdout/stderr. 17 | func GetE(t testing.TestingT, options *Options) (string, error) { 18 | return RunTerraformCommandE(t, options, prepend(options.ExtraArgs.Get, "get", "-update")...) 19 | } 20 | -------------------------------------------------------------------------------- /modules/terraform/terraform.go: -------------------------------------------------------------------------------- 1 | // Package terraform allows to interact with Terraform. 2 | package terraform 3 | 4 | // https://www.terraform.io/docs/commands/plan.html#detailed-exitcode 5 | 6 | // TerraformPlanChangesPresentExitCode is the exit code returned by terraform plan detailed exitcode when changes are present 7 | const TerraformPlanChangesPresentExitCode = 2 8 | 9 | // DefaultSuccessExitCode is the exit code returned when terraform command succeeds 10 | const DefaultSuccessExitCode = 0 11 | 12 | // DefaultErrorExitCode is the exit code returned when terraform command fails 13 | const DefaultErrorExitCode = 1 14 | -------------------------------------------------------------------------------- /modules/terraform/var.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | type Var interface { 4 | Args() []string 5 | internal() 6 | } 7 | 8 | func VarInline(name string, value interface{}) Var { 9 | return varInline{name: name, value: value} 10 | } 11 | 12 | type varInline struct { 13 | name string 14 | value interface{} 15 | } 16 | 17 | func (vi varInline) Args() []string { 18 | m := map[string]interface{}{vi.name: vi.value} 19 | return formatTerraformArgs(m, "-var", true, false) 20 | } 21 | func (vi varInline) internal() {} 22 | 23 | func VarFile(path string) Var { 24 | return varFile(path) 25 | } 26 | 27 | type varFile string 28 | 29 | func (vf varFile) Args() []string { 30 | return []string{"-var-file", string(vf)} 31 | } 32 | func (vi varFile) internal() {} 33 | -------------------------------------------------------------------------------- /modules/version-checker/errors.go: -------------------------------------------------------------------------------- 1 | package version_checker 2 | 3 | // VersionMismatchErr is an error to indicate version mismatch. 4 | type VersionMismatchErr struct { 5 | errorMessage string 6 | } 7 | 8 | func (r *VersionMismatchErr) Error() string { 9 | return r.errorMessage 10 | } 11 | -------------------------------------------------------------------------------- /test-docker-images/gruntwork-amazon-linux-test/README.md: -------------------------------------------------------------------------------- 1 | # Gruntwork Amazon-Linux-Test Docker Image 2 | 3 | The purpose of this Docker image is to provide a pre-built Amazon Linux Docker image that has most of the libraries 4 | we would expect to be installed on the Amazon Linux AMI that would run in AWS. For example, we'd expect `sudo` in AWS, 5 | but it doesn't exist by default in Docker `amazonlinux:latest`. 6 | 7 | ### Building and Pushing a New Docker Image to Docker Hub 8 | 9 | This Docker image should publicly accessible via Docker Hub at https://hub.docker.com/r/gruntwork/amazonlinux-test/. To build and 10 | upload it: 11 | 12 | 1. `docker build -t gruntwork/amazon-linux-test:2017.12 .` 13 | 1. `docker push gruntwork/amazon-linux-test:2017.12` 14 | 15 | -------------------------------------------------------------------------------- /test-docker-images/gruntwork-ubuntu-test/README.md: -------------------------------------------------------------------------------- 1 | # Gruntwork Ubuntu-Test Docker Image 2 | 3 | The purpose of this Docker image is to provide a pre-built Ubuntu 18.04 Docker image that has most of the libraries 4 | we would expect to be installed on the Ubuntu 18.04 AMI that would run in AWS. For example, we'd expect `curl` in AWS, 5 | but it doesn't exist by default in Docker `ubuntu:18.04`. 6 | 7 | ### Building and Pushing a New Docker Image to Docker Hub 8 | 9 | This Docker image should publicly accessible via Docker Hub at https://hub.docker.com/r/gruntwork/ubuntu-test/. To build and 10 | upload it: 11 | 12 | 1. `docker build -t gruntwork/ubuntu-test:18.04 .` 13 | 1. `docker push gruntwork/ubuntu-test:18.04` 14 | 15 | -------------------------------------------------------------------------------- /test-docker-images/moto/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | # Reduce Docker image size per https://blog.replicated.com/refactoring-a-dockerfile-for-image-size/ 4 | RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install --no-install-recommends -y \ 5 | python-pip && \ 6 | rm -rf /var/lib/apt/lists/* && \ 7 | pip install --upgrade pip && \ 8 | pip install --upgrade setuptools && \ 9 | pip install --upgrade flask && \ 10 | pip install --upgrade pyOpenSSL && \ 11 | pip install --upgrade moto -------------------------------------------------------------------------------- /test/docker_hello_world_example_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/gruntwork-io/terratest/modules/docker" 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestDockerHelloWorldExample(t *testing.T) { 11 | // website::tag::1:: Configure the tag to use on the Docker image. 12 | tag := "gruntwork/docker-hello-world-example" 13 | buildOptions := &docker.BuildOptions{ 14 | Tags: []string{tag}, 15 | } 16 | 17 | // website::tag::2:: Build the Docker image. 18 | docker.Build(t, "../examples/docker-hello-world-example", buildOptions) 19 | 20 | // website::tag::3:: Run the Docker image, read the text file from it, and make sure it contains the expected output. 21 | opts := &docker.RunOptions{Command: []string{"cat", "/test.txt"}} 22 | output := docker.Run(t, tag, opts) 23 | assert.Equal(t, "Hello, World!", output) 24 | } 25 | -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/full-copy/.hidden-file.txt: -------------------------------------------------------------------------------- 1 | hidden -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/full-copy/.terraform-version: -------------------------------------------------------------------------------- 1 | 0.15.5 -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/full-copy/foo.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/full-copy/subfolder/.hidden-folder/baz.txt: -------------------------------------------------------------------------------- 1 | baz -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/full-copy/subfolder/bar.txt: -------------------------------------------------------------------------------- 1 | bar -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/no-hidden-files-no-terraform-files/.terraform-version: -------------------------------------------------------------------------------- 1 | 0.15.5 -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/no-hidden-files-no-terraform-files/foo.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/no-hidden-files-no-terraform-files/subfolder/bar.txt: -------------------------------------------------------------------------------- 1 | bar -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/no-hidden-files/foo.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/no-hidden-files/subfolder/bar.txt: -------------------------------------------------------------------------------- 1 | bar -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/no-state-files/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | locals { 2 | foo = "bar" 3 | } -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/original/.hidden-file.txt: -------------------------------------------------------------------------------- 1 | hidden -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/original/.terraform-version: -------------------------------------------------------------------------------- 1 | 0.15.5 -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/original/foo.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/original/subfolder/.hidden-folder/baz.txt: -------------------------------------------------------------------------------- 1 | baz -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/original/subfolder/bar.txt: -------------------------------------------------------------------------------- 1 | bar -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/symlinks-broken/foo.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/symlinks-broken/subfolder/bar.txt: -------------------------------------------------------------------------------- 1 | bar -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/symlinks/bar.txt: -------------------------------------------------------------------------------- 1 | subfolder/bar.txt -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/symlinks/foo.txt: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/symlinks/subfolder/bar.txt: -------------------------------------------------------------------------------- 1 | bar -------------------------------------------------------------------------------- /test/fixtures/copy-folder-contents/terragrunt-files/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | locals { 2 | foo = "bar" 3 | } -------------------------------------------------------------------------------- /test/fixtures/docker-compose-with-buildkit/Dockerfile: -------------------------------------------------------------------------------- 1 | # A "Hello, World" Docker image used in automated tests for the docker.Build command. 2 | FROM ubuntu:20.04 as with-secrets 3 | 4 | RUN --mount=type=secret,id=github-token echo "$(cat /run/secrets/github-token)" > text.txt 5 | COPY ./bash_script.sh /usr/local/bin/bash_script.sh -------------------------------------------------------------------------------- /test/fixtures/docker-compose-with-buildkit/bash_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cat text.txt 5 | -------------------------------------------------------------------------------- /test/fixtures/docker-compose-with-buildkit/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | test-docker-image: 3 | build: 4 | context: . 5 | secrets: 6 | - github-token 7 | entrypoint: bash_script.sh 8 | 9 | secrets: 10 | github-token: 11 | environment: GITHUB_OAUTH_TOKEN -------------------------------------------------------------------------------- /test/fixtures/docker-compose-with-custom-project-name/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | test-docker-image: 3 | image: busybox 4 | -------------------------------------------------------------------------------- /test/fixtures/docker-with-buildkit/Dockerfile: -------------------------------------------------------------------------------- 1 | # A "Hello, World" Docker image used in automated tests for the docker.Build command. 2 | FROM ubuntu:20.04 as with-secrets 3 | 4 | RUN --mount=type=secret,id=github-token echo "$(cat /run/secrets/github-token)" > text.txt 5 | CMD ["cat", "text.txt"] -------------------------------------------------------------------------------- /test/fixtures/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # A "Hello, World" Docker image used in automated tests for the docker.Build command. 2 | FROM alpine:3.7 as step1 3 | ARG text1 4 | RUN echo $text1 > text.txt 5 | CMD ["cat", "text.txt"] 6 | 7 | FROM step1 8 | ARG text 9 | RUN echo $text > text.txt 10 | CMD ["cat", "text.txt"] -------------------------------------------------------------------------------- /test/fixtures/helm/keda-values.yaml: -------------------------------------------------------------------------------- 1 | metricsServer: 2 | replicaCount: 3 3 | operator: 4 | name: keda-operator 5 | replicaCount: 3 6 | podAnnotations: 7 | keda: 8 | sidecar.istio.io/inject: "false" 9 | metricsAdapter: 10 | sidecar.istio.io/inject: "false" 11 | podDisruptionBudget: 12 | metricServer: 13 | minAvailable: 1 14 | operator: 15 | minAvailable: 1 16 | resources: 17 | metricServer: 18 | limits: 19 | cpu: 100m 20 | memory: 1234Mi 21 | requests: 22 | cpu: 50m 23 | memory: 128Mi 24 | operator: 25 | limits: 26 | cpu: 100m 27 | memory: 1111Mi 28 | requests: 29 | cpu: 50m 30 | memory: 888Mi 31 | -------------------------------------------------------------------------------- /test/fixtures/terraform-backend/backend.hcl: -------------------------------------------------------------------------------- 1 | path="backend.tfstate" -------------------------------------------------------------------------------- /test/fixtures/terraform-backend/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | backend "local" {} 3 | } 4 | 5 | output "test" { 6 | value = "Hello, World" 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/terraform-basic-configuration/main.tf: -------------------------------------------------------------------------------- 1 | variable "cnt" {} 2 | 3 | resource "null_resource" "test" { 4 | count = var.cnt 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/terraform-no-error/main.tf: -------------------------------------------------------------------------------- 1 | output "test" { 2 | value = "Hello, World" 3 | } -------------------------------------------------------------------------------- /test/fixtures/terraform-not-idempotent/main.tf: -------------------------------------------------------------------------------- 1 | resource "null_resource" "test" { 2 | triggers = { 3 | time = timestamp() 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/terraform-null/main.tf: -------------------------------------------------------------------------------- 1 | variable "foo" { 2 | type = object({ 3 | nullable_string = string 4 | nonnullable_string = string 5 | }) 6 | } 7 | 8 | output "foo" { 9 | value = var.foo 10 | } 11 | 12 | output "bar" { 13 | value = var.foo.nullable_string == null ? "I AM NULL" : null 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/terraform-output-all/output.tf: -------------------------------------------------------------------------------- 1 | output "stars" { 2 | value = [ 3 | "Sirius", 4 | "Rigel", 5 | "Betelgeuse", 6 | ] 7 | } 8 | 9 | output "our_star" { 10 | value = "Sun" 11 | } 12 | 13 | output "constellations" { 14 | value = { 15 | Gemini = "Pollux", 16 | Scorpio = "Antares", 17 | Taurus = "Aldebaran", 18 | Virgo = "Spica", 19 | } 20 | } 21 | 22 | output "magnitudes" { 23 | value = { 24 | Sirius = -1.46, 25 | Canopus = -0.72, 26 | Antares = 0.96, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/fixtures/terraform-output-list/output.tf: -------------------------------------------------------------------------------- 1 | output "giant_steps" { 2 | value = [ 3 | "John Coltrane", 4 | "Tommy Flanagan", 5 | "Paul Chambers", 6 | "Art Taylor", 7 | ] 8 | } 9 | 10 | output "not_a_list" { 11 | value = "This is not a list." 12 | } 13 | -------------------------------------------------------------------------------- /test/fixtures/terraform-output-listofobjects/output.tf: -------------------------------------------------------------------------------- 1 | output "list_of_maps" { 2 | value = [ 3 | { 4 | one = 1 5 | two = "two" 6 | three = "three" 7 | more = { 8 | four = 4 9 | five = "five" 10 | } 11 | }, 12 | { 13 | one = "one" 14 | two = 2 15 | three = 3 16 | more = [{ 17 | four = 4 18 | five = "five" 19 | }] 20 | }, 21 | { 22 | one = "one" 23 | two = 2 24 | three = 3 25 | more = ["one", 2.0, 3.4, ["one", 2.0, 3.4], { "one" : 2.0, "three" : 3.4 }] 26 | } 27 | ] 28 | } 29 | 30 | output "not_list_of_maps" { 31 | value = "Just a string" 32 | } 33 | -------------------------------------------------------------------------------- /test/fixtures/terraform-output-map/output.tf: -------------------------------------------------------------------------------- 1 | output "mogwai" { 2 | value = { 3 | guitar_1 = "Stuart Braithwaite" 4 | guitar_2 = "Barry Burns" 5 | bass = "Dominic Aitchison" 6 | drums = "Martin Bulloch" 7 | } 8 | } 9 | 10 | output "not_a_map" { 11 | value = "This is not a map." 12 | } 13 | 14 | output "not_a_map_unicode" { 15 | value = "söme chäräcter" 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/terraform-output-mapofobjects/output.tf: -------------------------------------------------------------------------------- 1 | output "map_of_objects" { 2 | value = { 3 | somebool = true 4 | somefloat = 1.1 5 | one = 1 6 | two = "two" 7 | three = "three" 8 | nest = { 9 | four = 4 10 | five = "five" 11 | } 12 | nest_list = [ 13 | { 14 | six = 6 15 | seven = "seven" 16 | }, 17 | ] 18 | } 19 | } 20 | 21 | output "not_map_of_objects" { 22 | value = "Just a string" 23 | } 24 | -------------------------------------------------------------------------------- /test/fixtures/terraform-output-struct/output.tf: -------------------------------------------------------------------------------- 1 | output "object" { 2 | value = { 3 | somebool = true 4 | somefloat = 0.1 5 | someint = 1 6 | somestring = "two" 7 | somemap = { 8 | three = 3 9 | four = "four" 10 | }, 11 | listmaps = [ 12 | { 13 | five = 5 14 | six = "six" 15 | }, 16 | ] 17 | liststrings = [ 18 | "seven", 19 | "eight", 20 | "nine", 21 | ] 22 | } 23 | } 24 | 25 | output "list_of_objects" { 26 | value = [ 27 | { 28 | somebool = true 29 | somefloat = 0.1 30 | someint = 1 31 | somestring = "two" 32 | }, 33 | { 34 | somebool = false 35 | somefloat = 0.3 36 | someint = 4 37 | somestring = "five" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /test/fixtures/terraform-output/output.tf: -------------------------------------------------------------------------------- 1 | output "bool" { 2 | value = true 3 | } 4 | 5 | output "string" { 6 | value = "This is a string." 7 | } 8 | 9 | output "number" { 10 | value = 3.14 11 | } 12 | 13 | output "number1" { 14 | value = 3 15 | } 16 | 17 | output "unicode_string" { 18 | value = "söme chäräcter" 19 | } 20 | -------------------------------------------------------------------------------- /test/fixtures/terraform-parallelism/main.tf: -------------------------------------------------------------------------------- 1 | # This resource just waits for 5 seconds. If we run it with enough parallelism, the whole module should apply in about 2 | # 5 seconds. If we set parallelism to 1, it should take at least 25 seconds. 3 | resource "null_resource" "wait" { 4 | count = 5 5 | 6 | triggers = { 7 | run_always = timestamp() 8 | } 9 | 10 | provisioner "local-exec" { 11 | command = "sleep 5" 12 | } 13 | } -------------------------------------------------------------------------------- /test/fixtures/terraform-validation-valid/main.tf: -------------------------------------------------------------------------------- 1 | # This is a test resource that echoes the message specified by var.message 2 | resource "null_resource" "greet" { 3 | count = 5 4 | 5 | triggers = { 6 | run_always = timestamp() 7 | } 8 | 9 | provisioner "local-exec" { 10 | command = "echo ${var.message}" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/fixtures/terraform-validation-valid/outputs.tf: -------------------------------------------------------------------------------- 1 | output "message" { 2 | value = var.message 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/terraform-validation-valid/vars.tf: -------------------------------------------------------------------------------- 1 | variable "message" { 2 | type = string 3 | default = "Hello, World" 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/terraform-with-error/main.tf: -------------------------------------------------------------------------------- 1 | resource "null_resource" "fail_on_first_run" { 2 | provisioner "local-exec" { 3 | command = "if [[ -f terraform.tfstate.backup ]]; then echo 'This is not the first run, so exiting successfully' && exit 0; else echo 'This is the first run, exiting with an error' && exit 1; fi" 4 | interpreter = ["/bin/bash", "-c"] 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixtures/terraform-with-plan-error/main.tf: -------------------------------------------------------------------------------- 1 | output "test" { 2 | value = var.test 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/terraform-with-warning/main.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | validation = { 4 | source = "tlkamp/validation" 5 | version = "1.1.1" 6 | } 7 | null = { 8 | source = "hashicorp/null" 9 | version = "3.2.2" 10 | } 11 | } 12 | } 13 | 14 | # this data source will produce warning when `condition` is evaluated to `true` 15 | data "validation_warning" "warn" { 16 | for_each = toset([for i in range(10) : format("%02d", i)]) 17 | condition = true 18 | summary = "lorem ipsum ${each.value}" 19 | details = "lorem ipsum dolor sit amet" 20 | } 21 | 22 | resource "null_resource" "empty" {} 23 | -------------------------------------------------------------------------------- /test/fixtures/terraform-workspace/main.tf: -------------------------------------------------------------------------------- 1 | output "test" { 2 | value = "Hello, ${terraform.workspace}" 3 | } -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-multi-plan/bar/main.tf: -------------------------------------------------------------------------------- 1 | output "test" { 2 | value = "foo" 3 | } -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-multi-plan/bar/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Empty -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-multi-plan/bar/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | terraform { 2 | source = "..//bar" 3 | extra_arguments "common_vars" { 4 | commands = get_terraform_commands_that_need_vars() 5 | arguments = [ 6 | "-var-file=terraform.tfvars" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-multi-plan/foo/main.tf: -------------------------------------------------------------------------------- 1 | output "test" { 2 | value = "foo" 3 | } -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-multi-plan/foo/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Empty -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-multi-plan/foo/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | terraform { 2 | source = "..//foo" 3 | extra_arguments "common_vars" { 4 | commands = get_terraform_commands_that_need_vars() 5 | arguments = [ 6 | "-var-file=terraform.tfvars" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-no-error/main.tf: -------------------------------------------------------------------------------- 1 | output "test" { 2 | value = "Hello, World" 3 | } -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-no-error/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Empty -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-no-error/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | terraform { 2 | source = "..//terragrunt-no-error" 3 | extra_arguments "common_vars" { 4 | commands = get_terraform_commands_that_need_vars() 5 | arguments = [ 6 | "-var-file=terraform.tfvars" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-output/main.tf: -------------------------------------------------------------------------------- 1 | output "str" { 2 | value = "str" 3 | } 4 | 5 | output "list" { 6 | value = ["a", "b", "c"] 7 | } 8 | 9 | output "map" { 10 | value = { foo = "bar" } 11 | } -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-output/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Empty -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-output/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | terraform { 2 | # Intentionally empty 3 | } -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-with-error/main.tf: -------------------------------------------------------------------------------- 1 | resource "null_resource" "fail_on_first_run" { 2 | provisioner "local-exec" { 3 | command = "if [[ -f terraform.tfstate.backup ]]; then echo 'This is not the first run, so exiting successfully' && exit 0; else echo 'This is the first run, exiting with an error' && exit 1; fi" 4 | interpreter = ["/bin/bash", "-c"] 5 | } 6 | } -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-with-error/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Empty -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-with-error/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | terraform { 2 | source = "..//terragrunt-with-error" 3 | extra_arguments "common_vars" { 4 | commands = get_terraform_commands_that_need_vars() 5 | arguments = [ 6 | "-var-file=terraform.tfvars" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-with-plan-error/main.tf: -------------------------------------------------------------------------------- 1 | output "test" { 2 | value = var.test 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-with-plan-error/terraform.tfvars: -------------------------------------------------------------------------------- 1 | # Empty 2 | -------------------------------------------------------------------------------- /test/fixtures/terragrunt/terragrunt-with-plan-error/terragrunt.hcl: -------------------------------------------------------------------------------- 1 | terraform { 2 | source = "..//terraform-with-plan-error" 3 | extra_arguments "common_vars" { 4 | commands = get_terraform_commands_that_need_vars() 5 | arguments = [ 6 | "-var-file=terraform.tfvars" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/terraform_unit_null_test.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/gruntwork-io/terratest/modules/terraform" 7 | "github.com/magiconair/properties/assert" 8 | ) 9 | 10 | func TestUnitNullInput(t *testing.T) { 11 | t.Parallel() 12 | 13 | foo := map[string]interface{}{ 14 | "nullable_string": nil, 15 | "nonnullable_string": "foo", 16 | } 17 | options := &terraform.Options{ 18 | TerraformDir: "./fixtures/terraform-null", 19 | Vars: map[string]interface{}{"foo": foo}, 20 | } 21 | terraform.InitAndApply(t, options) 22 | 23 | fooOut := terraform.OutputMap(t, options, "foo") 24 | assert.Equal(t, fooOut, map[string]string{"nonnullable_string": "foo", "nullable_string": ""}) 25 | 26 | barOut := terraform.Output(t, options, "bar") 27 | assert.Equal(t, barOut, "I AM NULL") 28 | } 29 | --------------------------------------------------------------------------------