-
Notifications
You must be signed in to change notification settings - Fork 87
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
feature/DEVTOOLING-167 #1490
base: dev
Are you sure you want to change the base?
feature/DEVTOOLING-167 #1490
Conversation
@@ -8,6 +8,7 @@ import ( | |||
"terraform-provider-genesyscloud/genesyscloud/architect_schedulegroups" | |||
"terraform-provider-genesyscloud/genesyscloud/architect_schedules" | |||
authDivision "terraform-provider-genesyscloud/genesyscloud/auth_division" | |||
"terraform-provider-genesyscloud/genesyscloud/journey_segment" |
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.
journey_segment -> journeySegment
"terraform-provider-genesyscloud/genesyscloud/journey_action_map" | ||
"terraform-provider-genesyscloud/genesyscloud/journey_segment" |
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.
journey_segment -> journeySegment
@@ -41,13 +27,13 @@ func dataSourceJourneySegmentRead(ctx context.Context, d *schema.ResourceData, m | |||
const pageSize = 100 | |||
journeySegments, resp, getErr := journeyApi.GetJourneySegments("", pageSize, pageNum, true, nil, nil, "") |
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.
we should be using the proxy in this file also
return *segment.Id, false, resp, nil | ||
} | ||
} | ||
return "", false, resp, fmt.Errorf("No journey segment found with name %s", name) |
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.
retryable should be true
here
func getJourneySegmentIdByNameFn(ctx context.Context, p *journeySegmentProxy, name string) (id string, retryable bool, response *platformclientv2.APIResponse, err error) { | ||
segments, resp, err := p.getAllJourneySegmentsAttr(ctx, p) | ||
if err != nil { | ||
return "", true, resp, err |
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.
retryable should be false
here
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.
Could we also add a nil and length check of segments
before we try to loop through it. If nil or length == 0 { return a none found error with retryable = true }
criteriaMap["values"] = lists.StringListToSet(*criteria.Values) | ||
criteriaMap["should_ignore_case"] = *criteria.ShouldIgnoreCase | ||
criteriaMap["operator"] = *criteria.Operator | ||
return criteriaMap |
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.
And these
@@ -75,7 +75,7 @@ func GenerateTestSteps(testType string, resourceType string, testCaseName string | |||
var testSteps []resource.TestStep | |||
var testCasePath string | |||
testCasePath = GetTestDataPath(testType, resourceType, testCaseName) | |||
if resourceType == "genesyscloud_journey_action_map" || resourceType == "genesyscloud_journey_action_template" { | |||
if resourceType == "genesyscloud_journey_action_map" || resourceType == "genesyscloud_journey_action_template" || resourceType == "genesyscloud_journey_segment" { | |||
testCasePath = path.Join("../", testCasePath) |
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.
If you remove the "/" from the string on this line, I think it might fix the error you outlined in the comment
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.
that was added to handle the few packages were refracted and few were not and the directory structure one step should be prefixed, now i have removed that condition as all the journey package have been refactored
journeyPatternMap["count"] = *journeyPattern.Count | ||
journeyPatternMap["stream_type"] = *journeyPattern.StreamType | ||
journeyPatternMap["session_type"] = *journeyPattern.SessionType | ||
stringmap.SetValueIfNotNil(journeyPatternMap, "event_name", journeyPattern.EventName) |
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.
Same here
criteriaMap["values"] = lists.StringListToSet(*criteria.Values) | ||
criteriaMap["should_ignore_case"] = *criteria.ShouldIgnoreCase | ||
criteriaMap["operator"] = *criteria.Operator | ||
return criteriaMap |
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.
Same here
entityTypeCriteriaMap["should_ignore_case"] = *entityTypeCriteria.ShouldIgnoreCase | ||
entityTypeCriteriaMap["operator"] = *entityTypeCriteria.Operator | ||
entityTypeCriteriaMap["entity_type"] = *entityTypeCriteria.EntityType | ||
return entityTypeCriteriaMap |
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.
Same here
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.
looks good. once all the comments too are addressed.
@@ -46,7 +47,7 @@ func (r *registerTestInstance) registerTestResources() { | |||
providerResources[architect_schedules.ResourceType] = architect_schedules.ResourceArchitectSchedules() | |||
providerResources[architect_schedulegroups.ResourceType] = architect_schedulegroups.ResourceArchitectSchedulegroups() | |||
providerResources[architect_flow.ResourceType] = architect_flow.ResourceArchitectFlow() | |||
providerResources["genesyscloud_journey_segment"] = gcloud.ResourceJourneySegment() | |||
providerResources[journey_segment.ResourceType] = journey_segment.ResourceJourneySegment() |
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.
you can name the package to journeySegment
Team,
I am getting the below error while running the acceptance testing, looks strange to me, still working on the issue.
2025/01/21 18:53:53 [DEBUG] Waiting for state to become: [success]
=== RUN TestAccResourceJourneySegment
2025/01/21 18:53:54 [DEBUG] Waiting for state to become: [success]
2025/01/21 18:53:55 Generated 2 test steps for testcase => ../..\test\data\resource\genesyscloud_journey_segment\basic_attributes
c:\1gcwork\devtooling\terraform-provider-genesyscloud\genesyscloud\journey_segment\testing_new.go:85: Error running post-test destroy, there may be dangling resources: exit status 1