DataConnectors icon indicating copy to clipboard operation
DataConnectors copied to clipboard

Initial commit for Test Framework

Open KazimM-BQ opened this issue 5 months ago • 1 comments

Added the Power Query SDK Test Framework. The PQ SDK Test Framework consists of prebuilt test suite to easily validate any extension connectors. It contains the following:

The test data for Power Query SDK Test Framework along with the schema are provided to be loaded in the data source the extension connector needs to be tested for. Below are the files added:

  • nyc_taxi_tripdata.csv file which contains 10000 rows sampled from the February 2023 green trip data
  • taxi+_zone_lookup.csv file which contains 265 rows from the taxi zone lookup table
  • PQSDKTestFrameworkDataSchema.sql file contains the schema for NyxTaxiGreen and TaxiZoneLookup table

The test framework is prebuilt test suite to run using the pqtest.exe compare command and tests in PQ/PQOut format. The test framework consists of the following:

TestSuites folder: This folder contains all the pre-built tests for testing a connector. This folder contains two sets of tests present under Sanity & Standard folders:

  • Sanity folder: The sanity tests validate that the tests are able to connect to the data source and the test tables with correct schema exist in the datasource. There are also tests that validate the rowcount and data of NYCTaxiGreen and TaxiZoneLookup tables in the datasource.
  • Standard folder: The standard sets contain various tests that need to validate the connector. There are tests to test all the datatypes, Math, Date, Time, Text functions and operators. There are tests to validate joins between two tables as well.

ConnectorConfigs folder: This folder contains a folder with the connector name for connector to be tested which contains ParameterQueries & Settings. Samples are provided for snowflake, bigquery, spark and generic connectors.

  • ParameterQueries folder: It will be present under a folder with the connector name and contains the parameter query file(s) which are M queries to connect to the data source and retrieve the NycTaxiGreen & TaxiZoneLookup tables.
  • Settings folder: It contains folders with the name of the data source extension connectors where the test folder and the parameter query file locations are specified.

RunPQSDKTestSuites.ps1: This script will execute all PQ/PQOut tests present in the Sanity & Standard folders and generate the results.

RunPQSDKTestSuitesSettings.json: This json file can be used to provide all the arguments that can be passed to RunPQSDKTestSuites.ps1.

RunPQSDKTestSuitesSettingsTemplate.json: This json file contains all the arguments that you can set in RunPQSDKTestSuitesSettings.json file.

Please review the documentation from the link aka.ms/PowerQuerySDKDocs for more information on running tests with PQTest.exe in PQ/PQOut format.

KazimM-BQ avatar Jan 31 '24 16:01 KazimM-BQ