Mattermost, Inc.

[SOLVED] Developer machine setup questions

Hi,

I am setting my Linux PC to write a patch. I was following the developer guide but i had few questions which i could not find answers for:

  1. When i run “docker ls” i see 3 items running . I do not see anything for mattermost-preview. Is that normal? What is the success criteria for a successful “make run”?

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
09c06c7e406d mattermost/webrtc:latest “/bin/sh -c /opt/j…” 4 hours ago Up 36 minutes 0.0.0.0:7088-7089->7088-7089/tcp, 0.0.0.0:8188-8189->8188-8189/tcp mattermost-webrtc
9ea65c6c33a9 postgres:9.4 “docker-entrypoint…” 4 hours ago Up 36 minutes 0.0.0.0:5432->5432/tcp mattermost-postgres
8b8859300d3e mysql:5.7 “docker-entrypoint…” 4 hours ago Up 36 minutes 0.0.0.0:3306->3306/tcp mattermost-mysql

  1. When i try to open the Mattermost server address, i reach the login page. What username/password is expected here?

Hey @prateeksriv, looks like you successfully submitted a pull request - anything here I can help you with?

By the way, I’m also open for discussing the pull request that shows the channel header when hovering over a channel.

Jason

Sorry for coming back to you so late. I was reassigned to another project temporarily and its urgency prevented me from being responsive.

So I did submit a pull request but the jenkins failed on some step.
I was thinking of sending another pull request with fix on latest HEAD.

So, I did a clean pull of latest head and I am trying to build it.
My intent is to have a good development environment so that I can contribute more.

But “make test” fails for me now. Should I be pulling some specific branch for my development or I should be developing on HEAD?

Here is what I did today:
[ platform]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION=“7 (Core)”

[ platform]$ uname -a
Linux mm-dev.novalocal 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

git pull

[ platform]$ git lg |head -1
f6e0310 - (31 hours ago) [PLT-7390] Add Type = 'O' in getting open teams at sql store (#7207) - Saturnino Abril (grafted, HEAD, origin master

make test

[2017/08/24 22:44:02 UTC] [DEBG] GET - /api/v4/websocket
[2017/08/24 22:44:02 UTC] [DEBG] websocket.read: closing websocket for userId=4hc7t5ta73rxdeksgx86mbairo error=read tcp [::1]:8065->[::1]:43554: read: connection reset by peer
[2017/08/24 22:44:02 UTC] [DEBG] GET - /api/v4/websocket
[2017/08/24 22:44:02 UTC] [DEBG] /api/v3/users/websocket:ping
[2017/08/24 22:44:03 UTC] [EROR] websocket routing error: seq=4 uid=4hc7t5ta73rxdeksgx86mbairo api.web_socket_router.no_action.app_error [details: ]
[2017/08/24 22:44:03 UTC] [EROR] websocket routing error: seq=5 uid=4hc7t5ta73rxdeksgx86mbairo api.web_socket_router.bad_action.app_error [details: ]
[2017/08/24 22:44:03 UTC] [EROR] websocket routing error: seq=0 uid=4hc7t5ta73rxdeksgx86mbairo api.web_socket_router.bad_seq.app_error [details: ]
[2017/08/24 22:44:04 UTC] [DEBG] /api/v3/users/websocket:user_typing
[2017/08/24 22:44:04 UTC] [EROR] /api/v3/users/websocket:user_typing seq=6 uid=4hc7t5ta73rxdeksgx86mbairo Invalid channel_id parameter [details: ]
— PASS: TestWebSocket (3.38s)
=== RUN TestZZWebSocketTearDown
— PASS: TestZZWebSocketTearDown (2.00s)
FAIL
[2017/08/24 22:44:06 UTC] [INFO] Stopping Server…
[2017/08/24 22:44:06 UTC] [INFO] Closing SqlStore
[2017/08/24 22:44:06 UTC] [INFO] stopping websocket hub connections
[2017/08/24 22:44:06 UTC] [INFO] Server stopped
coverage: 46.2% 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/plugin, github .com/mattermost/platform/plugin/pluginenv, github .com/mattermost/platform/plugin/plugintest, github .com/mattermost/platform/plugin/rpcplugin, 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 354.742s
make: *** [test-te] Error 1

What branch to pull from?

You should be always pull against master for development, only in a few specific cases you will be using a specific branch.

The make test failing

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

The user and password

You normally have to register first, and this first user becomes your user and also a system_admin.

I was reading https://docs.mattermost.com/developer/developer-flow.html and in step #4 it says that “make test” needs to be run to prevent regressions. However, I am currently not able to run it.
How would I submit patches?

I think you misunderstood me, make test does not, or rather will not succeed because it does not take into account cross-package. It will still do what it needs to in related to what it needs to check.

As you can see in your error log, it fails exactly on one of the items listed as said to fail API4.

The current coverage is at 47.45% and you can see that on the listed link on my previous answer.

If you need to further test something specific, you have that step that allows you to test something specific.

However make test does not stop you from using make run or make package and in the later if your code is wrong it will not compile and point out why.

Okay then. I will not worry about those api4 tests then.