Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into feat/DEVTOOLING-712
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutisuryawanshigenesys committed Jul 29, 2024
2 parents b85d4b0 + 925ae74 commit cb53bbb
Show file tree
Hide file tree
Showing 29 changed files with 560 additions and 334 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unit Tests
on:
push:
paths-ignore:
- 'README.md'
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Run Unit Tests
env:
TF_UNIT: '*'
ENABLE_STANDALONE_CGR: 'true'
ENABLE_STANDALONE_EMAIL_ADDRESS: 'true'
run: |
go test ./genesyscloud/... -v -run TestUnit
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func TestUnitUploadIvrDnisChunksError(t *testing.T) {
mockGetError = fmt.Errorf("error on proxy.GetArchitectIvr")
mockPostError = fmt.Errorf("error on proxy.PostArchitectIvr")
mockPutError = fmt.Errorf("error on proxy.PutArchitectIvr")
dnis = []string{"123", "abc", "iii", "zzz"}
maxDnisPerRequest = 2
dnis = []string{"123", "abc", "iii", "zzz"}
)

ivr := platformclientv2.Ivr{
Expand All @@ -98,7 +98,7 @@ func TestUnitUploadIvrDnisChunksError(t *testing.T) {
architectProxy := newArchitectIvrProxy(nil)
architectProxy.maxDnisPerRequest = maxDnisPerRequest

// will be called on create after a chunk update fails because the ivr will need to be manually taken down, in that case
// Will be called on create after a chunk update fails because the ivr will need to be manually taken down, in that case
architectProxy.deleteArchitectIvrAttr = createMockDeleteIvrFunc(nil)

testCases := []architectIvrUploadErrorTestData{
Expand Down
129 changes: 0 additions & 129 deletions genesyscloud/data_source_genesyscloud_routing_skill.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"terraform-provider-genesyscloud/genesyscloud/consistency_checker"

gcloud "terraform-provider-genesyscloud/genesyscloud"
routingSkill "terraform-provider-genesyscloud/genesyscloud/routing_skill"

resourceExporter "terraform-provider-genesyscloud/genesyscloud/resource_exporter"
"terraform-provider-genesyscloud/genesyscloud/util/resourcedata"
Expand All @@ -38,7 +38,7 @@ func getAllAuthOutboundRuleset(ctx context.Context, clientConfig *platformclient
}

// DEVTOOLING-319: filters rule sets by removing the ones that reference skills that no longer exist in GC
skillExporter := gcloud.RoutingSkillExporter()
skillExporter := routingSkill.RoutingSkillExporter()
skillMap, skillErr := skillExporter.GetResourcesFunc(ctx)
if skillErr != nil {
return nil, util.BuildDiagnosticError(resourceName, fmt.Sprintf("Failed to get skill resources"), fmt.Errorf("%v", skillErr))
Expand Down
3 changes: 0 additions & 3 deletions genesyscloud/resource_genesyscloud_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func registerDataSources(l registrar.Registrar) {
l.RegisterDataSource("genesyscloud_organizations_me", DataSourceOrganizationsMe())
l.RegisterDataSource("genesyscloud_quality_forms_evaluation", DataSourceQualityFormsEvaluations())
l.RegisterDataSource("genesyscloud_quality_forms_survey", dataSourceQualityFormsSurvey())
l.RegisterDataSource("genesyscloud_routing_skill", dataSourceRoutingSkill())
l.RegisterDataSource("genesyscloud_routing_wrapupcode", DataSourceRoutingWrapupcode())
l.RegisterDataSource("genesyscloud_user", DataSourceUser())
l.RegisterDataSource("genesyscloud_widget_deployment", dataSourceWidgetDeployments())
Expand All @@ -53,7 +52,6 @@ func registerResources(l registrar.Registrar) {
l.RegisterResource("genesyscloud_location", ResourceLocation())
l.RegisterResource("genesyscloud_quality_forms_evaluation", ResourceEvaluationForm())
l.RegisterResource("genesyscloud_quality_forms_survey", ResourceSurveyForm())
l.RegisterResource("genesyscloud_routing_skill", ResourceRoutingSkill())
l.RegisterResource("genesyscloud_routing_wrapupcode", ResourceRoutingWrapupCode())
l.RegisterResource("genesyscloud_user", ResourceUser())
l.RegisterResource("genesyscloud_widget_deployment", ResourceWidgetDeployment())
Expand All @@ -72,7 +70,6 @@ func registerExporters(l registrar.Registrar) {
l.RegisterExporter("genesyscloud_location", LocationExporter())
l.RegisterExporter("genesyscloud_quality_forms_evaluation", EvaluationFormExporter())
l.RegisterExporter("genesyscloud_quality_forms_survey", SurveyFormExporter())
l.RegisterExporter("genesyscloud_routing_skill", RoutingSkillExporter())
l.RegisterExporter("genesyscloud_routing_wrapupcode", RoutingWrapupCodeExporter())
l.RegisterExporter("genesyscloud_user", UserExporter())
l.RegisterExporter("genesyscloud_widget_deployment", WidgetDeploymentExporter())
Expand Down
5 changes: 3 additions & 2 deletions genesyscloud/resource_genesyscloud_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
routingSettings "terraform-provider-genesyscloud/genesyscloud/routing_settings"
routingUtilization "terraform-provider-genesyscloud/genesyscloud/routing_utilization"
routingUtilizationLabel "terraform-provider-genesyscloud/genesyscloud/routing_utilization_label"
routingSkill "terraform-provider-genesyscloud/genesyscloud/routing_skill"
extensionPool "terraform-provider-genesyscloud/genesyscloud/telephony_providers_edges_extension_pool"
routingSkillGroup "terraform-provider-genesyscloud/genesyscloud/routing_skill_group"
"testing"
Expand Down Expand Up @@ -60,8 +61,8 @@ func (r *registerTestInstance) registerTestResources() {
providerResources["genesyscloud_quality_forms_survey"] = ResourceSurveyForm()
providerResources["genesyscloud_routing_language"] = routinglanguage.ResourceRoutingLanguage()
providerResources["genesyscloud_routing_email_domain"] = routingEmailDomain.ResourceRoutingEmailDomain()
providerResources["genesyscloud_routing_skill"] = ResourceRoutingSkill()
providerResources["genesyscloud_routing_skill_group"] = routingSkillGroup.ResourceRoutingSkillGroup()
providerResources["genesyscloud_routing_skill"] = routingSkill.ResourceRoutingSkill()
providerResources["genesyscloud_routing_settings"] = routingSettings.ResourceRoutingSettings()
providerResources["genesyscloud_routing_utilization"] = routingUtilization.ResourceRoutingUtilization()
providerResources["genesyscloud_routing_wrapupcode"] = ResourceRoutingWrapupCode()
Expand Down Expand Up @@ -99,7 +100,7 @@ func (r *registerTestInstance) registerTestDataSources() {
providerDataSources["genesyscloud_quality_forms_evaluation"] = DataSourceQualityFormsEvaluations()
providerDataSources["genesyscloud_quality_forms_survey"] = dataSourceQualityFormsSurvey()
providerDataSources["genesyscloud_routing_language"] = routinglanguage.DataSourceRoutingLanguage()
providerDataSources["genesyscloud_routing_skill"] = dataSourceRoutingSkill()
providerDataSources["genesyscloud_routing_skill"] = routingSkill.DataSourceRoutingSkill()
providerDataSources["genesyscloud_routing_email_domain"] = routingEmailDomain.DataSourceRoutingEmailDomain()
providerDataSources["genesyscloud_routing_skill_group"] = routingSkillGroup.DataSourceRoutingSkillGroup()
providerDataSources["genesyscloud_routing_wrapupcode"] = DataSourceRoutingWrapupcode()
Expand Down
Loading

0 comments on commit cb53bbb

Please sign in to comment.