Skip to content
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

What causes multiple tests with the same testId #1744

Closed
samholder opened this issue Oct 4, 2023 · 2 comments
Closed

What causes multiple tests with the same testId #1744

samholder opened this issue Oct 4, 2023 · 2 comments

Comments

@samholder
Copy link

Hi.

I am trying to merge multiple trx files from multiple test runs into a single run, by replacing the tests that fail on a first run with the successful test result in a second run. I have been using another project for this, https://github.com/ricardofslp/dotnet-trx-merge. However on some projects when I run the tests I get multiple tests which have the same id. The project uses testId to manage the replacement during the merge, and this causes my trx merges to fail. I am trying to fix this issue and was trying to create an MVP to reproduce the issue so I would have example trx files to use for the tests I wanted to write.

In my 'real' project I am using DataTestMethod on my tests and attributes which implement ITestDataSource and provide the test data. Each attribute returns a unique name. When I run the tests I get the same test id for all the tests that execute because of that method.

image

In my MVP I cannot get the same id unless I return the same name from the ITestDataSource.

What determines if a test can get the same id? Is this valid, or is there something wrong in my 'real' project? How can I find out what that is? if it is valid, how can I reproduce it consistently?

Thanks!

@Evangelink
Copy link
Member

I am not sure exactly about the TRX, I will double check tomorrow. For the ID used within MSTest (assuming it's being reused), it depends on the version of MSTest you are using (and if on v3 the strategy you are using #1286).

@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 10 days of this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants