- Ruby version 3.1.2 (see .ruby-version)
- PostgreSQL 12.4+
It is recommended to use rbenv to install a specific Ruby version.
- Install Ruby with the correct version (run
rbenv version
to check) - Install PostgreSQL
- Clone the project
- Install dependencies with
bundle install
- Initialize the database (users, databases) by running
init_db.sql
:sudo --user postgres psql < ./.github/workflows/init_db.sql
- (Optional) Edit
config/database.yml
if you chose a different password - Install Overcommit:
bundle exec overcommit --install
- Add a
master.key
file in theconfig
folder and add the key from vault
The basic command to run tests is rails test
.
By default, "system" tests (end-to-end tests with a real browser) are not run with rails test
. You need to
run rails test:system
to run them specifically, or rails test:all
. System tests execute in a headless Chrome/Chromium
browser (meaning the browser window will not appear), but you can select your browser of choice (Chrome, Firefox or
Firefox Nightly) and configure the headless behaviour with the following commands:
rails test:system:chrome
rails 'test:system:chrome[headless]'
rails test:system:firefox
rails 'test:system:firefox[headless]'
rails 'test:system:firefox[nightly]'
rails 'test:system:firefox[nightly,headless]'
Note that if you pass arguments to the rails tasks (using square brackets), you need to quote the entire task name or else your shell will probably try to expand the brackets (see the examples above).
We use a bit of tooling around tests to help us and increase our confidence in our code:
- Minitest and minitest-reporters are used to polish test outputs
- Guard is set up to run tests automatically on changes. You can start it with
bundle exec guard
- Test coverage is done with Simplecov. After running your tests, open
coverage/index.html
in the browser of your choice. For the tests to pass, there must be a minimum global coverage of 90% and 80% per branch and file.
We are using the secrets management provided by rails. The secrets are encrypted by a master key, and are stored in
config/credentials.yml.enc
.
To edit the secrets, use the command EDITOR="nano" rails credentials:edit
(if you don't have nano, use another editor).
See the docs folder for the documentation.
For now only the results of a brainstorming session about our requirements is available.
- Our original project Lea4. We had to move to Re2o when we became independent and needed to manage subscriptions.
- Re2o, which we used for 4 years. Unfortunately it does too much, and is too complex to configure, use and maintain.
This README would normally document whatever steps are necessary to get the application up and running.
Things you may want to cover:
-
Ruby version
-
System dependencies
-
Configuration
-
Database creation
-
Database initialization
-
How to run the test suite
-
Services (job queues, cache servers, search engines, etc.)
-
Deployment instructions
-
...