Giter VIP home page Giter VIP logo

testing-terraform-with-actions's Introduction

Testing Infrastructure Code with GitHub Actions and Terratest

This repository is an example of testing IaC libraries written with Terraform using GitHub Actions. For a detailed run-through, see the see accompanying blog post Automate Terraform Testing with GitHub Actions and Terratest.

Prerequisites

To successfully run all the examples, you need the following tools:

Running the tests

Note that to run the tests, you will have to have AWS Credentials available for Terraform.

Unit tests

As the unit tests don't create any resources, they're safe to run as is. Check out the terratest unit test file for details.

To run the unit tests, go to the test directory and run go test -v -tags=unit.

Integration tests

Integration test creates actual resources in AWS, so you will first have to set up your AWS Credentials. Once that's done, you can run go test -v -tags=integration. Check out the terratest integration test file for details.

Prettier test output

Go test output can sometimes be hard to read. A good tool to get human readable output is gotestsum. Instead of the very verbose output, you get something like this:

❯ gotestsum --format short-verbose -- -tags=unit
PASS TestStaticSiteValidity (12.63s)
PASS .
DONE 1 tests in 15.416s

Useful links

Tools used in this repository

Developing Modules and Infrastructure as Code

GitHub Actions for installing Terraform and Terragrunt

Other utilities

testing-terraform-with-actions's People

Contributors

autero1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.