-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for VSTS logging in SpecRun.exe #833
Comments
Is there a special reason why you are executing the tests via specrun.exe on TFS? Documentation to setup is here: http://specflow.org/plus/documentation/SpecFlowPlus-and-Build-Servers/ |
We would prefer to use VSTest, but our test suit has random failures, which is common with selenium UI automation testing, so we have our tests setup to rerun 2 times if there is a failure. With SpecRun.exe we can get the exit code ( If you know of a way around this, we would love to know it. We ended up having to create a custom SpecRun report that mimics a TRX file because we couldn't get this working with VSTest. |
I understand and it makes sense. Nice that you were able to mimic the TRX file with a report template! I know, that we have in our backlog the feature request, that the build is passed, if the retries were successful. I will search for it next week and have a quick look if it is possible to do this with VSTest. |
That would be fantastic! It would really make our lives a lot easier if it was handled in the test adapter. Thanks! :) |
So it took a little bit longer as expected, but with the today released pre-release of SpecFlow+Runner (1.7.0-rc001), we added this feature. We added a new configuration for VSTest only to unify the result of retries depending on a passrate. Example config:
Documentation: TestRetryResults: By default, a test that initially fails is treated as having failed, even if the retries are successful. This can result in test execution results that show the same test as both failing (the initial test) and passing (the subsequent retries). This is particularly common when testing web applications if the initial test times out. In some cases, you may want to determine that a test should be treated as passing, even if one or other of the tests fails, allowing you to discount tests that time out. passRate: Determines the percentage threshold (default = 100%) used to determine when a test should be treated as passing when using the Please give us feedback on this feature if it solves your issues. |
@ChristopherHaws Did you had any chance to have a look at this? |
@SabotageAndi I will take a look at this right now. Thanks for the update! :) |
@SabotageAndi Would it be possible to have a In our case, we only care if the test passes at least one time. |
@SabotageAndi I am receiving the following error when trying to run the test:
If I remove the Packages.config <packages>
<package id="FluentAssertions" version="4.19.4" targetFramework="net461" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
<package id="SpecFlow" version="2.2.1" targetFramework="net461" />
<package id="SpecRun.Runner" version="1.7.0-rc001" targetFramework="net461" />
<package id="SpecRun.SpecFlow" version="1.7.0-rc001" targetFramework="net461" />
<package id="SpecRun.SpecFlow.2-2-0" version="1.7.0-rc001" targetFramework="net461" />
</packages> Default.srprofile <?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specrun.com/schemas/2011/09/TestProfile">
<Settings projectName="SpecRunTestRetry" projectId="{D29DEB5E-F080-434A-9E56-9DA3DFEEC25F}" />
<Execution retryFor="Failing" retryCount="3" />
<VSTest TestRetryResults="Unified" passRate="100" />
<TestAssemblyPaths>
<TestAssemblyPath>SpecRunTestRetry.dll</TestAssemblyPath>
</TestAssemblyPaths>
</TestProfile> |
@ChristopherHaws There were some issues with 1.7-rc001 and this feature. They are fixed with the 1.7-rc002 release. |
SpecFlow+Runner 1.7.1 is out with fixes for the Unified VSTest Test result mode. |
@SabotageAndi I am receiving the following error when trying to run with Error
Default.srprofile
|
Are you using the latest version? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
Currently, specrun.exe has console output for TFS, VS2010 - VS2015, and TeamCity. It would be nice to have a VSTS option which would log using VSTS's format which is:
##vso[task.loglevel]Message
So, an example would be:
##vso[task.debug]Hello World!
Thanks! :)
The text was updated successfully, but these errors were encountered: