Seddryck / NBi

NBi is a testing framework (add-on to NUnit) for Business Intelligence and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# or Java code to specify your tests! Either, you don't need Visual Studio or Eclipse to compile your test suite. Just create an Xml file and let the framework interpret it and play your tests. The framework is designed as an add-on of NUnit but with the possibility to port it easily to other testing frameworks.
http://www.nbi.io
Apache License 2.0
106 stars 37 forks source link

Iterate over multiple SQL files from Directory and validate syntax #674

Open shiv24saxena opened 2 years ago

shiv24saxena commented 2 years ago

Hi,

I have multiple SQL files (contain create view statement) in a directory, whose syntax I want to validate through NBi. However I am not able to iterate over the files and pass it to my query execution. Below is the snippet of my testsuite.

image

Seddryck commented 2 years ago

What's the error that you're receiving with this snippet?

shiv24saxena commented 2 years ago

Thanks Seddryck for your response. It's not able to resolve file path (see attached screenshot). Files are present in C:/Test directory so in file attribute of query section I should get C:/TEST/DIM_ABC_VIEW.sql for DIM_ABC_VIEW.sql & C:/Test/DIM_ADJ_VIEW.sql for DIM_ADJ_VIEW.sql image

Seddryck commented 2 years ago

Have you tried to use file="~{@sqlview}" ?

See doc at http://www.nbi.io/docs/primitive-result-set/#external-definition

shiv24saxena commented 2 years ago

Yes, I tried, It throws similar error. Framework is not able to resolve variable in file attribute. image

image

Seddryck commented 2 years ago

Huuum, i think that the variables are not supported for execution. Something to add in framework.

shiv24saxena commented 2 years ago

Thanks for the reply. Is there any way to meet the below requirement with NBi? "Validate Syntax of multiple view , by reading definition from SQL files (1 file per view) present in a directory"

Seddryck commented 2 years ago

Unfortunately not and I'm really busy with a huge migration to the v2.0 of NBi so I won't include this soon. But I'm adding that as a feature of v2.1

shiv24saxena commented 2 years ago

Thanks. Eagerly waiting for new major release 2.0, any tentative release date :)