Closed avozicov closed 6 years ago
@eistrati @avozicov from the terraform module we do not have access to the e2e params, how can we workaround this?
ec2:
root: './ec2'
terraform:
version: 0.10.0
plan: false
apply: false
destroy: true
test:
plan: './ec2/tests/'
apply: './ec2/tests/'
browsers: <= something like this?
- firefox --headless <= something like this?
@ddimitrioglo as discussed this morning, we agreed on the following setup:
---
$:
preprocess:
'$.terraform.vars.access_key': 'eval'
'$.terraform.vars.secret_key': 'eval'
'$.terraform.vars.region': 'eval'
emit:
pattern:
- /.+\.js.*$/i
ignore:
- /^(.*\/)?node_modules(\/?$)?/i
terraform:
resource: '.resource'
use-cache: false
save-show-output: tfshow.txt
vars:
access_key: 'process.env.AWS_ACCESS_KEY_ID'
secret_key: 'process.env.AWS_SECRET_ACCESS_KEY'
region: 'process.env.AWS_DEFAULT_REGION'
test:
plan: './tests/unit/'
apply: './tests/e2e/'
unit:
mocha:
options:
ui: 'bdd'
reporter: 'spec'
e2e:
testcafe:
screenshot:
enabled: true
take-on-fail: true
path: './tests/e2e/screenshots'
browsers:
- firefox --headless
npm:
scripts: []
dependencies:
chai: 'latest'
test:
mocha:
options:
ui: 'bdd'
reporter: 'spec'
pattern:
- /.+\.spec\.js$/i
ignore: ~
e2e:
testcafe:
screenshot:
enabled: true
take-on-fail: true
path: './tests/e2e/screenshots'
browsers:
- firefox --headless
pattern:
- /.+\.e2e\.js$/i
ignore: ~
# ec2:
# root: './ec2'
# terraform:
# version: 0.11.0
# var-files:
# - workspace.default.tfvars
# test:
# plan: './tests/unit/'
# apply: './tests/e2e/'
# current-workspace: default
# available-workspaces:
# test:
# plan: true
# apply: true
# destroy: true
# var-files:
# - workspace.test.tfvars
# prod:
# plan: true
# apply: false
# destroy: false
# var-files:
# - workspace.prod.tfvars
ec2_dev:
root: './ec2'
terraform:
version: 0.11.0
var-files:
- workspace.dev.tfvars
ec2_prod:
root: './ec2'
terraform:
version: 0.11.0
var-files:
- workspace.prod.tfvars
e2e:
root: './tests/e2e/'
unit:
root: './tests/unit/'
Test Passed Acceptance Criteria:
Configuration example with the specified browser type and mode
rds_restore:
root: './rds_restore'
terraform:
version: 0.11.0
plan: false
apply: true
destroy: false
test:
mapping: './tests/mapping.json'
plan: './tests/unit'
apply: './tests/e2e'
e2e:
testcafe:
browsers:
- firefox --headless
Checked.
Expected result: