Skip to content

Commit f7b93f7

Browse files
committed
WIP
1 parent e4f3261 commit f7b93f7

File tree

2 files changed

+50
-9
lines changed

2 files changed

+50
-9
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,54 @@ jobs:
1919
tests:
2020
name: run
2121
runs-on: ubuntu-latest
22-
timeout-minutes: 60
22+
timeout-minutes: 40
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
# If you adjust these parameters, also adjust the jrm input files on the "Merge reports" step below
27+
total: [ 5 ]
28+
index: [ 0, 1, 2, 3, 4 ]
29+
steps:
30+
- name: Fetch Outputs
31+
id: tflocal
32+
uses: hashicorp-forge/terraform-cloud-action/outputs@5583d5f554d268ac91b3c37fd0a5e9da2c78c017 # v1.1.0
33+
with:
34+
token: "${{ secrets.TF_WORKFLOW_TFLOCAL_CLOUD_TFC_TOKEN }}"
35+
organization: hashicorp-v2
36+
workspace: tflocal-terraform-provider-tfe
37+
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
40+
- uses: ./.github/actions/test-provider-tfe
41+
with:
42+
matrix_index: ${{ matrix.index }}
43+
matrix_total: ${{ matrix.total }}
44+
hostname: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).ngrok_domain }}
45+
token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_token }}
46+
testing-github-token: ${{ secrets.TESTING_GITHUB_TOKEN }}
47+
admin_configuration_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.configuration }}
48+
admin_provision_licenses_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.provision-licenses }}
49+
admin_security_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.security-maintenance }}
50+
admin_site_admin_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.site-admin }}
51+
admin_subscription_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.subscription }}
52+
admin_support_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.support }}
53+
admin_version_maintenance_token: ${{ fromJSON(steps.tflocal.outputs.workspace-outputs-json).tfe_admin_token_by_role.version-maintenance }}
54+
# Run terminal cmd 'go help testflag' to learn more about -list flag
55+
# action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests
56+
# which runs against all tests using the list arg
57+
# lists_tests regex is used to skip the TestAccTFESAMLSettings_omnibus test suite and any test matching TestAcc*_RunDependent for CI tests only
58+
list_tests: "[^(TestAccTFESAMLSettings_omnibus|TestAcc.*_RunDependent)]"
59+
60+
run-dependent-tests:
61+
name: run
62+
runs-on: ubuntu-latest
63+
timeout-minutes: 40
2364
strategy:
2465
fail-fast: false
2566
matrix:
2667
# If you adjust these parameters, also adjust the jrm input files on the "Merge reports" step below
2768
total: [ 1 ]
28-
index: [ 0 ]
69+
index: [ 5 ]
2970
steps:
3071
- name: Fetch Outputs
3172
id: tflocal
@@ -54,8 +95,8 @@ jobs:
5495
# Run terminal cmd 'go help testflag' to learn more about -list flag
5596
# action.yml uses https://github.com/hashicorp-forge/go-test-split-action/blob/main/action.yml to split acceptance tests
5697
# which runs against all tests using the list arg
57-
# lists_tests regex is used to skip the TestAccTFESAMLSettings_omnibus test suite for CI tests only
58-
list_tests: "[^(TestAccTFESAMLSettings_omnibus)]"
98+
# lists_tests regex is used to include the TestAccTFESAMLSettings_omnibus test suite and skip any test matching TestAcc*_RunDependent for CI tests only
99+
list_tests: "^(?!(?:TestAccTFESAMLSettings_omnibus$|TestAcc.*_RunDependent$)).*"
59100

60101
tests-combine-summaries:
61102
name: Combine Test Reports
@@ -73,7 +114,7 @@ jobs:
73114
run: npm install -g junit-report-merger
74115

75116
- name: Merge reports
76-
run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml"
117+
run: jrm ./ci-summary-provider.xml "junit-test-summary-0/*.xml" "junit-test-summary-1/*.xml" "junit-test-summary-2/*.xml" "junit-test-summary-3/*.xml" "junit-test-summary-4/*.xml" "junit-test-summary-5/*.xml"
77118

78119
- name: Upload test artifacts
79120
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

internal/provider/resource_tfe_workspace_run_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/hashicorp/terraform-plugin-testing/terraform"
1616
)
1717

18-
func TestAccTFEWorkspaceRun_withApplyOnlyBlock(t *testing.T) {
18+
func TestAccTFEWorkspaceRun_withApplyOnlyBlock_RunDependent(t *testing.T) {
1919
skipUnlessBeta(t)
2020
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
2121

@@ -65,7 +65,7 @@ func TestAccTFEWorkspaceRun_withApplyOnlyBlock(t *testing.T) {
6565
})
6666
}
6767

68-
func TestAccTFEWorkspaceRun_withBothApplyAndDestroyBlocks(t *testing.T) {
68+
func TestAccTFEWorkspaceRun_withBothApplyAndDestroyBlocks_RunDependent(t *testing.T) {
6969
skipUnlessBeta(t)
7070
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
7171

@@ -115,7 +115,7 @@ func TestAccTFEWorkspaceRun_withBothApplyAndDestroyBlocks(t *testing.T) {
115115
})
116116
}
117117

118-
func TestAccTFEWorkspaceRun_invalidParams(t *testing.T) {
118+
func TestAccTFEWorkspaceRun_invalidParams_RunDependent(t *testing.T) {
119119
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
120120

121121
tfeClient, err := getClientUsingEnv()
@@ -156,7 +156,7 @@ func TestAccTFEWorkspaceRun_invalidParams(t *testing.T) {
156156
}
157157
}
158158

159-
func TestAccTFEWorkspaceRun_WhenRunErrors(t *testing.T) {
159+
func TestAccTFEWorkspaceRun_WhenRunErrors_RunDependent(t *testing.T) {
160160
rInt := rand.New(rand.NewSource(time.Now().UnixNano())).Int()
161161

162162
tfeClient, err := getClientUsingEnv()

0 commit comments

Comments
 (0)