TestInsight doesn't respect user's DUnit configuration.
In TestInsightRunner.pas, it forces "Fails if no checks [are] executed" to be true with the following code:
result.FailsIfNoChecksExecuted := True;
I think what should also occur is the following code:
Suite.LoadConfiguration(IniFileName, False, True);
So the RunRegisteredTests should be changed to:
procedure RunRegisteredTests(const baseUrl: string); var result: TTestResult; suite: ITestSuite; begin result := TTestResult.Create; try result.FailsIfNoChecksExecuted := True; result.AddListener(TTestInsightListener.Create(baseUrl)); suite := RegisteredTests; suite.LoadConfiguration(IniFileName, False, True); if Assigned(suite) then suite.Run(result); finally result.Free; end; end;
Comments (9)
-
reporter -
repo owner That only for DUnit or DUnit2 too?
-
repo owner - changed status to closed
don't compile/run when the process is already running (closes issue
#9)→ <<cset 76799671bcaf>>
-
repo owner - changed status to open
damnit, wrong number again -.-
-
reporter Reported for DUnit but it doesn't seem (code-wise) DUnit2 loads up the user's configuration either.
-
repo owner The problem with DUnit in its current implementation is that some options even if you can set them on the ITestSuite are not in effect because they get overridden by those of the TTestResult (as happening with FailsIfNoChecksExecuted). That is why I could not use the RunTest routine as you did in the DUnit2 unit. For DUnit I need to create the TTestResult and set the option there to make it work.
Apart from that I don't see any useful options inside the config file. Usually that file saves the selected tests which I don't need/want when running with TestInsight because.
Also if you look at the TextTestRunner you see that it does not load the config either.
-
reporter The issue I am having is that we work's test suite, we also use PascalMock (stuck on XE :( ) which we use the Verify call. This raises an exception when it fails but does nothing when it passes - the test is verifying that a repository/etc gets called with the correct parameters.
Because fail when no checks is enabled, there are a lot of false positives.
-
repo owner - changed status to resolved
The FailsIfNochecksExecuted option is not set anymore
-
reporter - changed status to closed
Check-less tests that uses PascalMock no longer report false positives.
- Log in to comment