Skip to content

Commit

Permalink
[Resolve Sceptre#272] Enable intergration tests in generic AWS accoun…
Browse files Browse the repository at this point in the history
…ts (Sceptre#281)
  • Loading branch information
theseanything authored Dec 8, 2017
1 parent 7e018e8 commit a61bb6e
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 51 deletions.
13 changes: 11 additions & 2 deletions integration-tests/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ def before_all(context):
context.project_code = "sceptre-integration-tests-{0}".format(
context.uuid
)
context.bucket_name = "sceptre-integration-tests-templates"

if not os.environ.get("CIRCLECI"):
context.bucket_name = context.bucket_name + "-" + str(context.uuid)

context.sceptre_dir = os.path.join(
os.getcwd(), "integration-tests", "sceptre-project"
)
update_project_code(context)
update_config(context)
context.cloudformation = boto3.resource('cloudformation')
context.client = boto3.client("cloudformation")

Expand All @@ -24,13 +29,14 @@ def before_scenario(context, scenario):
context.output = None


def update_project_code(context):
def update_config(context):
config_path = os.path.join(
context.sceptre_dir, "config", "config.yaml"
)
with open(config_path) as config_file:
env_config = yaml.safe_load(config_file)

env_config["template_bucket_name"] = context.bucket_name
env_config["project_code"] = context.project_code

with open(config_path, 'w') as config_file:
Expand All @@ -45,3 +51,6 @@ def after_all(context):
context.client.delete_stack(
StackName=stack["StackName"]
)
context.project_code = "sceptre-integration-tests"
context.bucket_name = "sceptre-integration-tests-templates"
update_config(context)
3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/1/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/2/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/3/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/4/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/5/1/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/5/2/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/5/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/6/1/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/6/2/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/6/3/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/6/4/1/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/6/4/2/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/6/4/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/6/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/7/config.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions integration-tests/sceptre-project/config/8/config.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion integration-tests/sceptre-project/config/config.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
project_code: sceptre-integration-tests-941d57d4a9df11e7956dacbc328d8bb1
project_code: sceptre-integration-tests
region: eu-west-1
template_bucket_name: sceptre-integration-tests-templates

0 comments on commit a61bb6e

Please sign in to comment.