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

.Net Core 3.1 - Unit Test failed in GitLab Runner(Linux) works in local windows - mongo2go directory notfound #18577

Closed
martinsubash opened this issue Jan 25, 2020 · 1 comment
Labels
External This is an issue in a component not contained in this repository. It is open for tracking purposes. Status: Resolved

Comments

@martinsubash
Copy link

Issue Title

After migrate to .Net core 3.1 the NUnit test with mongo2go run in local(Windows machine) but failed in gitlab runner(Linux).

General

The below are the error from the gitlabci pipeline:

X GetAll_ReturnsEmptyResultOnEmptyCollection [< 1ms]
190   Error Message:
191    OneTimeSetUp: System.IO.DirectoryNotFoundException : Could not find a part of the path '/builds/testproj/testproj-mytest/Test/~/.nuget/packages'.
192 SetUp failed for test fixture Test.MongoDBStorage.MongoDbRepositoryTest
193 System.IO.DirectoryNotFoundException : Could not find a part of the path '/builds/testproj/testproj-mytest/Test/~/.nuget/packages'.
194    at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
195    at System.IO.Enumeration.FileSystemEnumerator`1.Init()
196    at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
197    at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
198    at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
199    at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
200    at Mongo2Go.Helper.FolderSearch.FindFolder(String startPath, String searchPattern)
201    at Mongo2Go.Helper.MongoBinaryLocator.FindBinariesDirectory(IList`1 searchDirectories)
202    at Mongo2Go.Helper.MongoBinaryLocator.ResolveBinariesDirectory()
203    at Mongo2Go.Helper.MongoBinaryLocator.get_Directory()
204    at Mongo2Go.MongoDbRunner.MakeMongoBinarysExecutable()
205    at Mongo2Go.MongoDbRunner..ctor(IPortPool portPool, IFileSystem fileSystem, IMongoDbProcessStarter processStarter, IMongoBinaryLocator mongoBin, String dataDirectory, Boolean singleNodeReplSet)
206    at Mongo2Go.MongoDbRunner.Start(String dataDirectory, String binariesSearchPatternOverride, String binariesSearchDirectory, Boolean singleNodeReplSet)
207    at Test.MongoDBStorage.MongoDbTestBase.TestSetup() in /builds/testproj/testproj-mytest/projects/backend/src/Product.Test/MongoDBStorage/MongoDbTestBase.cs:line 17

The below are the used DLL Versions

<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="Mongo2Go" Version="2.2.12" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />

.gitlabci.yml commands:

dotnet restore "testproj.sln" -r win-x64
dotnet build -c Release --no-restore
dotnet test -c Release --no-build --no-restore

@mkArtakMSFT
Copy link
Member

Thanks for contacting us.
It's not clear how this is related to the ASP.NET Core framework.
If this is a behavior change you're observing after upgrading your application from an earlier version of ASP.NET Core (2.2 or below) then you most probably are impacted by one or more of the breaking changes introduced in 3.0. To make sure you migrate your application properly, consider following the migration guide available at: https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio

@mkArtakMSFT mkArtakMSFT added ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. External This is an issue in a component not contained in this repository. It is open for tracking purposes. labels Jan 27, 2020
@ghost ghost added the Status: Resolved label Jan 27, 2020
@mkArtakMSFT mkArtakMSFT removed the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Jan 27, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
External This is an issue in a component not contained in this repository. It is open for tracking purposes. Status: Resolved
Projects
None yet
Development

No branches or pull requests

2 participants