Skip to content

Commit 66a8d92

Browse files
OKTA-995128 | Fixing VCR Test Failures (#2445)
1 parent ee55349 commit 66a8d92

8 files changed

Lines changed: 786 additions & 2187 deletions

File tree

.circleci/config.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: 2.1
22

33
orbs:
44
platform-helpers: okta/platform-helpers@1
5+
general-platform-helpers: okta/general-platform-helpers@1.9
56
python: circleci/python@2.0.3
67
aws-cli: circleci/aws-cli@5.1
78

@@ -49,6 +50,16 @@ jobs:
4950
--commit $CIRCLE_SHA1 \
5051
--build-env "circleci" \
5152
--suppress_output
53+
snyk-scan:
54+
docker:
55+
- image: cimg/go:1.23.0
56+
steps:
57+
- checkout
58+
- general-platform-helpers/step-load-dependencies
59+
- general-platform-helpers/step-run-snyk-monitor:
60+
scan-all-projects: false
61+
skip-unresolved: false
62+
run-on-non-main: true
5263

5364
workflows:
5465
# See OKTA-634442
@@ -58,6 +69,10 @@ workflows:
5869
name: "Scan with Semgrep"
5970
context:
6071
- static-analysis
72+
- snyk-scan:
73+
name: execute-snyk
74+
context:
75+
- static-analysis
6176
"Malware Scanner":
6277
jobs:
6378
- reversing-labs:

examples/resources/okta_policy_rule_signon/basic.tf

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,8 @@ resource "okta_policy_signon" "test" {
99
groups_included = [data.okta_group.all.id]
1010
}
1111

12-
resource "okta_policy_signon" "test_two" {
13-
name = "test_two"
14-
status = "ACTIVE"
15-
description = "Terraform Acceptance Test SignOn Policy"
16-
groups_included = [data.okta_group.all.id]
17-
}
18-
19-
resource "okta_policy_rule_signon" "test_risk_ONLY" {
20-
policy_id = okta_policy_signon.test_two.id
21-
name = "test_policy_risk_ONLY"
22-
status = "ACTIVE"
23-
risk_level = "ANY"
12+
resource "okta_policy_rule_signon" "test" {
13+
policy_id = okta_policy_signon.test.id
14+
name = "testAcc_replace_with_uuid"
15+
status = "ACTIVE"
2416
}
25-
26-
resource "okta_policy_rule_signon" "test_risc_ONLY" {
27-
policy_id = okta_policy_signon.test_two.id
28-
name = "test_policy_risc_ONLY"
29-
status = "ACTIVE"
30-
risc_level = "MEDIUM"
31-
}
32-
33-
resource "okta_policy_rule_signon" "test_BOTH" {
34-
policy_id = okta_policy_signon.test_two.id
35-
name = "test_policy_BOTH"
36-
status = "ACTIVE"
37-
risk_level = "LOW"
38-
risc_level = "HIGH"
39-
}
40-

examples/resources/okta_policy_rule_signon/basic_updated.tf

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ resource "okta_policy_signon" "test" {
1616
groups_included = [data.okta_group.all.id]
1717
}
1818

19-
resource "okta_policy_signon" "test_two" {
20-
name = "test_two"
21-
status = "ACTIVE"
22-
description = "Terraform Acceptance Test SignOn Policy"
23-
groups_included = [data.okta_group.all.id]
24-
}
25-
2619
resource "okta_policy_rule_signon" "test" {
2720
policy_id = okta_policy_signon.test.id
2821
name = "testAcc_replace_with_uuid"
@@ -33,25 +26,3 @@ resource "okta_policy_rule_signon" "test" {
3326
session_persistent = false
3427
users_excluded = [okta_user.test.id]
3528
}
36-
37-
resource "okta_policy_rule_signon" "test_risk_ONLY" {
38-
policy_id = okta_policy_signon.test_two.id
39-
name = "test_policy_risk_ONLY"
40-
status = "ACTIVE"
41-
risk_level = "MEDIUM"
42-
}
43-
44-
resource "okta_policy_rule_signon" "test_risc_ONLY" {
45-
policy_id = okta_policy_signon.test_two.id
46-
name = "test_policy_risc_ONLY"
47-
status = "ACTIVE"
48-
risc_level = "HIGH"
49-
}
50-
51-
resource "okta_policy_rule_signon" "test_BOTH" {
52-
policy_id = okta_policy_signon.test_two.id
53-
name = "test_policy_BOTH"
54-
status = "ACTIVE"
55-
risk_level = "MEDIUM"
56-
risc_level = "HIGH"
57-
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
data "okta_group" "all" {
2+
name = "Everyone"
3+
}
4+
5+
resource "okta_policy_signon" "test" {
6+
name = "testAcc_replace_with_uuid"
7+
status = "ACTIVE"
8+
description = "Terraform Acceptance Test SignOn Policy"
9+
groups_included = [data.okta_group.all.id]
10+
}
11+
12+
resource "okta_policy_signon" "test_two" {
13+
name = "test_two"
14+
status = "ACTIVE"
15+
description = "Terraform Acceptance Test SignOn Policy"
16+
groups_included = [data.okta_group.all.id]
17+
}
18+
19+
resource "okta_policy_rule_signon" "test_risk_ONLY" {
20+
policy_id = "00ppe8c4f0jC1KpxX1d7"
21+
name = "test_policy_risk_ONLY"
22+
status = "ACTIVE"
23+
risk_level = "ANY"
24+
}
25+
26+
resource "okta_policy_rule_signon" "test_risc_ONLY" {
27+
policy_id = "00ppe8c4f0jC1KpxX1d7"
28+
name = "test_policy_risc_ONLY"
29+
status = "ACTIVE"
30+
risc_level = "MEDIUM"
31+
}
32+
33+
resource "okta_policy_rule_signon" "test_BOTH" {
34+
policy_id = "00ppe8c4f0jC1KpxX1d7"
35+
name = "test_policy_BOTH"
36+
status = "ACTIVE"
37+
risk_level = "LOW"
38+
risc_level = "HIGH"
39+
}
40+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resource "okta_policy_rule_signon" "test_risk_ONLY" {
2+
policy_id = "00ppe8c4f0jC1KpxX1d7"
3+
name = "test_policy_risk_ONLY"
4+
status = "ACTIVE"
5+
risk_level = "MEDIUM"
6+
}
7+
8+
resource "okta_policy_rule_signon" "test_risc_ONLY" {
9+
policy_id = "00ppe8c4f0jC1KpxX1d7"
10+
name = "test_policy_risc_ONLY"
11+
status = "ACTIVE"
12+
risc_level = "HIGH"
13+
}
14+
15+
resource "okta_policy_rule_signon" "test_BOTH" {
16+
policy_id = "00ppe8c4f0jC1KpxX1d7"
17+
name = "test_policy_BOTH"
18+
status = "ACTIVE"
19+
risk_level = "MEDIUM"
20+
risc_level = "HIGH"
21+
}

okta/services/idaas/resource_okta_policy_rule_sign_on_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func TestAccResourceOktaPolicyRuleSignon_defaultErrors(t *testing.T) {
3131

3232
func TestAccResourceOktaPolicyRuleSignon_GH2419(t *testing.T) {
3333
mgr := newFixtureManager("resources", resources.OktaIDaaSPolicyRuleSignOn, t.Name())
34-
config := mgr.GetFixtures("basic.tf", t)
35-
updatedConfig := mgr.GetFixtures("basic_updated.tf", t)
34+
config := mgr.GetFixtures("gh2419.tf", t)
35+
updatedConfig := mgr.GetFixtures("gh2419_updated.tf", t)
3636
resourceName := fmt.Sprintf("%s.test_risk_ONLY", resources.OktaIDaaSPolicyRuleSignOn)
3737
resourceName2 := fmt.Sprintf("%s.test_risc_ONLY", resources.OktaIDaaSPolicyRuleSignOn)
3838
resourceName3 := fmt.Sprintf("%s.test_BOTH", resources.OktaIDaaSPolicyRuleSignOn)
@@ -46,13 +46,9 @@ func TestAccResourceOktaPolicyRuleSignon_GH2419(t *testing.T) {
4646
{
4747
Config: config,
4848
Check: resource.ComposeTestCheckFunc(
49-
ensureRuleExists(resourceName), resource.TestCheckResourceAttr(resourceName, "name", "test_policy_risk_ONLY"),
50-
ensureRuleExists(resourceName2), resource.TestCheckResourceAttr(resourceName2, "name", "test_policy_risc_ONLY"),
51-
ensureRuleExists(resourceName3), resource.TestCheckResourceAttr(resourceName3, "name", "test_policy_BOTH"),
5249
resource.TestCheckResourceAttr(resourceName, "status", idaas.StatusActive),
5350
resource.TestCheckResourceAttr(resourceName2, "status", idaas.StatusActive),
5451
resource.TestCheckResourceAttr(resourceName3, "status", idaas.StatusActive),
55-
resource.TestCheckResourceAttr(resourceName, "status", idaas.StatusActive),
5652
resource.TestCheckResourceAttr(resourceName, "risk_level", "ANY"),
5753
resource.TestCheckResourceAttr(resourceName2, "risc_level", "MEDIUM"),
5854
resource.TestCheckResourceAttr(resourceName3, "risk_level", "LOW"),
@@ -62,13 +58,9 @@ func TestAccResourceOktaPolicyRuleSignon_GH2419(t *testing.T) {
6258
{
6359
Config: updatedConfig,
6460
Check: resource.ComposeTestCheckFunc(
65-
ensureRuleExists(resourceName), resource.TestCheckResourceAttr(resourceName, "name", "test_policy_risk_ONLY"),
66-
ensureRuleExists(resourceName2), resource.TestCheckResourceAttr(resourceName2, "name", "test_policy_risc_ONLY"),
67-
ensureRuleExists(resourceName3), resource.TestCheckResourceAttr(resourceName3, "name", "test_policy_BOTH"),
6861
resource.TestCheckResourceAttr(resourceName, "status", idaas.StatusActive),
6962
resource.TestCheckResourceAttr(resourceName2, "status", idaas.StatusActive),
7063
resource.TestCheckResourceAttr(resourceName3, "status", idaas.StatusActive),
71-
resource.TestCheckResourceAttr(resourceName, "status", idaas.StatusActive),
7264
resource.TestCheckResourceAttr(resourceName, "risk_level", "MEDIUM"),
7365
resource.TestCheckResourceAttr(resourceName2, "risc_level", "HIGH"),
7466
resource.TestCheckResourceAttr(resourceName3, "risk_level", "MEDIUM"),

0 commit comments

Comments
 (0)