-
Notifications
You must be signed in to change notification settings - Fork 73
/
DEVELOP.md
57 lines (32 loc) · 1.5 KB
/
DEVELOP.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Development Guide
[![Build status](https://badge.buildkite.com/ce01baf77e07a728f3d80575254634c3d63d8a5eda69ba7fb3.svg?branch=master)](https://buildkite.com/operable/cog)
## Local Setup
Cog depends on a few things to run locally:
* Postgres (9.4+)
* A `SLACK_API_TOKEN` environment variable (with a valid token)
With those installed, setup your computer with:
$ mix cog.setup
## Run Cog
$ make run
Cog will be run on `http://localhost:4000`.
## Notes on Relay
If you are running cog with relay, which you probably should be, note that this
version of cog does not work with the old elixir based relay. To use relay use
the new go based version, (https://github.com/operable/go-relay)
## Testing
Preliminary database setup:
$ MIX_ENV=test make reset-db
Unit Tests:
$ make test-unit
Pipeline Integration Tests:
$ make test-integration
Slack Integration Tests
$ make test-slack
Hipchat Integration Tests
$ make test-hipchat
Slack and HipChat tests require credentials provided as environment variables. See the `SLACK_*` and `HIPCHAT_*` variables, respectively, in [The Cog Book](https://cog-book.operable.io/#_cog_server_configuration)
HTTP requests in integration tests are recorded and stubbed out for future test
runs. Recording new cassettes, json files of serialized requests and responses,
happens automatically when using the `Cog.VCR.use_cassette` macro. To
regenerate these stubs by making actual HTTP requests delete the files you wish
to regenerate and run the tests.