This repository was archived by the owner on Apr 15, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
internal/generate/templates/0.4
testing/test-cases/ciam-passwordless-flow-pack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ resource "davinci_flow" "{{.ResourceName}}" {
1313 name = var.davinci_flow_ {{.ResourceName }}_name
1414 description = var.davinci_flow_ {{.ResourceName }}_description
1515
16- flow_json = file(" {{.FlowJSONPath}} " )
16+ flow_json = var .davinci_flow_ {{ .ResourceName }}_json_file_path ! = null ? file(var .davinci_flow_ {{.ResourceName }}_json_file_path) : var .davinci_flow_ {{ .ResourceName }}_json
1717
1818{{if .ConnectionLinks }}
1919
Original file line number Diff line number Diff line change @@ -24,3 +24,24 @@ variable "davinci_flow_{{.ResourceName}}_description" {
2424 default = null
2525 {{- end }}
2626}
27+
28+ // The location of the flow file path
29+ variable " davinci_flow_{{.ResourceName}}_json_file_path" {
30+ type = string
31+
32+ description = " The filesystem location of the flow JSON with resource name '{{.ResourceName}}'. Cannot be set with the `davinci_flow_{{.ResourceName}}_json` variable."
33+ default = " {{.FlowJSONPath}}"
34+
35+ validation {
36+ condition = (var.davinci_flow_ {{.ResourceName }}_json_file_path != null || var.davinci_flow_ {{.ResourceName }}_json != null) && (var.davinci_flow_ {{.ResourceName }}_json_file_path == null || var.davinci_flow_ {{.ResourceName }}_json == null)
37+ error_message = " Must set either 'davinci_flow_{{.ResourceName}}_json_file_path' or 'davinci_flow_{{.ResourceName}}_json', but not both together."
38+ }
39+ }
40+
41+ // The raw JSON of the flow
42+ variable " davinci_flow_{{.ResourceName}}_json" {
43+ type = string
44+
45+ description = " The filesystem location of the flow JSON with resource name '{{.ResourceName}}'. Cannot be set with the `davinci_flow_{{.ResourceName}}_json_file_path` variable."
46+ default = null
47+ }
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22
33# Directory containing the files
44directory=" ./assets/flows"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e # Exit immediately if a command exits with a non-zero status
4+
5+ script_dir=$( dirname " $( realpath " $0 " ) " )
6+ echo $script_dir
7+
8+ ls $script_dir /../testing/test-cases
9+
10+ for dir in " $script_dir /../testing/test-cases" /* /; do
11+ if [ -d " $dir " ]; then
12+ echo " Running generate-test.sh in $dir "
13+ $script_dir /generate-test.sh $dir
14+ fi
15+ done
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22
33go build .
44
Original file line number Diff line number Diff line change 1- #! /bin/bash
1+ #! /usr/ bin/env bash
22
33# Directory containing the files
44directory=$1
Original file line number Diff line number Diff line change @@ -88,6 +88,50 @@ run "properties_generated" {
8888 }
8989}
9090
91+ run "flow_vars_conflicting" {
92+
93+ variables {
94+ pingone_environment_id = run. pingone_setup . pingone_environment_id
95+
96+ davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json_file_path = " assets/flows/ciam_passwordless_protect_account_recovery_subflow.json"
97+ davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json = jsonencode ({})
98+ }
99+
100+ command = plan
101+
102+ expect_failures = [
103+ var . davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json_file_path
104+ ]
105+ }
106+
107+ run "flow_vars_missing" {
108+
109+ variables {
110+ pingone_environment_id = run. pingone_setup . pingone_environment_id
111+
112+ davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json_file_path = null
113+ davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json = null
114+ }
115+
116+ command = plan
117+
118+ expect_failures = [
119+ var . davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json_file_path
120+ ]
121+ }
122+
123+ run "flow_json_override" {
124+
125+ variables {
126+ pingone_environment_id = run. pingone_setup . pingone_environment_id
127+
128+ davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json_file_path = null
129+ davinci_flow_ciam_passwordless_protect_account_recovery_subflow_json = file (" assets/flows/ciam_passwordless_protect_account_recovery_subflow.json" )
130+ }
131+
132+ command = plan
133+ }
134+
91135run "apply_success" {
92136
93137 variables {
You can’t perform that action at this time.
0 commit comments