File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
extensions/test/discover/resources Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,33 @@ Describe 'Discover extension tests' {
21
21
$out.capabilities | Should - BeExactly @ (' discover' )
22
22
$out.manifest | Should -Not - BeNullOrEmpty
23
23
}
24
+
25
+ It ' Filtering works for extension discovered resources' {
26
+ $out = dsc resource list ' *Discovered*' | ConvertFrom-Json
27
+ $LASTEXITCODE | Should - Be 0
28
+ $out.Count | Should - Be 2
29
+ $out [0 ].type | Should - Be ' Test/DiscoveredOne'
30
+ $out [1 ].type | Should - Be ' Test/DiscoveredTwo'
31
+ $out [0 ].kind | Should - Be ' Resource'
32
+ $out [1 ].kind | Should - Be ' Resource'
33
+ }
34
+
35
+ It ' Extension resources can be used in config' {
36
+ $config_yaml = @"
37
+ `$ schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
38
+ contentVersion: 1.0.0.0
39
+ resources:
40
+ - name: One
41
+ type: Test/DiscoveredOne
42
+ - name: Two
43
+ type: Test/DiscoveredTwo
44
+ "@
45
+ $out = dsc config get - i $config_yaml | ConvertFrom-Json
46
+ $LASTEXITCODE | Should - Be 0
47
+ $out.results.Count | Should - Be 2
48
+ $out.results [0 ].type | Should - BeExactly ' Test/DiscoveredOne'
49
+ $out.results [0 ].result.actualState.Output | Should - BeExactly ' Hello One'
50
+ $out.results [1 ].type | Should - BeExactly ' Test/DiscoveredTwo'
51
+ $out.results [1 ].result.actualState.Output | Should - BeExactly ' Hello Two'
52
+ }
24
53
}
Original file line number Diff line number Diff line change 10
10
" -NonInteractive" ,
11
11
" -NoProfile" ,
12
12
" -Command" ,
13
- " '{\" Output\" : \" One\" }'"
13
+ " '{\" Output\" : \" Hello One\" }'"
14
14
]
15
15
},
16
16
"schema" : {
Original file line number Diff line number Diff line change 10
10
" -NonInteractive" ,
11
11
" -NoProfile" ,
12
12
" -Command" ,
13
- " '{\" Output\" : \" Two\" }'"
13
+ " '{\" Output\" : \" Hello Two\" }'"
14
14
]
15
15
},
16
16
"schema" : {
You can’t perform that action at this time.
0 commit comments