1
1
package io .kestra .core .runners ;
2
2
3
+ import io .kestra .core .exceptions .IllegalVariableEvaluationException ;
4
+ import io .kestra .core .models .executions .Execution ;
5
+ import io .kestra .core .models .flows .DependsOn ;
3
6
import io .kestra .core .models .flows .Flow ;
7
+ import io .kestra .core .models .flows .Type ;
8
+ import io .kestra .core .models .flows .input .BoolInput ;
9
+ import io .kestra .core .models .property .Property ;
4
10
import io .kestra .core .models .property .PropertyContext ;
5
11
import io .kestra .core .models .tasks .Task ;
6
12
import io .kestra .core .models .triggers .AbstractTrigger ;
13
+ import io .kestra .core .runners .pebble .functions .SecretFunction ;
14
+ import io .kestra .core .utils .IdUtils ;
15
+ import io .micronaut .context .ApplicationContext ;
7
16
import org .junit .jupiter .api .Assertions ;
8
17
import org .junit .jupiter .api .Test ;
9
18
import org .mockito .Mockito ;
10
19
20
+ import java .util .Collections ;
21
+ import java .util .List ;
11
22
import java .util .Map ;
12
23
13
24
import static org .assertj .core .api .Assertions .assertThat ;
@@ -112,4 +123,25 @@ void shouldGetKestraConfiguration() {
112
123
assertThat (kestra .get ("environment" )).isEqualTo ("test" );
113
124
assertThat (kestra .get ("url" )).isEqualTo ("http://localhost:8080" );
114
125
}
115
- }
126
+
127
+ @ Test
128
+ void nonResolvableDynamicInputsShouldBeSkipped () throws IllegalVariableEvaluationException {
129
+ Map <String , Object > variables = new RunVariables .DefaultBuilder ()
130
+ .withFlow (Flow
131
+ .builder ()
132
+ .namespace ("a.b" )
133
+ .id ("c" )
134
+ .inputs (List .of (
135
+ BoolInput .builder ().id ("a" ).type (Type .BOOL ).defaults (Property .ofValue (true )).build (),
136
+ BoolInput .builder ().id ("b" ).type (Type .BOOL ).dependsOn (new DependsOn (List .of ("a" ), null )).defaults (Property .ofExpression ("{{inputs.a == true}}" )).build ()
137
+ ))
138
+ .build ()
139
+ )
140
+ .withExecution (Execution .builder ().id (IdUtils .create ()).build ())
141
+ .build (new RunContextLogger (), PropertyContext .create (new VariableRenderer (Mockito .mock (ApplicationContext .class ), Mockito .mock (VariableRenderer .VariableConfiguration .class ), Collections .emptyList ())));
142
+
143
+ Assertions .assertEquals (Map .of (
144
+ "a" , true
145
+ ), variables .get ("inputs" ));
146
+ }
147
+ }
0 commit comments