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' {
2121 $out.capabilities | Should - BeExactly @ (' discover' )
2222 $out.manifest | Should -Not - BeNullOrEmpty
2323 }
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+ }
2453}
Original file line number Diff line number Diff line change 1010 " -NonInteractive" ,
1111 " -NoProfile" ,
1212 " -Command" ,
13- " '{\" Output\" : \" One\" }'"
13+ " '{\" Output\" : \" Hello One\" }'"
1414 ]
1515 },
1616 "schema" : {
Original file line number Diff line number Diff line change 1010 " -NonInteractive" ,
1111 " -NoProfile" ,
1212 " -Command" ,
13- " '{\" Output\" : \" Two\" }'"
13+ " '{\" Output\" : \" Hello Two\" }'"
1414 ]
1515 },
1616 "schema" : {
You can’t perform that action at this time.
0 commit comments