Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tsqlt:call-stack [2020/02/05 09:01]
admin created
tsqlt:call-stack [2020/02/26 18:46] (current)
admin [tSQLt.RunAll]
Line 5: Line 5:
 ===== tSQLt.RunAll ===== ===== tSQLt.RunAll =====
  
-  ** ''​EXEC tSQLt.RunAll'' ​-- user call to run all tests +  ** User runs ''​EXEC tSQLt.RunAll''​ to run all tests 
-    ** ''​tSQLt.Private_RunMethodHandler''​ called +    ** ''​tSQLt.Private_RunMethodHandler'' ​is called 
-      ** ''​tSQLt.Private_Init''​ called +      ** ''​tSQLt.Private_Init'' ​is called 
-        ** ''​tSQLt.Private_CleanTestResult''​ called. The SP removes prior test results, deleting rows from ''​tSQLt.TestResult''​. +        ** ''​tSQLt.Private_CleanTestResult'' ​is called. The SP removes prior test results, deleting rows from ''​tSQLt.TestResult''​. 
-      ** ''​tSQLt.Private_RunAll''​ called. The name of this SP is passed into ''​tSQLt.Private_RunMethodHandler''​ as parameter ''​@RunMethod''​. +      ** ''​tSQLt.Private_RunAll'' ​is called. ​(The name of this SP was passed into ''​tSQLt.Private_RunMethodHandler''​ as parameter ''​@RunMethod''​)
-        ** ''​tSQLt.Private_RunCursor''​ called. This SP obtains a cursor to iterate over test classes, running tests in each returned class. +        ** ''​tSQLt.Private_RunCursor'' ​is called. This SP obtains a cursor to iterate over test classes, running tests in each returned class. 
-          ** ''​tSQLt.Private_GetCursorForRunAll''​ called. The name was this SP is passed into ''​tSQLt.Private_RunCursor''​ as parameter ''​@GetCursorCallback''​. +          ** ''​tSQLt.Private_GetCursorForRunAll''​ called. ​(The name of this SP was passed into ''​tSQLt.Private_RunCursor''​ as parameter ''​@GetCursorCallback''​)
-            ** Selects ​test class names from view ''​tSQLt.TestClasses''​. ​**The view returns schemas with the extended property '​tSQLt.TestClass'​ set**+            ** The SP selects ​test class names from view ''​tSQLt.TestClasses''​. ​ 
-          ** ''​tSQLt.Private_RunTestClass''​ called for each test class returned by the cursor. +            .. <wrap info round>The view returns schemas with the [[tsql:​managing_extended_properties|extended property]] '​tSQLt.TestClass'​ set.</​wrap>​ 
-            ** ''​tSQLt.Private_GetSetupProcedureName''​ called to identify the class'​s [[https://​tsqlt.org/​130/​creating-and-running-test-cases-in-tsqlt/​|setup procedure]]. This returns ''​[//​test_class//​].[setup]''​ if ''​setup''​ exists in the ''//​test-class//''​ schema ​-- **''setup'' is the only supported name for the setup procedure** (case-insensitive,​ independent of collation). +          ** ''​tSQLt.Private_RunTestClass'' ​is called for each test class returned by the cursor. 
-            ** Tests in the test class are identified. The class'​s tests are **stored procedures in the test class schema with names that begin with '​test'​**+            ** ''​tSQLt.Private_GetSetupProcedureName'' ​is called to identify the class'​s [[https://​tsqlt.org/​130/​creating-and-running-test-cases-in-tsqlt/​|setup procedure]]. This returns ''​[//​test_class//​].[setup]''​ if ''​setup''​ exists in the ''//​test-class//''​ schema
-            ** ''​tSQLt.Private_RunTest''​ is called for each test identified in the class+            .. <wrap info round>'​setup'​ is the only supported name for the setup procedure (case-insensitive,​ independent of collation).</​wrap>  ​ 
 +            ** Tests in the test class are identified. ​ 
 +            .. <wrap info round>The class'​s tests are stored procedures in the test class schema with names that begin with '​test'​.</​wrap>​ 
 +            ** ''​tSQLt.Private_RunTest''​ is called for each test identified in the class -- each call to this SP is the execution of a single test.
               ** A database transaction is opened               ** A database transaction is opened
-              ** ''​[//​test_class//​].[setup]''​ is called ​-- note that **''​setup''​ is called ​separately for each test in the class**.+              ** ''​[//​test_class//​].[setup]''​ is called 
 +              .. <wrap tip round>​Notice ​that ''​setup''​ is called ​repeatedly -- before ​each test in the class is executed, the class'​s ''​setup''​ SP runs.</​wrap>​
               ** The test SP is executed               ** The test SP is executed
-              ** The transaction is rolled back -- **this ​is the core of tSQLt'​s isolation guarantees**.+              ** The transaction is rolled back  
 +              .. <wrap tip round>​This ​is the core of tSQLt'​s isolation guarantees.</​wrap>​
               ** The results are added to table ''​tSQLt.TestResult''​               ** The results are added to table ''​tSQLt.TestResult''​
-          ** ''​tSQLt.Private_OutputTestResults''​ called +          ** ''​tSQLt.Private_OutputTestResults'' ​is called 
-            ** ''​tSQLt.DefaultResultFormatter''​ called to output results formatted as text. The SP selects tests from ''​tSQLt.TestResult''​ and echoes them to the console using ''​RAISERROR''​. ​+            ** ''​tSQLt.DefaultResultFormatter'' ​is called to output results formatted as text. The SP selects tests from ''​tSQLt.TestResult''​ and echoes them to the console using ''​RAISERROR'' ​(with severity dependent on test outcome)
  
 Collection of test results in ''​tSQLt.TestResult''​ allows other formatters to be called after ''​tSQLt.RunAll''​ is complete. ''​tSQLt.XmlResultFormatter''​ returns results in an XML document in [[https://​llg.cubic.org/​docs/​junit/​|JUnit XML format]] suitable for consumption in a CI build environment like [[https://​azure.microsoft.com/​en-gb/​services/​devops/​pipelines/​|Azure Pipelines]] or Jenkins. Collection of test results in ''​tSQLt.TestResult''​ allows other formatters to be called after ''​tSQLt.RunAll''​ is complete. ''​tSQLt.XmlResultFormatter''​ returns results in an XML document in [[https://​llg.cubic.org/​docs/​junit/​|JUnit XML format]] suitable for consumption in a CI build environment like [[https://​azure.microsoft.com/​en-gb/​services/​devops/​pipelines/​|Azure Pipelines]] or Jenkins.