From 7b9a0491ca60f606b4dc39d25d8355c0953b100e Mon Sep 17 00:00:00 2001 From: Freddy Tan Date: Fri, 18 Nov 2016 17:08:10 +0800 Subject: [PATCH] 1. remove aws case 2. update travis method --- .travis.yml | 4 +++- test/aws_tf/test.tf | 13 ------------- test/test_terraform.py | 6 ++---- 3 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 test/aws_tf/test.tf diff --git a/.travis.yml b/.travis.yml index 44f09e4..28d4bc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,9 @@ before_script: - 'unzip terraform_0.7.11_linux_amd64.zip -d terraform' - 'sudo ln -s $PWD/terraform/terraform /usr/local/terraform' -install: "pip install -r test/requirements.txt" +install: + - "pip install -r test/requirements.txt" + - "pip install ." # command to run tests script: - cd test diff --git a/test/aws_tf/test.tf b/test/aws_tf/test.tf deleted file mode 100644 index 1e79483..0000000 --- a/test/aws_tf/test.tf +++ /dev/null @@ -1,13 +0,0 @@ -variable "access_key" {} -variable "secret_key" {} - -provider "aws" { - access_key = "${var.access_key}" - secret_key = "${var.secret_key}" - region = "us-west-2" -} - -resource "aws_instance" "ubuntu-1404" { - ami = "ami-9abea4fb" - instance_type = "t2.micro" -} \ No newline at end of file diff --git a/test/test_terraform.py b/test/test_terraform.py index 5ad0d15..848b437 100644 --- a/test/test_terraform.py +++ b/test/test_terraform.py @@ -6,8 +6,6 @@ import re logging.basicConfig(level=logging.DEBUG) -ACCESS_KEY = os.environ['PACKER_access_key'] -SECRET_KEY = os.environ['PACKER_secret_key'] STRING_CASES = [ [ @@ -29,8 +27,8 @@ CMD_CASES = [ ['method', 'expected_output'], [ [ - lambda x: x.cmd('plan', 'aws_tf', no_color='', var={'access_key': ACCESS_KEY, 'secret_key': SECRET_KEY}) , - 'Plan: 1 to add, 0 to change, 0 to destroy' + lambda x: x.cmd('plan', 'apply_tf', no_color='', var={'test_var': 'test'}) , + "doesn't need to do anything" ] ] ]