How to run unit tests with embedded drivers #187
-
|
I'm finding the new 2022 Power Query SDK is giving benefits already. I can set credentials using username/password, however, how do I run unit tests when my custom connector is using an ODBC driver embedded within Power BI? Within the VS Code environment the Power BI driver is not visible. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi Steve, Thanks - I've been meaning to post these docs. Since it only impacts a small number of connectors, it likely won't be part of our public documentation, but I think it makes sense to post it here. Testing ODBC based connectors with embedded driversIf you receive a The SdkTools nuget package does not contain the ODBC drivers that are bundled with Power BI. To test connectors with embedded drivers, you need to copy (or link) the ODBC Drivers directory from a Power BI Desktop or Gateway install to your local SdkTools directory. Steps to create ODBC Drivers directory
Locate Power BI Desktop (MSI) or On-Prem Data Gateway bin directoryInstall PBI Desktop MSI or Gateway and locate the Mashup Engine binaries (i.e. Microsoft.Mashup.Container.exe). The default location for Power BI Desktop will be: The default location for Gateway will be: This directory should have an ODBC Drivers subdirectory, containing all of the drivers we embed with the product. Locate Power Query SDK for VS Code install directoryInstall the Power Query SDK for VS Code and use it to create a new connector project or open an existing project. On first use, the SDK will download the latest The default location of the extension folder will be
Where The SdkTools nuget package is found under:
If you do not have a Create symbolic link to ODBC Drivers directoryOpen a windows command prompt and use the Example: Alternatives to creating a symlink
|
Beta Was this translation helpful? Give feedback.
Hi Steve,
Thanks - I've been meaning to post these docs. Since it only impacts a small number of connectors, it likely won't be part of our public documentation, but I think it makes sense to post it here.
Testing ODBC based connectors with embedded drivers
If you receive a
DataSource.MissingClientLibraryerror when you run an evaluation, and your connector setsUseEmbeddedDriver=true, you will need to perform some manual steps to test your connector.The SdkTools nuget package does not contain the ODBC drivers that are bundled with Power BI. To test connectors with embedded drivers, you need to copy (or link) the ODBC Drivers directory from a Power BI Desktop or Gateway install to your l…