rocdev-foundation / medera

Is a chat bot the new "Hello, World"?
GNU General Public License v3.0
1 stars 2 forks source link

Add Phoenix #4

Closed dantswain closed 7 years ago

dantswain commented 7 years ago

Probably the CI will fail right now because I haven't worked through any of the docker stuff. It builds and tests pass on my machine so far.

geowa4 commented 7 years ago

  Software Design                                                               
┃ 
┃ [D] ↓ Nested modules could be aliased at the top of the invoking module.
┃       lib/medera.ex:41:5 (Medera.config_change)

  Code Readability                                                              
┃ 
┃ [R] → Modules should have a @moduledoc tag.
┃       lib/medera.ex:1:11 (Medera)
┃ [R] ↓ Line is too long (max is 80, was 88).
┃       web/web.ex:47:81 (Medera.Web.view)
┃ [R] ↓ Line is too long (max is 80, was 83).
┃       web/channels/user_socket.ex:26:81 (Medera.UserSocket.connect)
┃ [R] ↓ Line is too long (max is 80, was 84).
┃       lib/medera.ex:28:81 (Medera.start)```
dantswain commented 7 years ago

Done. Note - not a single one of those things was introduced by me. It was all from the templates that mix phoenix.new generates.

geowa4 commented 7 years ago

You'll have the following environment variables for connecting to the database. I can "rename" (OUR_ENV_VAR=$THEIR_ENV_VAR) these in the test script if desired.

SNAP_DB_PG_HOST
SNAP_DB_PG_PORT
SNAP_DB_PG_USER
SNAP_DB_PG_PASSWORD
SNAP_DB_PG_URL
SNAP_DB_PG_JDBC_URL
dantswain commented 7 years ago

We might want to change it to MEDERA_DB_URL or something that would make sense outside the context of the CI server.

The latest will probably still fail on the slack connection. See #fp chat for discussion on that.

dantswain commented 7 years ago

Hrm, it still acts like it doesn't know about SNAP_DB_PG_URL

geowa4 commented 7 years ago

How about this as the run command? docker run --rm -e "SLACK_API_TOKEN=$SLACK_API_TOKEN" -e "MEDERA_DB_HOST=$SNAP_DB_PG_HOST" -e "MEDERA_DB_PORT=$SNAP_DB_PG_PORT" -e "MEDERA_DB_USER=$SNAP_DB_PG_USER" -e "MEDERA_DB_PASSWORD=$SNAP_DB_PG_PASSWORD" medera mix test

dantswain commented 7 years ago

We need to make it so that the tests don't connect to slack. For the Db I think that's fine though we should be able to get away with just using the URL