-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Project initiation for Terraform (resource_mso_schema_template_anp_test) (DCNE-148) #30
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few variable consistency changes and some merge conflicts to be fixed.
} | ||
msoClient := m.(*client.Client) | ||
_, err := MakeRestRequest(msoClient, path, method, payload) | ||
var ignore_on_destroy = d.Get("ignore_on_destroy").(bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var ignore_on_destroy = d.Get("ignore_on_destroy").(bool) | |
var ignoreOnDestroy = d.Get("ignore_on_destroy").(bool) |
And everywhere else where this is used.
anpName = importReadANP | ||
epgName = importReadEPG | ||
} else { | ||
get_attribute := strings.Split(d.Id(), "/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_attribute := strings.Split(d.Id(), "/") | |
getAttribute := strings.Split(d.Id(), "/") |
Same as everywhere else and in other resources.
Syncing PR to Jira |
Steps to run the test:
Export to environment-
export MSO_USERNAME=admin
export MSO_PASSWORD='pwd'
export MSO_URL=
Add the following to GNUmakefile in terraform-provider-mso folder -$(TEST) -v $ (TESTARGS) -timeout 120m -race -covermode=atomic -coverprofile=coverage.out
testacccoverage: fmtcheck
-TF_ACC=1 go test
go tool cover -html=coverage.out
coverprofile ensures that we collect coverage and the metrics will be saved to the file specified- coverage.out.
covermode=atomic tracks parallel test branches
go tool cover -html=coverage.out opens the generated coverage.out on the browser
Example-
For running all test functions in resource_mso_schema_site_anp_epg_selector_test use the command :
make testacccoverage TESTARGS="-run=TestAccMSOSchemaSiteAnpEpgSelector_"