diff --git a/.github/actions/test-provider-tfe/action.yml b/.github/actions/test-provider-tfe/action.yml index d2a34ad26..c55f26da9 100644 --- a/.github/actions/test-provider-tfe/action.yml +++ b/.github/actions/test-provider-tfe/action.yml @@ -43,6 +43,10 @@ inputs: enterprise: description: Test enterprise features (`hostname` must be running in ON_PREM mode) required: false + list_tests: + description: Accepts regex rules to either include or exclude specific tests from running in either CI or nightly workflows. + required: false + default: "." runs: using: composite @@ -79,6 +83,8 @@ runs: index: ${{ inputs.matrix_index }} total: ${{ inputs.matrix_total }} junit-summary: ./ci-summary-provider.xml + # When tests are split and run concurrently, lists_tests arg in ci.yml will skip the TestAccTFESAMLSettings_omnibus test suite + list: ${{ inputs.list_tests }} - name: Run Tests shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b5743447..2289a0e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,11 @@ jobs: admin_subscription_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.subscription }} admin_support_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.support }} admin_version_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.version-maintenance }} + # Run terminal cmd 'go help testflag' to learn more about -list flag + # action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests + # which runs against all tests using the list arg + # lists_tests regex is used to skip the TestAccTFESAMLSettings_omnibus test suite for CI tests only + list_tests: "[^(TestAccTFESAMLSettings_omnibus)]" tests-combine-summaries: name: Combine Test Reports diff --git a/internal/provider/resource_tfe_saml_settings_test.go b/internal/provider/resource_tfe_saml_settings_test.go index d057a17a6..a8bbb2b65 100644 --- a/internal/provider/resource_tfe_saml_settings_test.go +++ b/internal/provider/resource_tfe_saml_settings_test.go @@ -27,6 +27,9 @@ const testResourceName = "tfe_saml_settings.foobar" // different test runner partitions in CI, then they will inevitably flake, as // tests running concurrently in different containers will be competing to set // the same shared global state in the TFE instance. + +// TestAccTFESAMLSettings_omnibus test suite is skipped in the CI, and will only run in TFE Nightly workflow +// Should this test name ever change, you will also need to update the regex in ci.yml func TestAccTFESAMLSettings_omnibus(t *testing.T) { t.Run("basic SAML settings resource", func(t *testing.T) { s := tfe.AdminSAMLSetting{