Skip to content

tests: Add provisioned-environment E2E test tier - #141

Open
samir-gandhi wants to merge 4 commits into
pingone-core-resourcesfrom
feat/provisioned-e2e-test-tier
Open

tests: Add provisioned-environment E2E test tier#141
samir-gandhi wants to merge 4 commits into
pingone-core-resourcesfrom
feat/provisioned-e2e-test-tier

Conversation

@samir-gandhi

@samir-gandhi samir-gandhi commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds terraform-test-data/ — hand-authored Terraform fixtures, starting with one representative resource (sso/population). pingone_environment itself is a fixture resource in terraform-test-data/root, so environment creation goes through the same Terraform/provider path as everything else.
  • Adds tools/tf-regression-provision — thin CLI wrapper around terraform apply/destroy plus output parsing. Holds no PingOne API logic itself; environment lifecycle and fixture provisioning are entirely expressed as Terraform, authenticated with a single org-admin credential scoped to this run.
  • Adds make e2e (backed by tests/regression-provisioned/run-local.sh), which provisions a throwaway environment, applies the fixtures, runs the existing base-vs-PR export/compare pipeline (tools/regression-compare, tests/regression/matrix.json) against it, and tears the environment down unconditionally on exit.
  • Adds .github/workflows/regression-provisioned.yaml, a single-job workflow that runs make e2e on workflow_dispatch only (no schedule yet — real environment creation/deletion per run needs cost/quota sign-off first). Reuses the exact locally-proven script rather than a multi-job pipeline, avoiding untested cross-job credential/state passing.
  • Updates .gitignore for local/ephemeral Terraform artifacts (.terraform/, lock file, state, terraform.tfvars.json) and to stop the existing blanket *.tf ignore (meant for generated export output) from swallowing the new hand-authored terraform-test-data/**/*.tf fixtures.

This is additive to tests/regression/, which is unchanged and continues comparing export output between binary versions against its existing static environment.

Base branch is pingone-core-resources, not main. The sso/population fixture requires pingone_population export support, which only exists on pingone-core-resources; main has no SSO resource support yet. This PR was rebased onto pingone-core-resources after that was discovered — the base/environment + DaVinci-only test run against main was passing but not actually exercising SSO export coverage (the base binary silently succeeded with 0 resources for an unsupported type).

Closes #140.

Test plan

  • go build ./... and go vet ./tools/tf-regression-provision/...
  • terraform validate and terraform fmt -check -recursive on terraform-test-data/
  • bash -n tests/regression-provisioned/run-local.sh
  • YAML-validated regression-provisioned.yaml
  • go mod tidy — no go.mod/go.sum changes (no new dependencies)
  • Ran make e2e live end-to-end against a real (non-prod) PingOne org, twice (once before rebase onto pingone-core-resources, once after): provisioned an environment, applied the sso/population fixture, ran all 5 matrix entries from tests/regression/matrix.json (base vs. PR export, 0 breaking / 0 acceptable diffs on each), then tore the environment down. Confirmed via a follow-up API read that the environment no longer exists after teardown, on every run.
  • Verified the cleanup path also fires and fully removes the environment on a forced mid-run failure (a real bug found and fixed during development), not just on success.
  • Fixed and re-verified a report-persistence gap found while wiring up CI: reports were written to a tempdir but never copied out before the cleanup trap deleted it, so the workflow's artifact-upload step would have found nothing.

Notes for reviewers

  • New credentials required, org-admin scoped, used only for this run's environment create/destroy: PINGCLI_PINGONE_ORGADMIN_CLIENT_ID, PINGCLI_PINGONE_ORGADMIN_CLIENT_SECRET, PINGCLI_PINGONE_ORGADMIN_ENVIRONMENT_ID, PINGCLI_PINGONE_ORGADMIN_REGION_CODE, PINGCLI_PINGONE_ORGADMIN_LICENSE_ID. Live in a new regression-provision GitHub Environment, separate from the regression Environment used by the existing static-environment regression tier.
  • terraform-test-data/ currently covers only 1 of the ~23 currently-supported resource types; follow-up PRs will expand coverage in small, dependency-ordered batches (see the tracking issue).

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Regression Test Results

Matrix Entry Status Breaking Acceptable

✅ No regressions detected

All export configurations produced compatible output.


Generated by regression workflow • View run

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Regression Test Results

Matrix Entry Status Breaking Acceptable
default-hcl ✅ PASS 0 0
default-tfjson ✅ PASS 0 0
hcl-include-all ✅ PASS 0 0
hcl-skip-deps ✅ PASS 0 0
tfjson-skip-deps ✅ PASS 0 0

✅ No regressions detected

All export configurations produced compatible output.


Generated by regression workflow • View run

@github-actions

Copy link
Copy Markdown

Regression Test Results

Matrix Entry Status Breaking Acceptable
default-hcl ✅ PASS 0 0
default-tfjson ✅ PASS 0 0
hcl-include-all ✅ PASS 0 0
hcl-skip-deps ✅ PASS 0 0
tfjson-skip-deps ✅ PASS 0 0

✅ No regressions detected

All export configurations produced compatible output.


Generated by regression workflow • View run

@github-actions

Copy link
Copy Markdown

Regression Test Results

Matrix Entry Status Breaking Acceptable
default-hcl ✅ PASS 0 0
default-tfjson ✅ PASS 0 0
hcl-include-all ✅ PASS 0 0
hcl-skip-deps ✅ PASS 0 0
tfjson-skip-deps ✅ PASS 0 0

✅ No regressions detected

All export configurations produced compatible output.


Generated by regression workflow • View run

Adds terraform-test-data/ (hand-authored Terraform fixtures per resource),
tools/tf-regression-provision (creates/destroys a throwaway PingOne
environment via Terraform itself, using org-admin credentials scoped to
this run's lifecycle), and a `make e2e` entry point that applies fixtures
into that environment and runs the existing base-vs-PR export/compare
pipeline against it. Additive to tests/regression/, which continues
comparing export output against a static environment unchanged.

Closes #140.
Previously silently defaulted to NA, inheriting the same fallback used for
the unrelated PINGCLI_PINGONE_REGION_CODE export credential elsewhere in
this repo. The org-admin credential set should always be complete and
specified on its own terms.
Adds regression-provisioned.yaml, a single-job workflow that runs the
existing tests/regression-provisioned/run-local.sh on workflow_dispatch
only (no schedule yet - real environment creation/deletion per run needs
cost/quota sign-off first). Reuses the exact locally-proven script rather
than decomposing into a multi-job pipeline, avoiding untested cross-job
credential/state passing.

Also fixes a report-persistence gap in run-local.sh found while wiring
this up: reports were written to TMPDIR_LOCAL but never copied out before
the cleanup trap deleted that directory, so the workflow's artifact-upload
step would have found nothing. Added copy_reports(), mirroring the
existing pattern in tests/regression/run-local.sh.

Verified live end-to-end locally: provision, apply, all 5 matrix entries
pass, reports land in regression-reports/, teardown confirmed via a
follow-up API read (404).
@samir-gandhi
samir-gandhi force-pushed the feat/provisioned-e2e-test-tier branch from 0ca2efc to f71304a Compare August 12, 2026 17:43
@samir-gandhi
samir-gandhi changed the base branch from main to pingone-core-resources August 12, 2026 17:43
@github-actions

Copy link
Copy Markdown

Regression Test Results

Matrix Entry Status Breaking Acceptable

✅ No regressions detected

All export configurations produced compatible output.


Generated by regression workflow • View run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add provisioned-environment E2E test tier (terraform-test-data + make e2e)

1 participant