natemcmaster / dotnet-serve

Simple command-line HTTPS server for the .NET Core CLI

Home Page:https://nuget.org/packages/dotnet-serve/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MimeMappingsTest fails on Mac

goblinfactory opened this issue · comments

When running dotnet test on mac, I get the following error. It looks repeatable. Is it possible to include mac on your scheduled build. I have not investigated.

The following test fails

McMaster.DotNet.Serve.Tests.MimeTests.ItAppliesMimeMappings(file: "/file.mytxt", expectedContents: "contents of file.mytxt\n", expectedMime: "application/x-mytxt", mimeMap: ["mytxt=application/x-mytxt"]) [FAIL]

below is the output

fork-dotnet-serve > dotnet test
Test run for /Users/alanhemmings/src/git-alan-public/fork-dotnet-serve/.build/bin/dotnet-serve.Tests/Debug/netcoreapp3.0/dotnet-serve.Tests.dll(.NETCoreApp,Version=v3.0)
Microsoft (R) Test Execution Command Line Tool Version 16.3.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
                                                                                                                                                                                            
Test Run Successful.
Total tests: 15
     Passed: 15
 Total time: 12.5962 Seconds
Test run for /Users/alanhemmings/src/git-alan-public/fork-dotnet-serve/.build/bin/dotnet-serve.Tests/Debug/netcoreapp2.1/dotnet-serve.Tests.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 16.3.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:07.51]     McMaster.DotNet.Serve.Tests.MimeTests.ItAppliesMimeMappings(file: "/file.mytxt", expectedContents: "contents of file.mytxt\n", expectedMime: "application/x-mytxt", mimeMap: ["mytxt=application/x-mytxt"]) [FAIL]
  X McMaster.DotNet.Serve.Tests.MimeTests.ItAppliesMimeMappings(file: "/file.mytxt", expectedContents: "contents of file.mytxt\n", expectedMime: "application/x-mytxt", mimeMap: ["mytxt=application/x-mytxt"]) [530ms]
  Error Message:
   System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
     at McMaster.DotNet.Serve.Tests.MimeTests.ItAppliesMimeMappings(String file, String expectedContents, String expectedMime, String[] mimeMap) in /Users/alanhemmings/src/git-alan-public/fork-dotnet-serve/test/dotnet-serve.Tests/MimeTests.cs:line 47
--- End of stack trace from previous location where exception was thrown ---
  Standard Output Messages:
 Starting: /usr/local/share/dotnet/dotnet /Users/alanhemmings/src/git-alan-public/fork-dotnet-serve/.build/bin/dotnet-serve.Tests/Debug/netcoreapp2.1/tool/dotnet-serve.dll --verbose -d /Users/alanhemmings/src/git-alan-public/fork-dotnet-serve/.build/bin/dotnet-serve.Tests/Debug/netcoreapp2.1/TestAssets/Mime -p 9005 -m mytxt=application/x-mytxt
 dotnet-serve: Starting server, serving .


                                                                                                                                                                                            
Test Run Failed.
Total tests: 14
     Passed: 13
     Failed: 1
 Total time: 13.1573 Seconds
fork-dotnet-serve > 

Doesn't reproduce for me 🤷‍♂

image

Added macos to the CI build, and it passes there, too. If you can put a debugger on this and figure out what is null and shouldn't be, that would be helpful.

apologies, I would normally have done that myself rather than simply reporting the bug. I'll have time to do that next week. I will see if I can create a failing test and a pull request for the fix.

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. Thank you for your contributions to this project.