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

some test failed on v1.7.7 tags & go1.17 #3010

Open
WangLeonard opened this issue Dec 31, 2021 · 4 comments
Open

some test failed on v1.7.7 tags & go1.17 #3010

WangLeonard opened this issue Dec 31, 2021 · 4 comments

Comments

@WangLeonard
Copy link

git checkout v1.7.7
go test ./...

Description


## Expectations

all passed

## Actual result

```bash
=== RUN   TestContextRenderFile
    context_test.go:1008: 
        	Error Trace:	context_test.go:1008
        	Error:      	Not equal: 
        	            	expected: "text/plain; charset=utf-8"
        	            	actual  : "text/x-go; charset=utf-8"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-text/plain; charset=utf-8
        	            	+text/x-go; charset=utf-8
        	Test:       	TestContextRenderFile
--- FAIL: TestContextRenderFile (0.00s)


Expected :text/plain; charset=utf-8
Actual   :text/x-go; charset=utf-8

=== RUN   TestContextRenderFileFromFS
    context_test.go:1020: 
        	Error Trace:	context_test.go:1020
        	Error:      	Not equal: 
        	            	expected: "text/plain; charset=utf-8"
        	            	actual  : "text/x-go; charset=utf-8"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-text/plain; charset=utf-8
        	            	+text/x-go; charset=utf-8
        	Test:       	TestContextRenderFileFromFS
--- FAIL: TestContextRenderFileFromFS (0.00s)


Expected :text/plain; charset=utf-8
Actual   :text/x-go; charset=utf-8

Environment

  • go version: go version go1.17.3 linux/amd64
  • gin version (or commit ref): v1.7.7
  • operating system:

maybe missed 77649bc on v1.7.7

@Bisstocuz
Copy link
Contributor

@thinkerou

@thinkerou
Copy link
Member

  1. chore(docs): Bump to v1.7.7 #2952 test ok
  2. on my mac, run make test ok
  3. on my mac, run go test ./... ok
➜  gin-1.7.7 go test ./...
ok  	github.com/gin-gonic/gin	1.102s
ok  	github.com/gin-gonic/gin/binding	0.441s
?   	github.com/gin-gonic/gin/ginS	[no test files]
ok  	github.com/gin-gonic/gin/internal/bytesconv	0.437s
?   	github.com/gin-gonic/gin/internal/json	[no test files]
ok  	github.com/gin-gonic/gin/render	0.845s

@WangLeonard
Copy link
Author

WangLeonard commented Jan 4, 2022

@thinkerou Hi, This test case can indeed be passed on the mac.
I reproduced it on linux.
And $GOROOT/src/mime/type.go TypeByExtension will be different return value on linux and mac
mac
image
linux
image
I'm not sure about the further reason for this. My environment problem or go problem or gin problem.

@shawndx
Copy link

shawndx commented Jan 6, 2022

Thought it's related to a go sdk change, https://go-review.googlesource.com/c/go/+/305230, which supports "Shared MIME-info Database on Unix systems" in go1.17

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

No branches or pull requests

4 participants