azure.datafactory.tools icon indicating copy to clipboard operation
azure.datafactory.tools copied to clipboard

Test-AdfLinkedService return an object

Open PerJacDK opened this issue 4 years ago • 3 comments

When you specify an array of linkedServices it would be nice to receive an object (eg hash-table) over the result (passed/failed/total).

It could be implemented as follows:

`function Test-AdfLinkedService { : : Write-Host "Test connection result:" Write-Host "Passed: $ok" Write-Host "Failed: $($all-$ok)" Write-Host "Total : $all"

$result = [ordered]@{Passed = $ok; Failed = ($all-$ok); Total = $all} return $result }`

PerJacDK avatar Nov 08 '21 14:11 PerJacDK

Thanks, that's a good idea. In addition to that, would be good to:

  • return list (hash table) of tested objects with their result
  • add unit test of this method

NowinskiK avatar Nov 16 '21 20:11 NowinskiK

I just finished #151 and used updated Test-AdfLinkedService CmdLet in the automated test process and I have a couple of questions about this.

  • Should Cmdlet print anything by default if not using -Debug and/or -Verbose flags?
    • I had to use 6> /dev/null to to ignore Write-Info level because I wanted to print single "." after every Test-AdfLinkedService invocation

I will create something (without unit tests) on top of #151 quickly because this is something I needed yesterday. PR coming later.

jikuja avatar Jun 29 '22 08:06 jikuja

Yes, please. I believe every test should be logged separately as it does help with troubleshooting significantly.

NowinskiK avatar Jul 11 '22 13:07 NowinskiK