Move xUnit tests in new folder#8356
Conversation
Remove unneeded dotnet restore Add --no-restore Add extraParams for MacOS Fix TestRunspaceWithPowerShellAndInitialSessionState Fix race condition to access powershell.config.json Reduce an impact of the inter process race condition Fix race condition to access powershell.config.json (PowerShell#8249)
|
@daxian-dbw @TravisEz13 @adityapatwardhan Could you please review the PR? It blocks my follow PRs (one could be used to speed up startup). |
| @@ -0,0 +1,45 @@ | |||
| using System; | |||
There was a problem hiding this comment.
Please add copyright header.
| @@ -0,0 +1,12 @@ | |||
| using System; | |||
There was a problem hiding this comment.
Please add copyright header.
There was a problem hiding this comment.
Still missing copyright header here.
There was a problem hiding this comment.
Sorry, I lost new commits.
Fixed.
| } | ||
|
|
||
| # we are having intermittent issues on macOS with these tests failing. | ||
| # VSTS has suggested forcing them to be sequential |
There was a problem hiding this comment.
Can we validate if this is still the case. If not, we can removed the condition.
There was a problem hiding this comment.
We would have to try it to know.
There was a problem hiding this comment.
We could open a tracking issue for the work and don't block the PR.
Also we have many CodeFactor issues. Also we need to have more tests for binary APIs. Also we need to have performance tests. I think we should open new tracking issues.
| public void TestRunspaceWithPowerShellAndInitialSessionState() | ||
| { | ||
| InitialSessionState iss = InitialSessionState.CreateDefault2(); | ||
| InitialSessionState iss = InitialSessionState.CreateDefault(); |
There was a problem hiding this comment.
Two tests above use the CreateDefault(). I guess it was typo. If we need tests for CreateDefault2() I believe it should be added in new PR.
There was a problem hiding this comment.
I believe CreateDefault2 is intentional as it creates an ISS without any modules loaded. Please change it back.
There was a problem hiding this comment.
Reverted with new comment.
There was a problem hiding this comment.
@adityapatwardhan that seems like a method name that probably needs revising, if we can, or adding an alias for in some fashion. Ilya is generally pretty familiar with the repo; if he got it confused, it's likely others will also.
There was a problem hiding this comment.
Changing the methodName would be a huge breaking change, but we could add a new method that calls this that is named better. I would suggest filing an issue about this.
2f5182f to
59c7e7a
Compare
|
@iSazonov Please resolve the merge conflict. |
test/xUnit/xUnit.tests.csproj
Outdated
There was a problem hiding this comment.
It was temporary additions.
Removed.
51803cb to
65079e4
Compare
|
I restarted CI-Windows - there was a race condition again. Perhaps it is only test specific issue. @adityapatwardhan @daxian-dbw could you please look? There test cleanup code failed but I don't understand that process lock the config file. I guess it is other test processes. In this case we need improve the test cleanup code like we did in |
|
I updated #8400 to fix the rare race condition in tests. @adityapatwardhan We could merge. |
|
@adityapatwardhan Could you please update your code review and merge? |
|
@iSazonov @adityapatwardhan Is out of the office until the new year. |
|
@TravisEz13 If you could merge I could continue my work. |
Remove unneeded dotnet restore Add --no-restore Add extraParams for MacOS Fix TestRunspaceWithPowerShellAndInitialSessionState Fix race condition to access powershell.config.json Reduce an impact of the inter process race condition Fix race condition to access powershell.config.json (PowerShell#8249)
65079e4 to
f6512de
Compare
|
rebased the branch mainly to verify the tests still pass |
…Shell into move-xunit-tests2
|
The test TestRunspaceWithPowerShellAndInitialSessionState fail exclusively and randomly on MacOs if we use |
Aditya is out of the office
(Replace #8237)
Motivation
I have a PR where there are many new xUnit tests.
It would also be useful to create new xUnit tests for public APIs.
The number of xUnit tests will increase and their ordering is required.
PR Summary
powershell.config.json.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests