Skip to content

Commit

Permalink
Merge branch 'main' into DEVTOOLING-337
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMoyles authored Jan 29, 2024
2 parents 9ee1946 + ba7a6e7 commit dad013f
Show file tree
Hide file tree
Showing 49 changed files with 1,389 additions and 295 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: test_workflow

on:
workflow_call:
inputs:
package-path:
required: true
type: string
skip-regexp:
type: string
default: ''
run-regexp:
type: string
default: ''
test-log-artifact-name:
type: string
required: true
sdk-log-artifact-name:
type: string
required: true
sdk-debug-log-file-path:
type: string
default: './genesyscloud/sdk_debug.log'
running-export-tests:
type: string
default: 'false'
coverage-out-filename:
type: string
default: ''
coverage-html-filename:
type: string
default: ''
secrets:
client-id:
description: 'Genesys Cloud Client ID'
required: true
client-secret:
description: 'Genesys Cloud Client Secret'
required: true

jobs:
matrix:
name: ''
runs-on: ubuntu-latest
timeout-minutes: 80
strategy:
fail-fast: false
max-parallel: 2
matrix:
# list whatever Terraform versions here you would like to support
terraform:
- '1.6.6'
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
id: go

- name: Setup Terraform CLI
uses: hashicorp/setup-terraform@v3.0.0
with:
terraform_version: ${{ matrix.terraform }}

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

- name: Get dependencies
run: |
go mod download
- name: TF acceptance tests
timeout-minutes: 80
env:
TF_ACC: '1'
TF_LOG: 'DEBUG'
TF_LOG_PATH: ${{ github.workspace }}/test.log
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}

GENESYSCLOUD_OAUTHCLIENT_ID: ${{ secrets.client-id }}
GENESYSCLOUD_OAUTHCLIENT_SECRET: ${{ secrets.client-secret }}
GENESYSCLOUD_REGION: 'us-east-1'
GENESYSCLOUD_SDK_DEBUG: 'true'
GENESYSCLOUD_TOKEN_POOL_SIZE: 20
run: |
if [ "$TF_ACC_TERRAFORM_VERSION" == "0.14.7" ]; then
sleep 300 # This avoids conflicts with the API and other related issues e.g. too many routing email domains
fi
go test -timeout 80m -v -cover ${{ inputs.package-path }} -parallel 20 -coverprofile="${{ inputs.coverage-out-filename }}" -skip="${{ inputs.skip-regexp }}" -run="${{ inputs.run-regexp }}"
go tool cover -html="${{ inputs.coverage-out-filename }}" -o="${{ inputs.coverage-html-filename }}"
- name: 'Upload Logs'
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.test-log-artifact-name }} ${{ matrix.terraform }}
path: ${{ github.workspace }}/test.log
retention-days: 5

- name: 'Upload SDK Log'
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.sdk-log-artifact-name }} ${{ matrix.terraform }}
path: ${{ inputs.sdk-debug-log-file-path }}
retention-days: 5

- name: 'Upload Export Result'
if: ${{ inputs.running-export-tests == 'true' }}
uses: actions/upload-artifact@v4
with:
name: export-result ${{ matrix.terraform }}
path: ${{ github.workspace }}/.terraform/
retention-days: 5
152 changes: 81 additions & 71 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,79 +35,89 @@ jobs:
go build -v .
# run acceptance tests in a matrix with Terraform core versions
test:
name: Matrix Test
needs: build
runs-on: ubuntu-latest
timeout-minutes: 80
strategy:
fail-fast: false
max-parallel: 2
matrix:
# list whatever Terraform versions here you would like to support
terraform:
- '1.1.7'
steps:

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
id: go

- name: Setup Terraform CLI
uses: hashicorp/setup-terraform@v3.0.0
with:
terraform_version: ${{ matrix.terraform }}

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

- name: Get dependencies
run: |
go mod download
- name: TF acceptance tests
timeout-minutes: 80
env:
TF_ACC: "1"
TF_LOG: "DEBUG"
TF_LOG_PATH: "../test.log"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
outbound-tests:
uses: ./.github/workflows/test-workflow.yml
name: Outbound
needs: build
with:
package-path: './genesyscloud/...'
run-regexp: '(Outbound)+'
coverage-out-filename: 'ob-coverage.out'
coverage-html-filename: 'ob-coverage.html'
test-log-artifact-name: 'outbound logs'
sdk-log-artifact-name: 'outbound sdk_log'
secrets:
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }}
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }}

GENESYSCLOUD_OAUTHCLIENT_ID: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }}
GENESYSCLOUD_OAUTHCLIENT_SECRET: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }}
GENESYSCLOUD_REGION: "us-east-1"
GENESYSCLOUD_SDK_DEBUG: "true"
GENESYSCLOUD_TOKEN_POOL_SIZE: 20
run: |
run: |
if [ "$TF_ACC_TERRAFORM_VERSION" == "0.14.7" ]; then
sleep 300 # This avoids conflicts with the API and other related issues e.g. too many routing email domains
fi
go test -timeout 80m -v -cover ./genesyscloud/... -parallel 20 -coverprofile=coverage.out
go tool cover -html coverage.out cover.html
export-tests:
uses: ./.github/workflows/test-workflow.yml
name: Export
needs: build
with:
package-path: './genesyscloud/tfexporter/...'
coverage-out-filename: 'export-coverage.out'
coverage-html-filename: 'export-coverage.html'
running-export-tests: 'true'
test-log-artifact-name: 'export logs'
sdk-log-artifact-name: 'export sdk_log'
sdk-debug-log-file-path: './genesyscloud/tfexporter/sdk_debug.log'
secrets:
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }}
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }}

- name: 'Upload Export Result'
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: export-result ${{ matrix.terraform }}
path: ./.terraform/
retention-days: 5
routing-tests:
uses: ./.github/workflows/test-workflow.yml
name: Routing
needs: build
with:
package-path: './genesyscloud/...'
run-regexp: '(Routing)+'
coverage-out-filename: 'routing-coverage.out'
coverage-html-filename: 'routing-coverage.html'
test-log-artifact-name: 'routing logs'
sdk-log-artifact-name: 'routing sdk_log'
secrets:
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }}
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }}

- name: 'Upload Logs'
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: logs ${{ matrix.terraform }}
path: ./test.log
retention-days: 5
all-other-datasource-tests:
needs:
- routing-tests
- export-tests
- outbound-tests
if: ${{ always() }}
uses: ./.github/workflows/test-workflow.yml
name: All Other DataSource Tests
with:
package-path: './genesyscloud/...'
skip-regexp: '(TfExport)+|(Outbound)+|(Routing)+'
run-regexp: 'TestAccDataSource'
coverage-out-filename: 'data-source-coverage.out'
coverage-html-filename: 'data-source-coverage.html'
test-log-artifact-name: 'data source tests logs'
sdk-log-artifact-name: 'data source tests sdk_log'
secrets:
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }}
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }}

- name: 'Upload SDK Log'
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: sdk_log ${{ matrix.terraform }}
path: ./genesyscloud/sdk_debug.log
retention-days: 5
all-other-resource-tests:
uses: ./.github/workflows/test-workflow.yml
name: All Other Resource Tests
needs:
- routing-tests
- export-tests
- outbound-tests
if: ${{ always() }}
with:
package-path: './genesyscloud/...'
skip-regexp: '(TfExport)+|(Outbound)+|(Routing)+'
run-regexp: 'TestAccResource'
coverage-out-filename: 'resource-coverage.out'
coverage-html-filename: 'resource-coverage.html'
test-log-artifact-name: 'resource tests logs'
sdk-log-artifact-name: 'resource tests sdk_log'
secrets:
client-id: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_ID }}
client-secret: ${{ secrets.TEST_GENESYSCLOUD_OAUTHCLIENT_SECRET }}
2 changes: 1 addition & 1 deletion docs/resources/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ resource "genesyscloud_group" "sample_group" {
### Required

- `name` (String) Group name.
- `owner_ids` (List of String) IDs of owners of the group.

### Optional

- `addresses` (Block List) Contact numbers for this group. (see [below for nested schema](#nestedblock--addresses))
- `description` (String) Group description.
- `member_ids` (Set of String) IDs of members assigned to the group. If not set, this resource will not manage group members.
- `owner_ids` (List of String) IDs of owners of the group.
- `rules_visible` (Boolean) Are membership rules visible to the person requesting to view the group. Defaults to `true`.
- `type` (String) Group type (official | social). This cannot be modified. Changing type attribute will cause the existing genesys_group object to dropped and recreated with a new ID. Defaults to `official`.
- `visibility` (String) Who can view this group (public | owners | members). Defaults to `public`.
Expand Down
25 changes: 24 additions & 1 deletion docs/resources/routing_utilization.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following Genesys Cloud APIs are used by this resource. Ensure your OAuth Cl
## Example Usage

```terraform
resource "genesyscloud_routing_utilization" "org-utililzation" {
resource "genesyscloud_routing_utilization" "org-utilization" {
call {
maximum_capacity = 1
include_non_acd = true
Expand All @@ -43,6 +43,15 @@ resource "genesyscloud_routing_utilization" "org-utililzation" {
include_non_acd = false
interruptible_media_types = ["call", "chat"]
}
label_utilizations {
label_id = genesyscloud_routing_utilization_label.red_label.id
maximum_capacity = 4
}
label_utilizations {
label_id = genesyscloud_routing_utilization_label.blue_label.id
maximum_capacity = 3
interrupting_label_ids = [genesyscloud_routing_utilization_label.red_label.id]
}
}
```

Expand All @@ -55,6 +64,7 @@ resource "genesyscloud_routing_utilization" "org-utililzation" {
- `callback` (Block List, Max: 1) Callback media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--callback))
- `chat` (Block List, Max: 1) Chat media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--chat))
- `email` (Block List, Max: 1) Email media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--email))
- `label_utilizations` (Block List) Label utilization settings. If not set, default label settings will be applied. This is in PREVIEW and should not be used unless the feature is available to your organization. (see [below for nested schema](#nestedblock--label_utilizations))
- `message` (Block List, Max: 1) Message media settings. If not set, this reverts to the default media type settings. (see [below for nested schema](#nestedblock--message))
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

Expand Down Expand Up @@ -114,6 +124,19 @@ Optional:
- `interruptible_media_types` (Set of String) Set of other media types that can interrupt this media type (call | callback | chat | email | message).


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

Required:

- `label_id` (String) Id of the label being configured.
- `maximum_capacity` (Number) Maximum capacity of conversations with this label. Value must be between 0 and 25.

Optional:

- `interrupting_label_ids` (Set of String) Set of other labels that can interrupt this label.


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

Expand Down
Loading

0 comments on commit dad013f

Please sign in to comment.