Mattermost, Inc.

Error when running make test

Summary

make test fails and exit after the TestZZWebSocketTearDown test passes

Steps to reproduce

Clone the Mattermost repo (latest commit on mine was - https://github.com/mattermost/platform/commit/bbf6c81a065d7d2c550b6a629cf31cc113b3713e)

Run make test and wait a couple of minutes to see the error message found in the screenshot below.

Expected behavior

I was working on an issue (https://github.com/mattermost/platform/issues/7113) when I encountered this problem. However, I then cloned the most recent version of Mattermost without making any changes, ran make test and still got the same error message found below.

Observed behavior

After running make test, you see log messages on the terminal and at one point the tests stop running. The following screenshot is the observed behavior:

Actual screenshot text:
=== RUN TestWebSocket
[2017/08/15 08:42:42 PDT] [DEBG] GET - /api/v4/websocket
[2017/08/15 08:42:42 PDT] [DEBG] websocket.read: closing websocket for userId=yjahxnhpgtfw5bxcyrg17xitwh error=websocket: close 1006 (abnormal closure): unexpected EOF
[2017/08/15 08:42:42 PDT] [DEBG] GET - /api/v4/websocket
[2017/08/15 08:42:43 PDT] [DEBG] /api/v3/users/websocket:ping
[2017/08/15 08:42:43 PDT] [EROR] websocket routing error: seq=4 uid=yjahxnhpgtfw5bxcyrg17xitwh api.web_socket_router.no_action.app_error [details: ]
[2017/08/15 08:42:43 PDT] [EROR] websocket routing error: seq=5 uid=yjahxnhpgtfw5bxcyrg17xitwh api.web_socket_router.bad_action.app_error [details: ]
[2017/08/15 08:42:43 PDT] [EROR] websocket routing error: seq=0 uid=yjahxnhpgtfw5bxcyrg17xitwh api.web_socket_router.bad_seq.app_error [details: ]
[2017/08/15 08:42:44 PDT] [DEBG] /api/v3/users/websocket:user_typing
[2017/08/15 08:42:44 PDT] [EROR] /api/v3/users/websocket:user_typing seq=6 uid=yjahxnhpgtfw5bxcyrg17xitwh Invalid channel_id parameter [details: ]
— PASS: TestWebSocket (3.13s)
=== RUN TestZZWebSocketTearDown
[2017/08/15 08:42:46 PDT] [INFO] Stopping Server…
[2017/08/15 08:42:46 PDT] [INFO] Closing SqlStore
[2017/08/15 08:42:46 PDT] [INFO] stopping websocket hub connections
[2017/08/15 08:42:46 PDT] [INFO] Server stopped
— PASS: TestZZWebSocketTearDown (2.00s)
FAIL
coverage: 46.6% of statements in github.com/mattermost/platform/api, github.com/mattermost/platform/api4, github.com/mattermost/platform/app, github.com/mattermost/platform/app/plugin, github.com/mattermost/platform/app/plugin/jira, github.com/mattermost/platform/cmd/platform, github.com/mattermost/platform/einterfaces, github.com/mattermost/platform/einterfaces/jobs, github.com/mattermost/platform/imports, github.com/mattermost/platform/jobs, github.com/mattermost/platform/manualtesting, github.com/mattermost/platform/model, github.com/mattermost/platform/model/gitlab, github.com/mattermost/platform/store, github.com/mattermost/platform/utils, github.com/mattermost/platform/web, github.com/mattermost/platform/wsapi
exit status 1
FAIL github.com/mattermost/platform/api4 335.546s

Does the issue remains if u do a make clean && make test? or was it make clear

It is make clean :slight_smile:

I tried running both commands like you suggested and the issue still remains.

Well you don’t necessarily need to do make test in order to compile mattermost, you can use make run directly, despite the fact you’re getting errors with the make test, assuming you have everything installed right(followed one of the guides for dev setup for the environment in question), make run or make package should compile without issues.

However if what you’re fixing depends on some test you need to add or modify, I suppose the fastest route to ensure your test is working would be this

The make test command is not like a regular make test you normally see when compiling application on linux, but more of a unit test of the features of mattermost it self.


Further talking to the team about the test coverage, @hmhealey said:

I don’t think it accounts for cross-package testing (like api4 code testing store code) by default. The numbers on https://coveralls.io/github/mattermost/platform will be accurate though