-
Notifications
You must be signed in to change notification settings - Fork 46
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
MsTest DataRow support #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gasparnagy DataRowAttribute doesn't support any additional argument other than the test parameters array and the DisplayName (https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.testtools.unittesting.datarowattribute.-ctor?view=visualstudiosdk-2022).
At runtime a System.Reflection.TargetParameterCountException will be thown when the test methods has a number of parameters different than the DataRowAttribute
Anyhow I'm still trying to understand what's the issue with this pull request, I have a lot of difficulties to investigate Reqnroll.Specs's local execution
@livioc Reqnroll adds an additional string[] parameter to the method to know about the tags (regardless of whether the test framework supports it) and that had to be provided. The rest of the issues seem to be related to how we do the testing: we let the tests run and then parse the TRX file to get the results. But MsTest generates the TRX file in a slightly different format in case of DataRow, so that causes the problems. I have a working env now, I can try to debug the rest. |
Oh God. This was a tricky issue. Somehow the code we generated was not working in case there was only one column in the examples table with MsTest v2.*... Locally it is passing now. Let's hope it works. But I had to learn that the local testability is really a pain, especially for generator changes. Need to improve this (https://github.com/orgs/reqnroll/discussions/38). |
Hi @gasparnagy , today I have done some tests on a new .net48 test project but I still have problem. I created the nuget packages with Then I generated the test code using
When I run the generated test code
I got the exception
Are you sure that we must pass the addition tags array parameter? Can't we just ignore them? |
@livioc The current test system is not working properly. Actually you are not testing with the version you have built (you can see it because the |
@gasparnagy thanks, I have done same tests, this scenaraio doens't work with mstest The generated code has a different number of parameters
but I don't understand this, this code works with a .net48 test project
|
@livioc ah yes, thx. this is a bug and I know why. I'll fix. (I have no idea why this was working on .net48) |
@livioc I fixed it now. I could only do the related test in my new "System Test" concept in #62 (a214d47), but that will be merged at some point. If you have a little more time, please retest it. You can also have a look at my system test and give feedback if such testing would be useful/efficient for generator changes. |
* system tests concept # Conflicts: # Reqnroll.sln * Update test for problem identified for #54 by @livioc * replace BoDi with Reqnroll.BoDi * portability test POC * Undo 'Microsoft.Build.Locator' for MsBuild location and make it flexible with env vars (#75) * add portability compilation tests with msbuild * Add system tests to CI * Fix system tests to CI * Add TODOs for further portability tests * Fix system tests to CI, take 2 * Change SystemTests to use MsTest * set default target framework to .NET 8.0 * Add .NET Information to CI * test specs filter on CI * Revert "test specs filter on CI" This reverts commit bdcdbaa. * fix specs_filter on CI * speed up build by using heuristics to find MsBuild * speed up build by using global nuget packages folder * cleanup CI script * add CI system test for linux * create Generation test structure * add more categories and exclude .NET Framework and MsBuild tests from linux * Add NUnit and xUnit tests * rename AppConfigDriver to ConfigurationDriver, allow customizing nuget global folder * fix strange test error if .NET 4.6.2 test target was not included in run * Add smoke test * TEST: remove test filter from Linux CI * Add Generation test TODO comments * re-add filter to linux CI * enable parallel system testing * set target fw of Reqnroll.TestProjectGenerator to netstandard2.0 * re-enable all specs tests * code cleanup
(This is a redo of PR #52 by @livioc, to be able to fix the generation issues.)
Types of changes
Checklist: