Any optimum way to manage\populate data for tSQLt faketable?

24 views
Skip to first unread message

Bhavin Katrodiya

unread,
Sep 8, 2021, 1:23:25 AM9/8/21
to tSQLt
Hi Team,

I figured out some ways to manage data after faking the table like using setup SPs or manage directly inside a unit test after fake tables. Interested to know any other possible efficient ways to manage data?

Also for expected data - understand that it mainly depends on ACT but still is there any way to minimize efforts on this?

Dmitrij Kultasev

unread,
Sep 8, 2021, 1:31:39 AM9/8/21
to ts...@googlegroups.com
Hi,
what's wrong with managing initial data with setup procedures?
I guess that the second question is too broad, do you have any specific problem you are trying to solve?

--
You received this message because you are subscribed to the Google Groups "tSQLt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tsqlt+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tsqlt/0975b899-06dd-472a-aac1-0a1da44ccaa3n%40googlegroups.com.

Bhavin Katrodiya

unread,
Sep 8, 2021, 1:49:53 AM9/8/21
to tSQLt
Hi Dmitrij,

agree with you that the second question is subject to discussion. 

With setup SP, below are the encounter challenges till now?

- As setup SP invoked before every Unit test - Have to maintain expected output every time for an un-touched unit test when any data modification inside setup SP as objects consumes common tables.
- Right now implemented unit test for around 50 SPs which consume 100+ tables[still adding] and will manage data for every table inside setup - However logically every table is not part of every Unit test but its invoke un-necessary data for all table every time which may lead to higher completion time.

Dmitrij Kultasev

unread,
Sep 8, 2021, 1:56:33 AM9/8/21
to ts...@googlegroups.com
You can create several setup procedures with names other than setup, for example setup_case1, setup_case2,... in such case they won't be executed automatically for every test, but you'll have to call each procedure manually in the tests. That gives freedom with the cost of the single SP call in each unit test.

Message has been deleted

Bhavin Katrodiya

unread,
Sep 8, 2021, 2:07:38 AM9/8/21
to tSQLt
yeah. This is one of the ways in my action items.  Thanks for sharing your thoughts. 
Reply all
Reply to author
Forward
0 new messages