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

Upgrade framework and package dependencies #123

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

JornWildt
Copy link
Contributor

@JornWildt JornWildt commented Nov 15, 2021

I continue to have issues compiling and running the tests in "Xunit.Gherkin.Quick.ProjectConsumer" and "Xunit.Gherkin.Quick.UnitTests". Upgrading to newer versions of "Microsoft.NET.Test.Sdk" and "xunit.runner.visualstudio" fixed it for me. Please consider upgrading the main repository.

This was implemented in a separate branch - not sure what happens with that in a pull request.

…ions are converted to corresponding regular expressions.
- Simplify tests.
- Move conversion method call out of constructor for ScenarioStepPattern.
- Rename Pattern to OriginalPattern
…tests showing single and double quotes can be mixed.

Minor code relocation in ConvertSpecialPatternsToRegex() to reflect the preferred reading order of the various cucumber expressions.
…T.Test.Sdk".

Use .NET 5 instead of deprecated netcoreapp2.0.
@ttutisani
Copy link
Owner

This branch has conflicts.

Also, please explain what kind of issues you have specifically.

@ttutisani
Copy link
Owner

The build failed. Can you please explain what you are trying to fix exactly?

@JornWildt
Copy link
Contributor Author

JornWildt commented Nov 15, 2021

This is most likely the issue for the appveyor setup:

The reference assemblies for framework ".NETFramework,Version=v5.0"

I have bumped the target framework for the two test projects to .NET 5 which apparently is not supported on appveyor.

@ttutisani
Copy link
Owner

I see. That's sad. Tell me what build issues do you face that you want to upgrade the versions. Maybe there is another workaround. I never had any issues on my computers.

@JornWildt
Copy link
Contributor Author

This is the test-output I get:

Log level is set to Informational (Default).
Test data store opened in 0,172 sec.
Test project Xunit.Gherkin.Quick does not reference any .NET NuGet adapter. Test discovery or execution might not work for this project.
It's recommended to reference NuGet test adapters in each test project in the solution.
========== Starting test discovery ==========
[xUnit.net 00:00:00.7954548]   Discovering: Xunit.Gherkin.Quick.ProjectConsumer
[xUnit.net 00:00:01.1380038]   Discovered:  Xunit.Gherkin.Quick.ProjectConsumer
[xUnit.net 00:00:00.6559199]   Discovering: Xunit.Gherkin.Quick.UnitTests
[xUnit.net 00:00:00.8045477]   Discovered:  Xunit.Gherkin.Quick.UnitTests
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Unable to find C:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick\bin\Debug\netstandard1.5\testhost.dll. Please publish your test project and retry.
   ved Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostPath(String runtimeConfigDevPath, String depsFilePath, String sourceDirectory)
   ved Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
   ved Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
   ved Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
========== Test discovery aborted: 212 Tests found in 4,2 sec ==========

(don't have more time now, will be back)

@ttutisani
Copy link
Owner

No worries, no rush, take your time. I don't know how to reproduce this issue. Can you please open a new issue and describe the problem in detail? Let's wait with this PR, because the error says Xunit.Gherkin.Quick should reference something, which I don't want to do. That will be an additional dependency for the framework. I want to think about it.

@JornWildt
Copy link
Contributor Author

Well, here is another reason for bumping the framework. When I compile the projects (without my changes) I get this warning:

warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future

@JornWildt
Copy link
Contributor Author

What version of Visual Studio are you running? Mine is version 16.8.6.

@JornWildt
Copy link
Contributor Author

Here is the full build log after a complete project reset:

1>------ Rebuild All started: Project: Xunit.Gherkin.Quick, Configuration: Debug Any CPU ------
1>Xunit.Gherkin.Quick -> D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick\bin\Debug\netstandard1.5\Xunit.Gherkin.Quick.dll
2>------ Rebuild All started: Project: Xunit.Gherkin.Quick.ProjectConsumer, Configuration: Debug Any CPU ------
3>------ Rebuild All started: Project: Xunit.Gherkin.Quick.UnitTests, Configuration: Debug Any CPU ------
3>C:\Program Files\dotnet\sdk\5.0.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.
2>C:\Program Files\dotnet\sdk\5.0.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy.
3>D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick.UnitTests\Xunit.Gherkin.Quick.UnitTests.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
2>D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick.ProjectConsumer\Xunit.Gherkin.Quick.ProjectConsumer.csproj : warning NU1701: Package 'xunit.runner.visualstudio 2.4.3' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
3>Xunit.Gherkin.Quick.UnitTests -> D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick.UnitTests\bin\Debug\netcoreapp2.0\Xunit.Gherkin.Quick.UnitTests.dll
3>Done building project "Xunit.Gherkin.Quick.UnitTests.csproj".
2>Xunit.Gherkin.Quick.ProjectConsumer -> D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick.ProjectConsumer\bin\Debug\netcoreapp2.0\Xunit.Gherkin.Quick.ProjectConsumer.dll
2>Done building project "Xunit.Gherkin.Quick.ProjectConsumer.csproj".
========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========

And the test output is:

Log level is set to Informational (Default).
Test data store opened in 0,035 sec.
---------- Starting test discovery ----------
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.3+1b45f5407b (64-bit Desktop .NET 4.0.30319.42000)
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.3+1b45f5407b (64-bit Desktop .NET 4.0.30319.42000)
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Unable to find D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick\bin\Debug\netstandard1.5\testhost.dll. Please publish your test project and retry.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostPath(String runtimeConfigDevPath, String depsFilePath, String sourceDirectory)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
========== Test discovery aborted: 0 Tests found in 1,8 sec ==========

The test output only speaks about Xunit.Gherkin.Quick which is not a test project anyway, so maybe it is simply not an issue.

None the less, no tests show up in Xunit.Gherkin.Quick.ProjectConsumer - but there are tests in Xunit.Gherkin.Quick.UnitTests.

On the other hand, Xunit.Gherkin.Quick is the project responsible for discovering the tests in Xunit.Gherkin.Quick.ProjectConsumer ... some all of the above problems may be related.

Test 1
Upgrading both test projects dependency on Microsoft.NET.Test.Sdk to 17.0.0 made no difference.

Test 2
Also upgrading the two test projects to netcoreapp3.1 helped. Now there are no build errors:

1>------ Build started: Project: Xunit.Gherkin.Quick, Configuration: Debug Any CPU ------
1>Xunit.Gherkin.Quick -> D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick\bin\Debug\netstandard1.5\Xunit.Gherkin.Quick.dll
2>------ Build started: Project: Xunit.Gherkin.Quick.ProjectConsumer, Configuration: Debug Any CPU ------
3>------ Build started: Project: Xunit.Gherkin.Quick.UnitTests, Configuration: Debug Any CPU ------
2>Xunit.Gherkin.Quick.ProjectConsumer -> D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick.ProjectConsumer\bin\Debug\netcoreapp3.1\Xunit.Gherkin.Quick.ProjectConsumer.dll
3>Xunit.Gherkin.Quick.UnitTests -> D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick.UnitTests\bin\Debug\netcoreapp3.1\Xunit.Gherkin.Quick.UnitTests.dll
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

The test output still contain an error:

Log level is set to Informational (Default).
Test data store opened in 0,029 sec.
---------- Starting test discovery ----------
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.3+1b45f5407b (64-bit .NET Core 3.1.21)
[xUnit.net 00:00:00.86]   Discovering: Xunit.Gherkin.Quick.ProjectConsumer
[xUnit.net 00:00:01.20]   Discovered:  Xunit.Gherkin.Quick.ProjectConsumer
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.3+1b45f5407b (64-bit .NET Core 3.1.21)
[xUnit.net 00:00:00.88]   Discovering: Xunit.Gherkin.Quick.UnitTests
[xUnit.net 00:00:01.00]   Discovered:  Xunit.Gherkin.Quick.UnitTests
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Unable to find D:\Projects\Xunit.Gherkin.Quick\source\Xunit.Gherkin.Quick\bin\Debug\netstandard1.5\testhost.dll. Please publish your test project and retry.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostPath(String runtimeConfigDevPath, String depsFilePath, String sourceDirectory)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DotnetTestHostManager.GetTestHostProcessStartInfo(IEnumerable`1 sources, IDictionary`2 environmentVariables, TestRunnerConnectionInfo connectionInfo)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.DiscoverTests(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler)
========== Test discovery aborted: 212 Tests found in 4,9 sec ==========

But at least now it discovers all the tests in Xunit.Gherkin.Quick.ProjectConsumer and these run as expected.

@ttutisani
Copy link
Owner

Thanks for all the explanation. Let me think about it for a while.

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

Successfully merging this pull request may close these issues.

None yet

2 participants