|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, December 14, 2009 2:47 PM
Points: 6,
Visits: 6
|
|
| Most of the Fit fixtures you can run from Fitnesse can also be run by FitRunner.exe from the command line. You can run a DoFixture, ActionFixture, ColumnFixture, RowFixture, etc. via FitRunner.exe. Is it possible to use FitRunner.exe to execute DbFit fixtures?
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 6:02 AM
Points: 30,
Visits: 494
|
|
Is there any way to increase the command timeout in DBFit?
I would like to test some complex data warehouse ETL stored procedures, but I've hit a problem as several run for longer than the default timeout (30 seconds), even on test data.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 8:55 AM
Points: 219,
Visits: 807
|
|
Solomon Rutzky (11/13/2008)
Alexander Kuznetsov (11/13/2008)
Solomon Rutzky (11/13/2008)
Alexander Kuznetsov (11/13/2008) How would you test the following cases: - my stored procedure modifies two tables and returns a result set;
3) To test any result set, use either the "Query" or "Ordered Query" operations. It does not matter what else the Stored Procedure does. IMO yes it does - how do you verify that the modifications are exactly as you expect? Ok, sorry, I misunderstood the intent of that question. To test both the modifications made in the Stored Procedure and the result set returned, you would do the following all within the same page: a) use the "Query" operation calling EXEC on the Stored Procedure to test the result set b) use the "Query" operation again calling SELECT * FROM Table1 to test that change c) use the "Query" operation again calling SELECT * FROM Table2 to test that change
Solomon, in my experience the "SELECT * FROM Table1 to test that change" approach is very inefficient. Come to think of it, next month or next year you will have to add some more test data for some other requirement, and that will break your "test that change" piece. It is much better to test exactly the change - the difference between the original and the modified states.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 21, 2008 4:41 PM
Points: 3,
Visits: 2
|
|
Most of the Fit fixtures you can run from Fitnesse can also be run by FitRunner.exe from the command line. You can run a DoFixture, ActionFixture, ColumnFixture, RowFixture, etc. via FitRunner.exe. Is it possible to use FitRunner.exe to execute DbFit fixtures?
in .NET, yes. FolderRunner and other .NET runners are 100% compatible with the normal fitnesse runner. In Java, the fit runner is not 100% compatible with fitnesse runners, so you can't do it from the command line.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 21, 2008 4:41 PM
Points: 3,
Visits: 2
|
|
Is there any way to increase the command timeout in DBFit? if you can do that in the connection string, then yes (just set it in the connect operation). Otherwise, not at the moment.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 21, 2008 4:41 PM
Points: 3,
Visits: 2
|
|
Solomon, in my experience the "SELECT * FROM Table1 to test that change" approach is very inefficient. Come to think of it, next month or next year you will have to add some more test data for some other requirement, and that will break your "test that change" piece. It is much better to test exactly the change - the difference between the original and the modified states.
for large tables, if the table has an autoincremented id, you can do something like:
|query|select max(id) as top from table| |top| |>>currentmax|
// do your test here
|query|select * from table where id>@currentmax| |col1|col2|col3|
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, February 21, 2013 8:55 AM
Points: 219,
Visits: 807
|
|
gojko adzic (11/21/2008)
Solomon, in my experience the "SELECT * FROM Table1 to test that change" approach is very inefficient. Come to think of it, next month or next year you will have to add some more test data for some other requirement, and that will break your "test that change" piece. It is much better to test exactly the change - the difference between the original and the modified states.
for large tables, if the table has an autoincremented id, you can do something like: |query|select max(id) as top from table| |top| |>>currentmax| // do your test here |query|select * from table where id>@currentmax| |col1|col2|col3|
works only for inserts and only if the table has identity.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, October 17, 2012 5:22 AM
Points: 2,
Visits: 43
|
|
I would like to be able to create a test around the metadata returned from a stored procedure.
My scenario :- I will receive Column A, Column B & Column C from a stored procedure.
If another developer changes the sproc to return another column, Column D, I want my test to fail.
'Inspect Query' does return the metadata but I can't figure out a way of sticking that into a test.
Any idea how I can acheive this?
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Saturday, May 18, 2013 11:12 AM
Points: 285,
Visits: 1,377
|
|
ian.gregson (2/10/2011) I would like to be able to create a test around the metadata returned from a stored procedure.
My scenario :- I will receive Column A, Column B & Column C from a stored procedure.
If another developer changes the sproc to return another column, Column D, I want my test to fail.
Hi Ian. The only way I can get this to work is to cause a SQL Server exception when the test runs as opposed to a handled DbFit error. I hope this ok as it does kinda work.
1) Use the |Execute| method to create a temp table to hold the expected columns 2) Use a second |Execute| to INSERT into the temp table from an EXEC to the Stored Proc
Example:
!|Execute| CREATE TABLE #ResultSetTest (first VARCHAR(50), second VARCHAR(50), third INT) | !|Execute| INSERT INTO #ResultSetTest (first, second, third) EXEC Test.dbo.TestProc |
If the result set of the Proc does not match the temp table, then you will get an exception stating:
System.Data.SqlClient.SqlException: Column name or number of supplied values does not match table definition.
Take care, Solomon...
SQL# - http://www.SQLsharp.com/
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 9:57 PM
Points: 32,906,
Visits: 26,790
|
|
eharper (11/21/2008) Is there any way to increase the command timeout in DBFit?
I would like to test some complex data warehouse ETL stored procedures, but I've hit a problem as several run for longer than the default timeout (30 seconds), even on test data.
I'm not trying to be a "smart guy" here... I'm concerned about the code being tested. Wouldn't the fact that something takes longer than 30 seconds "even on test data" be the first indication of a possible major performance problem which needs to fixed prior to going to production?
--Jeff Moden "RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following... http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following... http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
|
|
|
|