Skip to content

Conversation

@shrsr
Copy link
Collaborator

@shrsr shrsr commented Jun 29, 2021

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 -
testacccoverage: fmtcheck
-TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m -race -covermode=atomic -coverprofile=coverage.out
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_"

@shrsr shrsr requested a review from lhercot July 13, 2021 17:09
@shrsr shrsr changed the title add test file Test Project initiation for Terraform (resource_mso_schema_template_anp_test) Jul 13, 2021
@shrsr shrsr self-assigned this Jul 20, 2021
@anvitha-jain anvitha-jain self-requested a review October 17, 2022 16:52
Copy link
Collaborator

@anvitha-jain anvitha-jain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@samiib samiib left a 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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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(), "/")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
get_attribute := strings.Split(d.Id(), "/")
getAttribute := strings.Split(d.Id(), "/")

Same as everywhere else and in other resources.

@samiib samiib added the jira-sync Sync this issue to Jira label Aug 14, 2024
@samiib
Copy link
Collaborator

samiib commented Aug 14, 2024

Syncing PR to Jira

@github-actions github-actions bot changed the title Test Project initiation for Terraform (resource_mso_schema_template_anp_test) Test Project initiation for Terraform (resource_mso_schema_template_anp_test) (DCNE-148) Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira-sync Sync this issue to Jira

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants