-
Notifications
You must be signed in to change notification settings - Fork 30
bug: Test result parser returns error if there is multiple tests with the same testId #164
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
Comments
I made a mistake in the second link; it should be this one |
I read through the links you sent but I need more context. Is this scenario appropriate:
|
I tested it again to collect more information and noticed some weird test cases in tests with duplicated IDs. It turned out there is an easy way to reproduce the issue:
This will produce a Here are the answers to your questions:
|
I see, I created a new project locally and verified your repro. The way I see it the only way you can get duplicate TestIds are if your tests cases are identical in which case the result should also be 100% identical. If this is the case then we can simply add a check in the F# script and ignore duplicates. In all cases this should yield the correct results. As an extra precaution we can when we encounter duplicates check that the result of the testrun is the same. The reason I cant rely on executionId is that I need a mapping between the discovered tests and their results from the trx file. Today im using testId. If I were to use executionId I could handle duplicates but it would be random which duplicate entry would be assigned which result. Which shouldnt matter because their results should infact be identical Am I missing something or do you agree that duplicates are infact identical in the case that their result would always be the same? |
There is still room for rare cases when a test can have duplicated test cases and be composed incorrectly at the same time; for example, it may depend on random or asynchronous operations that are not awaited, so one run can be successful while another can fail. The chances are pretty small, but they are still there. 😅 I see two solutions right now:
|
Well it seems like we are on the same page. IMO if in that case two test executions report different results you have a flaky test. But yes theoretically I guess it could happen. Personally I would have liked it to throw an error if it encountered a duplicate with a different result but I guess its not this plugins job to point out flaws in other peoples projects, so aggregating the result would probably be for the best. Aggregating the result would be easy to do in the F# script. Just add the result and if you encounter a duplicate, check whether it should take precedence over the previous one. Would you want to update your PR based on this? |
Yeah, sure, I'll update PR in the next few days when I'll have spare time. Thanks for productive discussion! |
PR updated |
Hi!
Platform
Windows 11
Project with .NET 5.0
Description
In some projects with older .NET versions, VSTest can produce a
.trx
file with duplicatedtestId
values (theexecutionId
will be different). For more details, please check this link and this one.Although this is not a problem with the plugin, it would be nice if the plugin could produce results with duplicated rows instead of no results at all.
The text was updated successfully, but these errors were encountered: