Skip to content

Commit 02a797e

Browse files
committed
tests: stop using stacker_blueprints in functional tests
1 parent b43492e commit 02a797e

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
AWSTemplateFormatVersion: 2010-09-09
2+
Resources:
3+
Bucket:
4+
Type: AWS::S3::Bucket
5+
Properties:
6+
BucketName: {{ variables.BucketName }}
7+
AccessControl: Private
8+
Outputs:
9+
BucketName:
10+
Value: !Ref Bucket

tests/test_suite/34_stacker_build-integrated-hooks.bats

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ load ../test_helper
1212
needs_aws
1313

1414
config() {
15-
echo "namespace: ${STACKER_NAMESPACE}"
15+
echo "namespace: ${STACKER_NAMESPACE}-integrated-hooks"
1616
cat <<'EOF'
1717
stacks:
18-
- name: buckets
18+
- name: bucket
1919
profile: stacker
20-
class_path: stacker_blueprints.s3.Buckets
20+
template_path: fixtures/blueprints/bucket.yaml.j2
2121
variables:
22-
Buckets:
23-
StackerTestBucket:
24-
BucketName: "stacker-${envvar STACKER_NAMESPACE}-integrated-hooks-${awsparam AccountId}"
22+
BucketName: "stacker-${envvar STACKER_NAMESPACE}-integrated-hooks-${awsparam AccountId}"
2523
2624
build_hooks:
2725
- name: write-hello
@@ -38,7 +36,7 @@ build_hooks:
3836
command: 'aws s3 cp /tmp/hello.txt "s3://$BUCKET/hello.txt"'
3937
shell: true
4038
env:
41-
BUCKET: "${output buckets::StackerTestBucketBucketId}"
39+
BUCKET: "${output bucket::BucketName}"
4240
AWS_PROFILE: stacker
4341
4442
- name: send-world
@@ -49,7 +47,7 @@ build_hooks:
4947
command: 'aws s3 cp "s3://$BUCKET/hello.txt" "s3://$BUCKET/world.txt"'
5048
shell: true
5149
env:
52-
BUCKET: "${output buckets::StackerTestBucketBucketId}"
50+
BUCKET: "${output bucket::BucketName}"
5351
AWS_PROFILE: stacker
5452
5553
destroy_hooks:
@@ -59,7 +57,7 @@ destroy_hooks:
5957
command: 'aws s3 rm "s3://$BUCKET/world.txt"'
6058
shell: true
6159
env:
62-
BUCKET: "${output buckets::StackerTestBucketBucketId}"
60+
BUCKET: "${output bucket::BucketName}"
6361
AWS_PROFILE: stacker
6462
6563
- name: remove-hello
@@ -70,13 +68,13 @@ destroy_hooks:
7068
command: 'aws s3 rm "s3://$BUCKET/hello.txt"'
7169
shell: true
7270
env:
73-
BUCKET: "${output buckets::StackerTestBucketBucketId}"
71+
BUCKET: "${output bucket::BucketName}"
7472
AWS_PROFILE: stacker
7573
7674
- name: clean-hello
7775
path: stacker.hooks.command.run_command
7876
required_by:
79-
- buckets
77+
- bucket
8078
args:
8179
command: [rm, -f, /tmp/hello.txt]
8280
EOF
@@ -86,14 +84,14 @@ EOF
8684
stacker destroy --force <(config)
8785
}
8886

89-
stacker build <(config)
87+
stacker build -t --recreate-failed <(config)
9088
assert "$status" -eq 0
9189
assert_has_line "Using default AWS provider mode"
9290
assert_has_lines_in_order -E <<'EOF'
9391
pre_build_hooks: complete
9492
write-hello: complete
95-
buckets: submitted \(creating new stack\)
96-
buckets: complete \(creating new stack\)
93+
bucket: submitted \(creating new stack\)
94+
bucket: complete \(creating new stack\)
9795
upload: [^ ]*/hello.txt to s3://[^ ]*/hello.txt
9896
send-hello: complete
9997
copy: s3://[^ ]*/hello.txt to s3://[^ ]*/world.txt
@@ -110,8 +108,8 @@ delete: s3://[^ ]*/world.txt
110108
remove-world: complete
111109
delete: s3://[^ ]*/hello.txt
112110
remove-hello: complete
113-
buckets: submitted \(submitted for destruction\)
114-
buckets: complete \(stack destroyed\)
111+
bucket: submitted \(submitted for destruction\)
112+
bucket: complete \(stack destroyed\)
115113
clean-hello: complete
116114
post_destroy_hooks: complete
117115
EOF
@@ -125,7 +123,7 @@ EOF
125123
pre_destroy_hooks: complete
126124
remove-world: skipped
127125
remove-hello: skipped
128-
buckets: skipped
126+
bucket: skipped
129127
clean-hello: complete
130128
post_destroy_hooks: complete
131129
EOF

0 commit comments

Comments
 (0)