Skip to content

Latest commit

 

History

History
76 lines (54 loc) · 2.14 KB

CONTRIBUTING.md

File metadata and controls

76 lines (54 loc) · 2.14 KB

Build Status

Contributing

Producer

Message responses are coded in the Producer implementations in the sectery.producers package of the producers module.

To add support for a new message response:

  1. Write a new Producer implementation, e.g. Count
  2. Write a test for it, e.g. CountSpec
  3. Add it to the list of producers in Producer.producers

Testing

For operational convenience, tests use H2. Production uses MySQL, so SQL queries need to be portable between the two.

$ sbt test

Integration testing

To test against a real IRC server, export the necessary env vars and run the test main method:

$ IRC_USER=redacted \
  IRC_PASS=redacted \
  IRC_HOST=redacted \
  IRC_PORT=redacted \
  OPEN_WEATHER_MAP_API_KEY=redacted \
  AIRNOW_API_KEY=redacted \
  FINNHUB_API_TOKEN=redacted \
  OPENAI_APIKEY=redacted \
  SLACK_BOT_TOKEN=redacted \
  SLACK_APP_TOKEN=redacted \
  sbt Test/run

This uses Testcontainers to run the necessary RabbitMQ and MariaDB dependencies within local Docker containers.

References

PircBotX

Sectery uses PircBotX to interface with an IRC server.

ZIO

Sectery uses ZIO for asynchronicity and structuring effects.