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

Running make test results in failure #179

Open
4 tasks done
rickhlx opened this issue Mar 16, 2023 · 6 comments
Open
4 tasks done

Running make test results in failure #179

rickhlx opened this issue Mar 16, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@rickhlx
Copy link

rickhlx commented Mar 16, 2023

Required check list:

  • I'm gonna mark the checkboxes like this.
  • I didn't find in the repository's issues section similar bug.
  • I understand, this is Open Source and not-for-profit product.
  • This is not about third-party project, framework, package or technology.

My environment:

  • OS (uname -a): Darwin Kernel Version 22.1.0
  • Golang (go version): go version go1.20.2 darwin/arm64

Describe the bug:

Running make test results in the following error:

=== RUN   TestPrivateRoutes
    private_routes_test.go:108: 
                Error Trace:    /Users/xxx/src/xxx/xxx/pkg/routes/private_routes_test.go:108
                Error:          Not equal: 
                                expected: 404
                                actual  : 500
                Test:           TestPrivateRoutes
                Messages:       delete book with credentials
--- FAIL: TestPrivateRoutes (0.03s)
=== RUN   TestPublicRoutes
    public_routes_test.go:65: 
                Error Trace:    /Users/xxx/src/xxx/xxx/pkg/routes/public_routes_test.go:65
                Error:          Not equal: 
                                expected: 404
                                actual  : 500
                Test:           TestPublicRoutes
                Messages:       get book by ID
--- FAIL: TestPublicRoutes (0.00s)
FAIL
        github.com/xxx/xxx/pkg/routes     coverage: 73.3% of statements
FAIL    github.com/xxx/xxx/pkg/routes     0.535s
FAIL
make: *** [test] Error 1

Steps to reproduce the behavior:

  1. Clone the repo
  2. Install dependencies
  3. Run make test
  4. See error

Expected behavior:

No errors are expected from out-of-the-box.

Additional context:

The following error is returned from the request response body:

{
  "error": true,
  "msg": "error, not connected to database, failed to connect to `host=host.docker.internal user=postgres database=postgres`: hostname resolving error (lookup host.docker.internal: no such host)"
}
@rickhlx rickhlx added the bug Something isn't working label Mar 16, 2023
@welcome
Copy link

welcome bot commented Mar 16, 2023

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template!

@koddr
Copy link
Member

koddr commented Apr 18, 2023

Hi,

Are you sure what DB on your side is up? Could you please check this again before run tests?

@stale
Copy link

stale bot commented Jun 17, 2023

👋 Hello. Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 17, 2023
@gaby
Copy link
Contributor

gaby commented Jun 25, 2023

@koddr @rickhlx I get a different error:

go test -v -timeout 30s -coverprofile=cover.out -cover ./...
?   	github.com/create-go-app/fiber-go-template	[no test files]
?   	github.com/create-go-app/fiber-go-template/app/controllers	[no test files]
?   	github.com/create-go-app/fiber-go-template/app/models	[no test files]
?   	github.com/create-go-app/fiber-go-template/app/queries	[no test files]
?   	github.com/create-go-app/fiber-go-template/pkg/configs	[no test files]
?   	github.com/create-go-app/fiber-go-template/pkg/middleware	[no test files]
?   	github.com/create-go-app/fiber-go-template/docs	[no test files]
?   	github.com/create-go-app/fiber-go-template/pkg/repository	[no test files]
?   	github.com/create-go-app/fiber-go-template/pkg/utils	[no test files]
?   	github.com/create-go-app/fiber-go-template/platform/cache	[no test files]
?   	github.com/create-go-app/fiber-go-template/platform/database	[no test files]
=== RUN   TestPrivateRoutes
    private_routes_test.go:108: 
        	Error Trace:	/home/ubuntu/Desktop/git/fix/fiber-go-template/pkg/routes/private_routes_test.go:108
        	Error:      	Not equal: 
        	            	expected: 400
        	            	actual  : 401
        	Test:       	TestPrivateRoutes
        	Messages:   	delete book without JWT and body
    private_routes_test.go:108: 
        	Error Trace:	/home/ubuntu/Desktop/git/fix/fiber-go-template/pkg/routes/private_routes_test.go:108
        	Error:      	Not equal: 
        	            	expected: 404
        	            	actual  : 500
        	Test:       	TestPrivateRoutes
        	Messages:   	delete book with credentials
--- FAIL: TestPrivateRoutes (0.04s)

Both Redis and Postgres are running

@stale stale bot removed the wontfix This will not be worked on label Jun 25, 2023
Copy link

stale bot commented Dec 15, 2023

👋 Hello. Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 15, 2023
@Dhruv-Garg79
Copy link

I am facing the same issue, any update on this?

@stale stale bot removed the wontfix This will not be worked on label Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants