microsoft / PowerApps-TestEngine

MIT License
101 stars 29 forks source link

Changed RunTestAsync input argument types to actual types #227

Closed arpavan closed 1 year ago

arpavan commented 1 year ago

Description

The contract for the entry point function RunTestAsync currently only expected string data types for all its input arguments. This compromises type-safety, especially once this library is consumed by client applications like PAC CLI. One of the recommendations to make this more robust is to modify the contract for RunTestAsync to expect actual types for all of its input arguments wherever possible.

This pull request primarily covers making this change to the contract to support robust type-safety - the RunTestAsync function signature is now RunTestAsync(FileInfo testConfigFile, string environmentId, Guid tenantId, DirectoryInfo outputDirectory, string domain, string queryParams). With this change, there is a change to how optional arguments are handled - now the class library is no longer required to set defaults to optional arguments, and this responsibility is now delegated away to the client - for example, PAC CLI. This way the client is free to choose what the default values are for optional arguments and how they can handle invalid/missing values for all arguments. PAC CLI already has built-in mechanisms to validate mandatory arguments.

This change has brought along several changes, which I have listed below -

Checklist

github-actions[bot] commented 1 year ago

Code Coverage

Package Line Rate Branch Rate Complexity Health
Microsoft.PowerApps.TestEngine 91% 88% 817
Summary 91% (2160 / 2381) 88% (497 / 562) 817

Minimum allowed line rate is 50%