Skip to content

Commit

Permalink
Merge branch 'dev' into feat/DEVTOOLING-655
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMoyles authored Jul 18, 2024
2 parents 7ea544d + 651e9b8 commit 9265d1b
Show file tree
Hide file tree
Showing 68 changed files with 2,021 additions and 923 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/generate.yml → .github/workflows/go-checks.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Ensure Documentation in Sync
name: Go Checks
on:
push:
paths-ignore:
- 'README.md'
jobs:
# ensure the documentation is up to date
generate:
name: Generate
go-checks:
name: Go Checks
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand Down Expand Up @@ -35,5 +34,20 @@ jobs:
if [[ -n $(git status -s) ]]; then
echo "There are untracked documentation changes:\n"
git status
fi
- name: Tidy
run: |
go mod tidy
if [[ -n $(git status -s) ]]; then
echo "go mod tidy produced changes:\n"
git status
fi
- name: Vet
run: |
if [[ -n $(go vet ./genesyscloud/... 2>&1) ]]; then
echo "go vet highlighted the following:\n"
go vet ./genesyscloud/...
exit 1
fi
16 changes: 15 additions & 1 deletion docs/resources/journey_action_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ resource "genesyscloud_journey_action_map" "example_journey_action_map" {
- `is_active` (Boolean) Whether the action map is active. Defaults to `true`.
- `page_url_conditions` (Block Set) URL conditions that a page must match for web actions to be displayable. (see [below for nested schema](#nestedblock--page_url_conditions))
- `trigger_with_event_conditions` (Block Set) List of event conditions that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_event_conditions))
- `trigger_with_outcome_probability_conditions` (Block Set) Probability conditions for outcomes that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_outcome_probability_conditions))
- `trigger_with_outcome_probability_conditions` (Block Set, Deprecated) Probability conditions for outcomes that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_outcome_probability_conditions))
- `trigger_with_outcome_quantile_conditions` (Block Set) Quantile conditions for outcomes that must be satisfied to trigger the action map. (see [below for nested schema](#nestedblock--trigger_with_outcome_quantile_conditions))
- `trigger_with_segments` (Set of String) Trigger action map if any segment in the list is assigned to a given customer.
- `weight` (Number) Weight of the action map with higher number denoting higher weight. Low=1, Medium=2, High=3. Defaults to `2`.

Expand Down Expand Up @@ -192,3 +193,16 @@ Optional:

- `probability` (Number) Additional probability condition, where if set, the action map will trigger if the current outcome probability is lower or equal to the value.


<a id="nestedblock--trigger_with_outcome_quantile_conditions"></a>
### Nested Schema for `trigger_with_outcome_quantile_conditions`

Required:

- `max_quantile_threshold` (Number) This Outcome Quantile Condition is met when sessionMaxQuantile of the OutcomeScore is above this value, (unless fallbackQuantile is set). Range 0.00-1.00
- `outcome_id` (String) The outcome ID.

Optional:

- `fallback_quantile_threshold` (Number) If set, this Condition is met when max_quantile_threshold is met, AND the current quantile of the OutcomeScore is below this fallback_quantile_threshold. Range 0.00-1.00

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
inboundCall:
name: Terraform Test Flow log level f79fc952-6a58-4d00-996e-2c3873e1871a
name: Terraform Emergency Test Flow 7fa2e8a9-b1d9-4d78-93b8-05b4465314a7
defaultLanguage: en-us
startUpRef: ./menus/menu[mainMenu]
initialGreeting:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package architect_emergencygroup

import (
"fmt"
"os"
"strconv"
"strings"
"terraform-provider-genesyscloud/genesyscloud/architect_flow"
Expand Down Expand Up @@ -39,6 +40,10 @@ func TestAccResourceArchitectEmergencyGroups(t *testing.T) {
// TODO: Create the IVR inside the test config once emergency group has been moved to its own package.
// Currently, the ivr resource cannot be registered for these tests because of a cyclic dependency issue.
ivrId := "f94e084e-40eb-470b-80d6-0f99cf22d102"
if v := os.Getenv("GENESYSCLOUD_REGION"); v == "tca" {
ivrId = "d37d14fe-1e6c-4ed6-a9bb-b6ef0dd8e9cd"
}

if !ivrExists(config, ivrId) {
t.Skip("Skipping because IVR does not exists in the target org.")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func dataSourceIvrRead(ctx context.Context, d *schema.ResourceData, m interface{
sdkConfig := m.(*provider.ProviderMeta).ClientConfig
ap := getArchitectIvrProxy(sdkConfig)
name := d.Get("name").(string)

// Query ivr by name. Retry in case search has not yet indexed the ivr.
return util.WithRetries(ctx, 15*time.Second, func() *retry.RetryError {
id, retryable, resp, err := ap.getArchitectIvrIdByName(ctx, name)
Expand Down
38 changes: 33 additions & 5 deletions genesyscloud/data_source_genesyscloud_auth_division_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package genesyscloud

import (
"fmt"
"log"
"terraform-provider-genesyscloud/genesyscloud/provider"
"terraform-provider-genesyscloud/genesyscloud/util"
"testing"
Expand All @@ -17,6 +18,7 @@ func TestAccDataSourceAuthDivision(t *testing.T) {
divResource = "auth-division"
divDataSource = "auth-div-data"
divName = "Terraform Divisions-" + uuid.NewString()
divisionID string
)

resource.Test(t, resource.TestCase{
Expand All @@ -27,6 +29,26 @@ func TestAccDataSourceAuthDivision(t *testing.T) {
PreConfig: func() {
time.Sleep(30 * time.Second)
},
Config: GenerateAuthDivisionResource(
divResource,
divName,
util.NullValue,
util.NullValue,
),
Check: resource.ComposeTestCheckFunc(
func(s *terraform.State) error {
rs, ok := s.RootModule().Resources["genesyscloud_auth_division."+divResource]
if !ok {
return fmt.Errorf("not found: %s", "genesyscloud_auth_division."+divResource)
}
divisionID = rs.Primary.ID
log.Printf("Division ID: %s\n", divisionID) // Print ID
return nil
},
),
PreventPostDestroyRefresh: true,
},
{
Config: GenerateAuthDivisionResource(
divResource,
divName,
Expand All @@ -39,14 +61,20 @@ func TestAccDataSourceAuthDivision(t *testing.T) {
),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair("data.genesyscloud_auth_division."+divDataSource, "id", "genesyscloud_auth_division."+divResource, "id"),
func(s *terraform.State) error {
time.Sleep(30 * time.Second) // Wait for 30 seconds for proper deletion
return nil
},
),
},
{
// Import/Read
ResourceName: "genesyscloud_auth_division." + divResource,
ImportState: true,
ImportStateVerify: true,
Destroy: true,
},
},
CheckDestroy: func(state *terraform.State) error {
time.Sleep(45 * time.Second)
return testVerifyDivisionsDestroyed(state)
},
CheckDestroy: testVerifyDivisionsDestroyed,
})
}

Expand Down
59 changes: 0 additions & 59 deletions genesyscloud/data_source_genesyscloud_routing_language.go

This file was deleted.

23 changes: 22 additions & 1 deletion genesyscloud/data_source_genesyscloud_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@ package genesyscloud

import (
"fmt"
"log"
"terraform-provider-genesyscloud/genesyscloud/provider"
"terraform-provider-genesyscloud/genesyscloud/util"
"testing"
"time"

"github.com/google/uuid"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
)

func TestAccDataSourceUser(t *testing.T) {
var (
userResource = "test-user"
userDataSource = "test-user-data"
randomString = uuid.NewString()
userEmail = "John_Doe" + randomString + "@example.com"
userEmail = "John_Doe" + randomString + "@exampleuser.com"
userName = "John_Doe" + randomString
userID string
)

resource.Test(t, resource.TestCase{
Expand All @@ -37,6 +41,15 @@ func TestAccDataSourceUser(t *testing.T) {
),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair("data.genesyscloud_user."+userDataSource, "id", "genesyscloud_user."+userResource, "id"),
func(s *terraform.State) error {
rs, ok := s.RootModule().Resources["genesyscloud_user."+userResource]
if !ok {
return fmt.Errorf("not found: %s", "genesyscloud_user."+userResource)
}
userID = rs.Primary.ID
log.Printf("User ID: %s\n", userID) // Print user ID
return nil
},
),
},
{
Expand All @@ -53,9 +66,17 @@ func TestAccDataSourceUser(t *testing.T) {
),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrPair("data.genesyscloud_user."+userDataSource, "id", "genesyscloud_user."+userResource, "id"),
func(s *terraform.State) error {
time.Sleep(30 * time.Second) // Wait for 30 seconds for proper deletion
return nil
},
),
},
},
CheckDestroy: func(state *terraform.State) error {
time.Sleep(45 * time.Second)
return testVerifyUsersDestroyed(state)
},
})
}

Expand Down
Loading

0 comments on commit 9265d1b

Please sign in to comment.