diff --git a/.run/TestRegisterDNSServerWithInfinity in github.com_pexip_go-infinity-sdk_v38.run.xml b/.run/TestRegisterDNSServerWithInfinity in github.com_pexip_go-infinity-sdk_v38.run.xml new file mode 100644 index 00000000..b5d2b7c4 --- /dev/null +++ b/.run/TestRegisterDNSServerWithInfinity in github.com_pexip_go-infinity-sdk_v38.run.xml @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2025 Pexip AS + * + * SPDX-License-Identifier: Apache-2.0 + */ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.run/TestRegisterWorkWithInfinity in github.com_pexip_go-infinity-sdk_v38.run.xml b/.run/TestRegisterWorkWithInfinity in github.com_pexip_go-infinity-sdk_v38.run.xml new file mode 100644 index 00000000..cd986eb4 --- /dev/null +++ b/.run/TestRegisterWorkWithInfinity in github.com_pexip_go-infinity-sdk_v38.run.xml @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2025 Pexip AS + * + * SPDX-License-Identifier: Apache-2.0 + */ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..68b22f52 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,57 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Overview + +This is a Terraform provider for Pexip Infinity that allows managing Pexip Infinity infrastructure through Terraform. The provider uses the Pexip go-infinity-sdk v38 to interact with Pexip Infinity Manager APIs. + +## Development Commands + +### Building and Installing +- `make install` - Build and install the provider locally to `~/.terraform.d/plugins` +- `make build` - Build the provider binary to `dist/` directory +- `make build-dev` - Build directly to Terraform plugins directory for development + +### Testing +- `make test` - Run unit tests (tagged as `unit`) +- `make testacc` - Run Terraform acceptance tests (sets `TF_ACC=true`, tagged as `integration`) +- `make check` - Run linting and tests together + +### Code Quality +- `make lint` - Run golangci-lint with specific checks (govet, ineffassign, staticcheck, deadcode, unused) +- `make fmt` - Format Go code using `go fmt` +- `make sec` - Run security analysis with gosec + +### Local Development Setup +Requires creating `~/.terraformrc` with dev_overrides pointing to local plugin directory as shown in README.md. + +## Architecture + +### Provider Structure +- **Main entry point**: `main.go` - Standard Terraform plugin serve setup +- **Provider core**: `internal/provider/provider.go` - Defines PexipProvider with Infinity client integration +- **Authentication**: Uses basic auth with username/password against Pexip Infinity Manager API +- **Concurrency**: Provider includes mutex for thread-safe operations + +### Resources and Data Sources +- **InfinityNodeResource**: Manages Pexip Infinity nodes +- **InfinityManagerConfigDataSource**: Generates bootstrap configuration for Pexip Infinity Manager +- Models are defined in separate files (e.g., `infinity_manager_config_model.go`) + +### Key Dependencies +- Terraform Plugin Framework v1.15.0 (newer framework, not SDK v2) +- Pexip go-infinity-sdk v38 for API interactions +- Custom validators in `internal/provider/validators/` for IP addresses and URLs + +### Directory Structure +- `internal/provider/` - Core provider implementation +- `internal/helpers/` - Utility functions and hashing +- `internal/log/` - Terraform-specific logging setup +- `testdata/` - Terraform configuration files for testing +- `example/` - Complete example Terraform configurations + +### Testing Patterns +- Unit tests use `unit` build tag +- Acceptance tests use `integration` build tag and require `TF_ACC=true` +- Test files follow `*_test.go` naming convention \ No newline at end of file diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 00000000..e1c3b789 --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,61 @@ +# Project Overview + +This project is a Terraform provider for Pexip Infinity. It allows users to manage their Pexip Infinity infrastructure as code, covering a wide range of features from basic node configuration to integrations with Microsoft 365 and Google Workspace. The provider is written in Go and uses the Pexip Go SDK to interact with the Pexip Infinity API. + +## Key Technologies + +* **Go:** The programming language used to develop the Terraform provider. +* **Terraform:** The infrastructure as code tool that this provider plugs into. +* **Pexip Infinity API:** The API that this provider communicates with to manage Pexip Infinity resources. + +## Architecture + +The project follows the standard structure for a Terraform provider. The core logic is located in the `internal/provider` directory, with the main entry point being `main.go`. The provider defines a set of resources that correspond to Pexip Infinity objects, such as conferences, locations, and worker VMs. + +# Building and Running + +The project uses a `Makefile` to streamline the development process. Here are the key commands: + +* **Build the provider:** + ```bash + make build + ``` + +* **Run unit tests:** + ```bash + make test + ``` + +* **Run acceptance tests (requires a Pexip Infinity environment):** + ```bash + make testacc + ``` + +* **Lint the code:** + ```bash + make lint + ``` + +* **Format the code:** + ```bash + make fmt + ``` + +* **Install the provider locally:** + ```bash + make install + ``` + +# Development Conventions + +## Coding Style + +The project follows standard Go coding conventions. Code should be formatted with `gofmt` before committing. + +## Testing + +The project has both unit and acceptance tests. Unit tests are located alongside the code they test and can be run with `make test`. Acceptance tests require a running Pexip Infinity instance and are located in the `internal/provider` directory. They can be run with `make testacc`. + +## Contribution Guidelines + +Contributions are welcome. Please see the `CONTRIBUTING.md` file for more details. diff --git a/contrib/delete-workflow-runs.sh b/contrib/delete-workflow-runs.sh new file mode 100755 index 00000000..1c6cf676 --- /dev/null +++ b/contrib/delete-workflow-runs.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Delete GitHub Actions runs older than a given age +# Usage: ./delete-old-runs.sh OWNER/REPO MINUTES [--dry-run] +# +# Examples: +# ./delete-old-runs.sh myorg/myrepo 120 +# ./delete-old-runs.sh myorg/myrepo 60 --dry-run + +usage() { + echo "Usage: $0 OWNER/REPO MINUTES [--dry-run]" + exit 1 +} + +REPO="${1:-}"; shift || true +AGE_MINUTES="${1:-}"; shift || true +DRY_RUN="${1:-}" + +[[ -z "${REPO}" || -z "${AGE_MINUTES}" ]] && usage +if ! [[ "${AGE_MINUTES}" =~ ^[0-9]+$ ]]; then + echo "MINUTES must be an integer" >&2 + exit 1 +fi + +echo "Fetching runs for ${REPO} and deleting those older than ${AGE_MINUTES} minutes..." +[[ "${DRY_RUN:-}" == "--dry-run" ]] && echo "Dry run mode: will only print IDs and not delete." + +# We fetch a large page (up to 1000). Increase if needed or loop over pages via gh api. +# Fields: databaseId (run ID), createdAt (RFC3339), status +JQ_FILTER=" + .[] + | select(.status == \"completed\") + | select( (now - (.createdAt | fromdateiso8601)) > (${AGE_MINUTES} * 60) ) + | .databaseId +" + +# If your gh doesn't support `fromdateiso8601`/`now`, see fallback note below. +RUN_IDS="$(gh run list \ + --repo "${REPO}" \ + --limit 1000 \ + --json databaseId,createdAt,status \ + --jq "${JQ_FILTER}" || true)" + +if [[ -z "${RUN_IDS}" ]]; then + echo "No runs to delete (either none found, or none older than ${AGE_MINUTES} minutes)." + exit 0 +fi + +COUNT=0 +for ID in ${RUN_IDS}; do + if [[ "${DRY_RUN:-}" == "--dry-run" ]]; then + echo "[dry-run] Would delete run ID ${ID}" + else + echo "Deleting run ${ID}..." + gh api --silent --method DELETE "repos/${REPO}/actions/runs/${ID}" + fi + COUNT=$((COUNT + 1)) +done + +if [[ "${DRY_RUN:-}" == "--dry-run" ]]; then + echo "Dry run complete. ${COUNT} runs would have been deleted." +else + echo "✅ Deleted ${COUNT} runs older than ${AGE_MINUTES} minutes from ${REPO}." +fi diff --git a/example/gcp-infinity-manager/test-cert.pem.license b/example/gcp-infinity-manager/test-cert.pem.license new file mode 100644 index 00000000..a048e732 --- /dev/null +++ b/example/gcp-infinity-manager/test-cert.pem.license @@ -0,0 +1,5 @@ +/* + * SPDX-FileCopyrightText: 2025 Pexip AS + * + * SPDX-License-Identifier: Apache-2.0 + */ diff --git a/go.mod b/go.mod index 40545406..0f6cb9bf 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/hashicorp/terraform-plugin-framework-validators v0.18.0 github.com/hashicorp/terraform-plugin-go v0.28.0 github.com/hashicorp/terraform-plugin-log v0.9.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 + github.com/hashicorp/terraform-plugin-testing v1.13.3 github.com/pexip/go-infinity-sdk/v38 v38.0.5 github.com/stretchr/testify v1.10.0 golang.org/x/crypto v0.40.0 @@ -40,6 +40,7 @@ require ( github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.23.0 // indirect github.com/hashicorp/terraform-json v0.25.0 // indirect + github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 // indirect github.com/hashicorp/terraform-registry-address v0.3.0 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.2 // indirect diff --git a/go.sum b/go.sum index 671ff1ab..d5b0f0c7 100644 --- a/go.sum +++ b/go.sum @@ -94,6 +94,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 h1:NFPMacTrY/IdcIcnUB+7hsore1ZaRWU9cnB6jFoBnIM= github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0/go.mod h1:QYmYnLfsosrxjCnGY1p9c7Zj6n9thnEE+7RObeYs3fA= +github.com/hashicorp/terraform-plugin-testing v1.13.3 h1:QLi/khB8Z0a5L54AfPrHukFpnwsGL8cwwswj4RZduCo= +github.com/hashicorp/terraform-plugin-testing v1.13.3/go.mod h1:WHQ9FDdiLoneey2/QHpGM/6SAYf4A7AZazVg7230pLE= github.com/hashicorp/terraform-registry-address v0.3.0 h1:HMpK3nqaGFPS9VmgRXrJL/dzHNdheGVKk5k7VlFxzCo= github.com/hashicorp/terraform-registry-address v0.3.0/go.mod h1:jRGCMiLaY9zii3GLC7hqpSnwhfnCN5yzvY0hh4iCGbM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= diff --git a/internal/provider/data_infinity_manager_config_test.go b/internal/provider/data_infinity_manager_config_test.go index 6ff854d2..4b5915c1 100644 --- a/internal/provider/data_infinity_manager_config_test.go +++ b/internal/provider/data_infinity_manager_config_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -18,7 +17,6 @@ import ( func TestInfinityManagerConfig(t *testing.T) { t.Parallel() - os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 28596ffe..7f119e0f 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -7,12 +7,11 @@ package provider import ( - "os" "testing" "github.com/hashicorp/terraform-plugin-framework/providerserver" "github.com/hashicorp/terraform-plugin-go/tfprotov5" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" ) func getTestProtoV5ProviderFactories(client InfinityClient) map[string]func() (tfprotov5.ProviderServer, error) { @@ -22,8 +21,5 @@ func getTestProtoV5ProviderFactories(client InfinityClient) map[string]func() (t } func TestMain(m *testing.M) { - if os.Getenv("TF_ACC") == "" { - os.Exit(m.Run()) - } resource.TestMain(m) } diff --git a/internal/provider/resource_infinity_adfs_auth_server_test.go b/internal/provider/resource_infinity_adfs_auth_server_test.go index 7d0eb717..4f32bb51 100644 --- a/internal/provider/resource_infinity_adfs_auth_server_test.go +++ b/internal/provider/resource_infinity_adfs_auth_server_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityADFSAuthServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_authentication_test.go b/internal/provider/resource_infinity_authentication_test.go index 71ed8eda..23d8dcf4 100644 --- a/internal/provider/resource_infinity_authentication_test.go +++ b/internal/provider/resource_infinity_authentication_test.go @@ -8,13 +8,12 @@ package provider import ( "context" - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -52,7 +51,6 @@ func TestInfinityAuthentication_UpdateURLPattern(t *testing.T) { func TestInfinityAuthentication(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_automatic_participant_test.go b/internal/provider/resource_infinity_automatic_participant_test.go index f1ba9b25..672e5492 100644 --- a/internal/provider/resource_infinity_automatic_participant_test.go +++ b/internal/provider/resource_infinity_automatic_participant_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityAutomaticParticipant(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_azure_tenant_test.go b/internal/provider/resource_infinity_azure_tenant_test.go index ba6dd759..b855bd35 100644 --- a/internal/provider/resource_infinity_azure_tenant_test.go +++ b/internal/provider/resource_infinity_azure_tenant_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityAzureTenant(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_break_in_allow_list_address_test.go b/internal/provider/resource_infinity_break_in_allow_list_address_test.go index 551234b8..f45616b8 100644 --- a/internal/provider/resource_infinity_break_in_allow_list_address_test.go +++ b/internal/provider/resource_infinity_break_in_allow_list_address_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityBreakInAllowListAddress(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ca_certificate_test.go b/internal/provider/resource_infinity_ca_certificate_test.go index f3777a65..c7701e57 100644 --- a/internal/provider/resource_infinity_ca_certificate_test.go +++ b/internal/provider/resource_infinity_ca_certificate_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityCACertificate(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_certificate_signing_request_test.go b/internal/provider/resource_infinity_certificate_signing_request_test.go index d51d14e5..e257d58a 100644 --- a/internal/provider/resource_infinity_certificate_signing_request_test.go +++ b/internal/provider/resource_infinity_certificate_signing_request_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityCertificateSigningRequest(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_conference_alias_test.go b/internal/provider/resource_infinity_conference_alias_test.go index aa95b198..e0021d97 100644 --- a/internal/provider/resource_infinity_conference_alias_test.go +++ b/internal/provider/resource_infinity_conference_alias_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityConferenceAlias(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_conference_test.go b/internal/provider/resource_infinity_conference_test.go index 939c9d2d..099f288e 100644 --- a/internal/provider/resource_infinity_conference_test.go +++ b/internal/provider/resource_infinity_conference_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityConference(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_device_test.go b/internal/provider/resource_infinity_device_test.go index b548851f..5474a842 100644 --- a/internal/provider/resource_infinity_device_test.go +++ b/internal/provider/resource_infinity_device_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityDevice(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_diagnostic_graph_test.go b/internal/provider/resource_infinity_diagnostic_graph_test.go index 2ee07f61..51ced903 100644 --- a/internal/provider/resource_infinity_diagnostic_graph_test.go +++ b/internal/provider/resource_infinity_diagnostic_graph_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityDiagnosticGraph(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_dns_server_test.go b/internal/provider/resource_infinity_dns_server_test.go index 86295a1b..749b6687 100644 --- a/internal/provider/resource_infinity_dns_server_test.go +++ b/internal/provider/resource_infinity_dns_server_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinityDNSServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_end_user_test.go b/internal/provider/resource_infinity_end_user_test.go index 5e831156..19cdf257 100644 --- a/internal/provider/resource_infinity_end_user_test.go +++ b/internal/provider/resource_infinity_end_user_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityEndUser(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_event_sink_test.go b/internal/provider/resource_infinity_event_sink_test.go index a6a777da..a7fb88db 100644 --- a/internal/provider/resource_infinity_event_sink_test.go +++ b/internal/provider/resource_infinity_event_sink_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinityEventSink(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_external_webapp_host_test.go b/internal/provider/resource_infinity_external_webapp_host_test.go index 814aee9d..c63014ac 100644 --- a/internal/provider/resource_infinity_external_webapp_host_test.go +++ b/internal/provider/resource_infinity_external_webapp_host_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityExternalWebappHost(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_gateway_routing_rule_test.go b/internal/provider/resource_infinity_gateway_routing_rule_test.go index cb458e6e..ea9e3090 100644 --- a/internal/provider/resource_infinity_gateway_routing_rule_test.go +++ b/internal/provider/resource_infinity_gateway_routing_rule_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityGatewayRoutingRule(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_global_configuration_test.go b/internal/provider/resource_infinity_global_configuration_test.go index 2ec4287b..f52b5501 100644 --- a/internal/provider/resource_infinity_global_configuration_test.go +++ b/internal/provider/resource_infinity_global_configuration_test.go @@ -7,13 +7,12 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -21,7 +20,6 @@ import ( func TestInfinityGlobalConfiguration(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_gms_access_token_test.go b/internal/provider/resource_infinity_gms_access_token_test.go index 5b3933b5..777eb01a 100644 --- a/internal/provider/resource_infinity_gms_access_token_test.go +++ b/internal/provider/resource_infinity_gms_access_token_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityGMSAccessToken(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_google_auth_server_test.go b/internal/provider/resource_infinity_google_auth_server_test.go index 0c040188..b523b442 100644 --- a/internal/provider/resource_infinity_google_auth_server_test.go +++ b/internal/provider/resource_infinity_google_auth_server_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityGoogleAuthServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_h323_gatekeeper_test.go b/internal/provider/resource_infinity_h323_gatekeeper_test.go index fb4c30be..fb7c35c6 100644 --- a/internal/provider/resource_infinity_h323_gatekeeper_test.go +++ b/internal/provider/resource_infinity_h323_gatekeeper_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityH323Gatekeeper(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_http_proxy_test.go b/internal/provider/resource_infinity_http_proxy_test.go index 8d124c7c..7fa7ef8f 100644 --- a/internal/provider/resource_infinity_http_proxy_test.go +++ b/internal/provider/resource_infinity_http_proxy_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -27,7 +26,6 @@ func intPtr(i int) *int { func TestInfinityHTTPProxy(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_identity_provider_attribute_test.go b/internal/provider/resource_infinity_identity_provider_attribute_test.go index 8da8fd62..9bf4d005 100644 --- a/internal/provider/resource_infinity_identity_provider_attribute_test.go +++ b/internal/provider/resource_infinity_identity_provider_attribute_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityIdentityProviderAttribute(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_identity_provider_group_test.go b/internal/provider/resource_infinity_identity_provider_group_test.go index 77beda9c..e0a54630 100644 --- a/internal/provider/resource_infinity_identity_provider_group_test.go +++ b/internal/provider/resource_infinity_identity_provider_group_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityIdentityProviderGroup(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_identity_provider_test.go b/internal/provider/resource_infinity_identity_provider_test.go index a351f83d..68bdf0c3 100644 --- a/internal/provider/resource_infinity_identity_provider_test.go +++ b/internal/provider/resource_infinity_identity_provider_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityIdentityProvider(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ivr_theme_test.go b/internal/provider/resource_infinity_ivr_theme_test.go index 2642663d..cc3dfc97 100644 --- a/internal/provider/resource_infinity_ivr_theme_test.go +++ b/internal/provider/resource_infinity_ivr_theme_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityIvrTheme(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ldap_role_test.go b/internal/provider/resource_infinity_ldap_role_test.go index 33467e1e..7503e882 100644 --- a/internal/provider/resource_infinity_ldap_role_test.go +++ b/internal/provider/resource_infinity_ldap_role_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityLdapRole(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ldap_sync_field_test.go b/internal/provider/resource_infinity_ldap_sync_field_test.go index afbeca0c..282f7587 100644 --- a/internal/provider/resource_infinity_ldap_sync_field_test.go +++ b/internal/provider/resource_infinity_ldap_sync_field_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityLdapSyncField(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ldap_sync_source_test.go b/internal/provider/resource_infinity_ldap_sync_source_test.go index 6ea40485..796cd5b0 100644 --- a/internal/provider/resource_infinity_ldap_sync_source_test.go +++ b/internal/provider/resource_infinity_ldap_sync_source_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityLdapSyncSource(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_licence_request_test.go b/internal/provider/resource_infinity_licence_request_test.go index d7b1aea2..77b0a468 100644 --- a/internal/provider/resource_infinity_licence_request_test.go +++ b/internal/provider/resource_infinity_licence_request_test.go @@ -7,24 +7,20 @@ package provider import ( - "os" "regexp" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/pexip/go-infinity-sdk/v38" - "github.com/pexip/terraform-provider-pexip/internal/test" ) func TestInfinityLicenceRequest(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() @@ -61,9 +57,6 @@ func testInfinityLicenceRequest(t *testing.T, client InfinityClient) { ProtoV5ProviderFactories: getTestProtoV5ProviderFactories(client), // Skip the final destroy since this resource cannot be deleted. // The test already verifies that a destroy operation fails as expected. - CheckDestroy: func(s *terraform.State) error { - return nil - }, Steps: []resource.TestStep{ // Step 1: Test resource creation and stabilization { diff --git a/internal/provider/resource_infinity_licence_test.go b/internal/provider/resource_infinity_licence_test.go index 16c80e85..aa0af484 100644 --- a/internal/provider/resource_infinity_licence_test.go +++ b/internal/provider/resource_infinity_licence_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityLicence(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_location_test.go b/internal/provider/resource_infinity_location_test.go index a23a5e4f..a537a684 100644 --- a/internal/provider/resource_infinity_location_test.go +++ b/internal/provider/resource_infinity_location_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityLocation(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_log_level_test.go b/internal/provider/resource_infinity_log_level_test.go index 8ffb79e7..4ea485e3 100644 --- a/internal/provider/resource_infinity_log_level_test.go +++ b/internal/provider/resource_infinity_log_level_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityLogLevel(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_management_vm_test.go b/internal/provider/resource_infinity_management_vm_test.go index 1986d2de..7a9cc5f1 100644 --- a/internal/provider/resource_infinity_management_vm_test.go +++ b/internal/provider/resource_infinity_management_vm_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityManagementVM(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_media_library_entry_test.go b/internal/provider/resource_infinity_media_library_entry_test.go index 90290394..96eb6437 100644 --- a/internal/provider/resource_infinity_media_library_entry_test.go +++ b/internal/provider/resource_infinity_media_library_entry_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityMediaLibraryEntry(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_media_library_playlist_test.go b/internal/provider/resource_infinity_media_library_playlist_test.go index b6c7fce5..6c45fd96 100644 --- a/internal/provider/resource_infinity_media_library_playlist_test.go +++ b/internal/provider/resource_infinity_media_library_playlist_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityMediaLibraryPlaylist(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_media_processing_server_test.go b/internal/provider/resource_infinity_media_processing_server_test.go index 2e36c75e..e00ffe46 100644 --- a/internal/provider/resource_infinity_media_processing_server_test.go +++ b/internal/provider/resource_infinity_media_processing_server_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityMediaProcessingServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_mjx_endpoint_test.go b/internal/provider/resource_infinity_mjx_endpoint_test.go index 3dc3353d..b34c8267 100644 --- a/internal/provider/resource_infinity_mjx_endpoint_test.go +++ b/internal/provider/resource_infinity_mjx_endpoint_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityMjxEndpoint(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_mjx_integration_test.go b/internal/provider/resource_infinity_mjx_integration_test.go index 281d892f..e1ca1d73 100644 --- a/internal/provider/resource_infinity_mjx_integration_test.go +++ b/internal/provider/resource_infinity_mjx_integration_test.go @@ -7,21 +7,19 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" ) func TestInfinityMjxIntegration(t *testing.T) { - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ms_exchange_connector_test.go b/internal/provider/resource_infinity_ms_exchange_connector_test.go index b97d1151..7f2b5c44 100644 --- a/internal/provider/resource_infinity_ms_exchange_connector_test.go +++ b/internal/provider/resource_infinity_ms_exchange_connector_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityMsExchangeConnector(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_mssip_proxy_test.go b/internal/provider/resource_infinity_mssip_proxy_test.go index 3f20be0a..57744db7 100644 --- a/internal/provider/resource_infinity_mssip_proxy_test.go +++ b/internal/provider/resource_infinity_mssip_proxy_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityMSSIPProxy(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ntp_server_test.go b/internal/provider/resource_infinity_ntp_server_test.go index a7bca630..c48f13ed 100644 --- a/internal/provider/resource_infinity_ntp_server_test.go +++ b/internal/provider/resource_infinity_ntp_server_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinityNTPServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_oauth2_client_test.go b/internal/provider/resource_infinity_oauth2_client_test.go index f8c76341..0b5294ac 100644 --- a/internal/provider/resource_infinity_oauth2_client_test.go +++ b/internal/provider/resource_infinity_oauth2_client_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityOAuth2Client(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_pexip_streaming_credential_test.go b/internal/provider/resource_infinity_pexip_streaming_credential_test.go index 221405a3..01008d2e 100644 --- a/internal/provider/resource_infinity_pexip_streaming_credential_test.go +++ b/internal/provider/resource_infinity_pexip_streaming_credential_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityPexipStreamingCredential(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_policy_server_test.go b/internal/provider/resource_infinity_policy_server_test.go index 107d5a8c..b256c7d6 100644 --- a/internal/provider/resource_infinity_policy_server_test.go +++ b/internal/provider/resource_infinity_policy_server_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinityPolicyServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_recurring_conference_test.go b/internal/provider/resource_infinity_recurring_conference_test.go index cc36705e..22946d33 100644 --- a/internal/provider/resource_infinity_recurring_conference_test.go +++ b/internal/provider/resource_infinity_recurring_conference_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityRecurringConference(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_registration_test.go b/internal/provider/resource_infinity_registration_test.go index b4f20ecc..d60e1f65 100644 --- a/internal/provider/resource_infinity_registration_test.go +++ b/internal/provider/resource_infinity_registration_test.go @@ -7,13 +7,12 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -21,7 +20,6 @@ import ( func TestInfinityRegistration(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_role_mapping_test.go b/internal/provider/resource_infinity_role_mapping_test.go index 7dc1dd52..7292a221 100644 --- a/internal/provider/resource_infinity_role_mapping_test.go +++ b/internal/provider/resource_infinity_role_mapping_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityRoleMapping(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_role_test.go b/internal/provider/resource_infinity_role_test.go index d4ef1e8b..67f4f2d9 100644 --- a/internal/provider/resource_infinity_role_test.go +++ b/internal/provider/resource_infinity_role_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityRole(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_scheduled_alias_test.go b/internal/provider/resource_infinity_scheduled_alias_test.go index 0b18140e..0b166ef4 100644 --- a/internal/provider/resource_infinity_scheduled_alias_test.go +++ b/internal/provider/resource_infinity_scheduled_alias_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityScheduledAlias(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_scheduled_conference_test.go b/internal/provider/resource_infinity_scheduled_conference_test.go index 14ebcde4..f68aa625 100644 --- a/internal/provider/resource_infinity_scheduled_conference_test.go +++ b/internal/provider/resource_infinity_scheduled_conference_test.go @@ -7,7 +7,6 @@ package provider import ( - "os" "testing" "time" @@ -16,7 +15,7 @@ import ( "github.com/pexip/go-infinity-sdk/v38/util" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -24,7 +23,6 @@ import ( func TestInfinityScheduledConference(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_scheduled_scaling_test.go b/internal/provider/resource_infinity_scheduled_scaling_test.go index 0144083a..bfed3f56 100644 --- a/internal/provider/resource_infinity_scheduled_scaling_test.go +++ b/internal/provider/resource_infinity_scheduled_scaling_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityScheduledScaling(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_sip_credential_test.go b/internal/provider/resource_infinity_sip_credential_test.go index 4cdd46c3..7c88e351 100644 --- a/internal/provider/resource_infinity_sip_credential_test.go +++ b/internal/provider/resource_infinity_sip_credential_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinitySIPCredential(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_sip_proxy_test.go b/internal/provider/resource_infinity_sip_proxy_test.go index db52d6dd..1d147b32 100644 --- a/internal/provider/resource_infinity_sip_proxy_test.go +++ b/internal/provider/resource_infinity_sip_proxy_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinitySIPProxy(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_smtp_server_test.go b/internal/provider/resource_infinity_smtp_server_test.go index f766c1c6..19d59a7d 100644 --- a/internal/provider/resource_infinity_smtp_server_test.go +++ b/internal/provider/resource_infinity_smtp_server_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinitySMTPServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_snmp_network_management_system_test.go b/internal/provider/resource_infinity_snmp_network_management_system_test.go index a5d276a1..cfd98783 100644 --- a/internal/provider/resource_infinity_snmp_network_management_system_test.go +++ b/internal/provider/resource_infinity_snmp_network_management_system_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinitySnmpNetworkManagementSystem(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ssh_authorized_key_test.go b/internal/provider/resource_infinity_ssh_authorized_key_test.go index 78b6b719..ebd51a2e 100644 --- a/internal/provider/resource_infinity_ssh_authorized_key_test.go +++ b/internal/provider/resource_infinity_ssh_authorized_key_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinitySSHAuthorizedKey(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_ssh_password_hash_test.go b/internal/provider/resource_infinity_ssh_password_hash_test.go index 108c0d91..071537ec 100644 --- a/internal/provider/resource_infinity_ssh_password_hash_test.go +++ b/internal/provider/resource_infinity_ssh_password_hash_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -18,7 +17,6 @@ import ( func TestInfinitySSHPasswordHash(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_static_route_test.go b/internal/provider/resource_infinity_static_route_test.go index 33f659a2..cf14c481 100644 --- a/internal/provider/resource_infinity_static_route_test.go +++ b/internal/provider/resource_infinity_static_route_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityStaticRoute(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_stun_server_test.go b/internal/provider/resource_infinity_stun_server_test.go index 8f295d83..508fdff6 100644 --- a/internal/provider/resource_infinity_stun_server_test.go +++ b/internal/provider/resource_infinity_stun_server_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinityStunServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_syslog_server_test.go b/internal/provider/resource_infinity_syslog_server_test.go index 91dca1e2..0c3b80d5 100644 --- a/internal/provider/resource_infinity_syslog_server_test.go +++ b/internal/provider/resource_infinity_syslog_server_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinitySyslogServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_system_location_test.go b/internal/provider/resource_infinity_system_location_test.go index cac1e334..80e41eb0 100644 --- a/internal/provider/resource_infinity_system_location_test.go +++ b/internal/provider/resource_infinity_system_location_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinitySystemLocation(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_system_syncpoint_test.go b/internal/provider/resource_infinity_system_syncpoint_test.go index 3651b654..dcbbf3b1 100644 --- a/internal/provider/resource_infinity_system_syncpoint_test.go +++ b/internal/provider/resource_infinity_system_syncpoint_test.go @@ -7,7 +7,6 @@ package provider import ( - "os" "testing" "time" @@ -16,7 +15,7 @@ import ( "github.com/pexip/go-infinity-sdk/v38/util" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -24,7 +23,6 @@ import ( func TestInfinitySystemSyncpoint(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_system_tuneable_test.go b/internal/provider/resource_infinity_system_tuneable_test.go index 90143ec1..41f05281 100644 --- a/internal/provider/resource_infinity_system_tuneable_test.go +++ b/internal/provider/resource_infinity_system_tuneable_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinitySystemTuneable(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_teams_proxy_test.go b/internal/provider/resource_infinity_teams_proxy_test.go index 7e05455f..de245253 100644 --- a/internal/provider/resource_infinity_teams_proxy_test.go +++ b/internal/provider/resource_infinity_teams_proxy_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" @@ -21,7 +20,6 @@ import ( func TestInfinityTeamsProxy(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_tls_certificate_test.go b/internal/provider/resource_infinity_tls_certificate_test.go index ec9f9706..1ff20da7 100644 --- a/internal/provider/resource_infinity_tls_certificate_test.go +++ b/internal/provider/resource_infinity_tls_certificate_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityTLSCertificate(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_turn_server_test.go b/internal/provider/resource_infinity_turn_server_test.go index 6e4e34b5..33a7e6c1 100644 --- a/internal/provider/resource_infinity_turn_server_test.go +++ b/internal/provider/resource_infinity_turn_server_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityTurnServer(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_upgrade_test.go b/internal/provider/resource_infinity_upgrade_test.go index 91ef3e85..fd9a0afa 100644 --- a/internal/provider/resource_infinity_upgrade_test.go +++ b/internal/provider/resource_infinity_upgrade_test.go @@ -7,13 +7,12 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -21,7 +20,6 @@ import ( func TestInfinityUpgrade(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_user_group_entity_mapping_test.go b/internal/provider/resource_infinity_user_group_entity_mapping_test.go index f3ba2d93..c7d598e9 100644 --- a/internal/provider/resource_infinity_user_group_entity_mapping_test.go +++ b/internal/provider/resource_infinity_user_group_entity_mapping_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityUserGroupEntityMapping(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_user_group_test.go b/internal/provider/resource_infinity_user_group_test.go index 111a2d19..67aa2e9a 100644 --- a/internal/provider/resource_infinity_user_group_test.go +++ b/internal/provider/resource_infinity_user_group_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityUserGroup(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_web_password_hash_test.go b/internal/provider/resource_infinity_web_password_hash_test.go index cad5e63a..22a3051d 100644 --- a/internal/provider/resource_infinity_web_password_hash_test.go +++ b/internal/provider/resource_infinity_web_password_hash_test.go @@ -7,10 +7,9 @@ package provider import ( - "os" "testing" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -18,7 +17,6 @@ import ( func TestInfinityWebPasswordHash(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_webapp_alias_test.go b/internal/provider/resource_infinity_webapp_alias_test.go index 81df31d9..2ae5f8eb 100644 --- a/internal/provider/resource_infinity_webapp_alias_test.go +++ b/internal/provider/resource_infinity_webapp_alias_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityWebappAlias(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_webapp_branding_test.go b/internal/provider/resource_infinity_webapp_branding_test.go index ff758016..2595834f 100644 --- a/internal/provider/resource_infinity_webapp_branding_test.go +++ b/internal/provider/resource_infinity_webapp_branding_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityWebappBranding(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/internal/provider/resource_infinity_worker_vm_test.go b/internal/provider/resource_infinity_worker_vm_test.go index 29477f2f..14c8d353 100644 --- a/internal/provider/resource_infinity_worker_vm_test.go +++ b/internal/provider/resource_infinity_worker_vm_test.go @@ -7,14 +7,13 @@ package provider import ( - "os" "testing" "github.com/pexip/go-infinity-sdk/v38/config" "github.com/pexip/go-infinity-sdk/v38/types" "github.com/stretchr/testify/mock" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/pexip/go-infinity-sdk/v38" "github.com/pexip/terraform-provider-pexip/internal/test" @@ -22,7 +21,6 @@ import ( func TestInfinityWorkerVM(t *testing.T) { t.Parallel() - _ = os.Setenv("TF_ACC", "1") // Create a mock client and set up expectations client := infinity.NewClientMock() diff --git a/testdata/tls_certificate.pem.license b/testdata/tls_certificate.pem.license new file mode 100644 index 00000000..a048e732 --- /dev/null +++ b/testdata/tls_certificate.pem.license @@ -0,0 +1,5 @@ +/* + * SPDX-FileCopyrightText: 2025 Pexip AS + * + * SPDX-License-Identifier: Apache-2.0 + */ diff --git a/testdata/tls_private_key.pem.license b/testdata/tls_private_key.pem.license new file mode 100644 index 00000000..a048e732 --- /dev/null +++ b/testdata/tls_private_key.pem.license @@ -0,0 +1,5 @@ +/* + * SPDX-FileCopyrightText: 2025 Pexip AS + * + * SPDX-License-Identifier: Apache-2.0 + */