Code Monkey home page Code Monkey logo

localstack-terraform-test's Introduction

Terraform vs LocalStack

This repository contains scripts and CI configurations to to run the Terraform Acceptance test suite of the AWS provider against LocalStack

Utilities

Some utilities for local development:

  • bin/list-tests [--all]: list the available tests by parsing the go test files.
  • bin/install-aws-test creates the binary for running the test suite (and installs it into $HOME/.cache/localstack/aws.test. requires go 1.16
  • bin/run-tests [test] run a specific test. this installs and runs localstack in a background process. add the flag -t to test against an already running localstack instance.

Finding and running tests

After running bin/install-aws-test, use bin/run-tests [OPTIONS...] [TESTS...] to run individual tests or entire test suites.

Here are some examples:

  • bin/run-tests TestAccAWSAPIGatewayResource
  • bin/run-tests -t TestAccAWSAPIGatewayResource: same as above, but does not start localstack
  • bin/run-tests TestAccAWSAPIGateway: runs all tests that match TestAccAWSAPIGateway (run bin/list-tests TestAccAWSAPIGateway to see which ones will be executed)
  • bin/run-tests -e TestAccAWSAPIGatewayV2 TestAccAWSAPIGateway: same as above, but excludes all tests that match TestAccAWSAPIGatewayV2.
  • bin/run-tests -i localstack-tests.incl.txt: runs all tests listed in the text file

You can use bin/list-tests with the same parameters to see which tests will be executed, or to find specific tests based on patterns.

For example:

 % bin/list-tests Queue
TestAccAWSBatchJobQueue
TestAccAWSGameliftGameSessionQueue
TestAccAWSMediaConvertQueue
TestAccAWSSQSQueue
TestAccAWSSQSQueuePolicy
TestAccDataSourceAwsBatchJobQueue
TestAccDataSourceAwsSqsQueue

or

 % bin/list-tests "Data.*Queue"
TestAccDataSourceAwsBatchJobQueue
TestAccDataSourceAwsSqsQueue

Generating the test reports

Test logs are aggregated into build/tests/*.log, the command bin/create-report will create junit-like xml reports. These can then be rendered into html using bin/create-report-html, which also creates a summary page in build/report.html. For rendering html, you need junit2html.

Travis config

Build cache

The Travis-CI worker caches the built aws.test binary across builds. The first build may therefore take a while.

localstack-terraform-test's People

Contributors

bblommers avatar thrau avatar whummer 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.