You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to if there is any internal variable that stores the test case name in it , so that I could use this in my --%beforetest annotation , to handle input data.
Hi @lwasylow ,
This is related to data setup.
For my test scenario , I need to insert rows in 20 tables. My approach is
Create external tables for each of the table for the first time and store the data in it and use it each time the test runs . This is kind of one time setup for that test case.
for example for the original table employee , I will create an external table as tst_employee using "orgnization external" .
Create table tst_employee
organization external
( type oracle_datapump
default directory TEST_LOG
location ('tst_employee.dmp' )
) as select * from employee where customer_ref= 'tst_bv_spend_cap'.
Store this tst_employee.dmp file in a directory called 'test_case_name' in unix.
3.Likewise if there are 10 test cases I would like to create 10 tst_employee.dmp files with relevant to each of the test cases and keep in each of those directories.
With this my data creation part is done. Now I will clear all the data from original tables . i.e delete from employee.
When I ran my test case , as part of --%beforetest , I am calling my data_setup procedure , in which I am planning to use'insert into employee select * from tst_employee'to populate the data in employee so that my original code to be test would use.
Now I have 10 unix directories in which 10 different data setup files are present which will be used by 10 different test cases.
7.For each test case I will copy the relevant file .dmp file to a directory called working directory and will remove once the test is completed .
As my test_case_name and unix directory name are same here I am planning to use the test_case_name in a script to copy the file from test case unix directory to working directory. In this way I don't have to create multiple all_directory entries .
As my data_setup procedure doesn't know which test currently being executed (or does it know?) it is difficult to achieve the above copying files to working directory. So , if there is any internal variable that stores the test_case_name which is available in data_setup procedure , it would be handy.
I don't think we support functions with parameters as part of before or after at the moment.
What I would suggest as workaround is to create a one procedure that accepts filename and create it.
And then for each test create a wrapper procedure without parameter but with hardcoded file name.
As for your request this is something that have to be looked and investigated a bit further in terms of impact and feasibility.
Activity
lwasylow commentedon Nov 9, 2018
Hi
Can you clarify what you mean ?
If you could let us know what at are your trying to achieve , so sample scenario/ mockup ?
MS-24 commentedon Nov 9, 2018
Hi @lwasylow ,
This is related to data setup.
For my test scenario , I need to insert rows in 20 tables. My approach is
for example for the original table employee , I will create an external table as tst_employee using "orgnization external" .
3.Likewise if there are 10 test cases I would like to create 10 tst_employee.dmp files with relevant to each of the test cases and keep in each of those directories.
'insert into employee select * from tst_employee'to populate the data in employee so that my original code to be test would use.7.For each test case I will copy the relevant file .dmp file to a directory called working directory and will remove once the test is completed .
Hope my explanation is clear . Please suggest.
lwasylow commentedon Nov 9, 2018
I don't think we support functions with parameters as part of before or after at the moment.
What I would suggest as workaround is to create a one procedure that accepts filename and create it.
And then for each test create a wrapper procedure without parameter but with hardcoded file name.
As for your request this is something that have to be looked and investigated a bit further in terms of impact and feasibility.
MS-24 commentedon Nov 10, 2018
Ok ,Thank you
jgebal commentedon Nov 28, 2018
I see two options, probably both would be useful.
dbms_application_infoThe more i think about it the more i like it. 😀
lwasylow commentedon Nov 28, 2018
Application info is restricted to 30 char, not sure if that would be enough.
Shoelace commentedon Dec 3, 2018
i think a session context is a good idea.. application_inof/module/action can be overwritten by the procedure under test anyway
[WIP] Ability to run expectations without test
[WIP] Ability to run expectations without test