Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/pr-141.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:internal
Added a provisioned-environment E2E test tier (`terraform-test-data/`, `tools/tf-regression-provision`, `make e2e`) that provisions a throwaway PingOne environment via Terraform, applies hand-authored fixture resources, and runs the existing base-vs-PR export/compare pipeline against it. Additive to the existing `tests/regression/` tier; not yet wired into CI.
```
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.so
*.dylib
davinci-convert
/tf-regression-provision

# Test binary, built with `go test -c`
*.test
Expand Down Expand Up @@ -44,8 +45,19 @@ dist/
!**/testdata/**/*.json
!tests/regression/matrix.json
!**/testdata/**/*.tf
!terraform-test-data/**/*.tf
localsecrets

# Terraform working directories (terraform-test-data/ is applied by
# tools/tf-regression-provision; these are always local/ephemeral)
.terraform/
.terraform.lock.hcl
*.tfstate
*.tfstate.*
terraform.tfvars.json
crash.log
crash.*.log

pingcli-terraformer

# Local regression test reports
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ regression-local: build
if [ $$EXIT_CODE -ne 0 ]; then exit $$EXIT_CODE; fi; \
echo "==> Regression test passed."

e2e: build
@echo "==> Running provisioned-environment E2E test..."
@./tests/regression-provisioned/run-local.sh

devcheck: build vet fmt lint test testacc

devchecknotest: build vet fmt lint test

.PHONY: build install test testacc testcoverage vet depscheck lint golangcilint fmt clean regression-local devcheck devchecknotest
.PHONY: build install test testacc testcoverage vet depscheck lint golangcilint fmt clean regression-local e2e devcheck devchecknotest
30 changes: 30 additions & 0 deletions terraform-test-data/root/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Composition root for terraform-test-data fixtures. Applied by
# tools/tf-regression-provision using org-admin credentials, which both
# create the throwaway environment (pingone_environment below) and
# authenticate every fixture resource inside it - one provider config, one
# dependency graph, one state. Fixture modules get added here in dependency
# order as terraform-test-data grows (see contributing docs for the rollout
# sequencing).

provider "pingone" {
environment_id = var.org_admin_environment_id
client_id = var.org_admin_client_id
client_secret = var.org_admin_client_secret
region_code = var.region_code
}

resource "pingone_environment" "this" {
name = var.environment_name
description = "Throwaway environment for the pingcli-plugin-terraformer provisioned-environment E2E test. Safe to delete."
type = "SANDBOX"
license_id = var.license_id

services = [
{ type = "SSO" },
]
}

module "sso_population" {
source = "../sso/population"
environment_id = pingone_environment.this.id
}
4 changes: 4 additions & 0 deletions terraform-test-data/root/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "environment_id" {
description = "ID of the throwaway environment created by this apply."
value = pingone_environment.this.id
}
30 changes: 30 additions & 0 deletions terraform-test-data/root/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
variable "org_admin_environment_id" {
description = "Home environment of the org-admin worker application used to authenticate the provider."
type = string
}

variable "org_admin_client_id" {
description = "Client ID of the org-admin worker application."
type = string
}

variable "org_admin_client_secret" {
description = "Client secret of the org-admin worker application."
type = string
sensitive = true
}

variable "region_code" {
description = "PingOne region code (NA, EU, AP, CA, AU, SG)."
type = string
}

variable "license_id" {
description = "License ID to assign to the throwaway environment created by this run."
type = string
}

variable "environment_name" {
description = "Name for the throwaway environment created by this run."
type = string
}
10 changes: 10 additions & 0 deletions terraform-test-data/root/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.5"

required_providers {
pingone = {
source = "pingidentity/pingone"
version = "1.16.0-beta.2"
}
}
}
10 changes: 10 additions & 0 deletions terraform-test-data/sso/population/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variable "environment_id" {
description = "ID of the environment to create this population in."
type = string
}

resource "pingone_population" "e2e" {
environment_id = var.environment_id
name = "pingcli-terraformer-e2e-population"
description = "Minimal population fixture for the provisioned-environment E2E test."
}
7 changes: 7 additions & 0 deletions terraform-test-data/sso/population/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform {
required_providers {
pingone = {
source = "pingidentity/pingone"
}
}
}
Loading
Loading