- clone this repository
bundle installbin/test, which will run:- rubocop checks
- unit tests
- integration tests
Most tests rely on one or more "scenarios" being loaded. A "scenario" is a combination of:
- database configuration
- model configuration
and the database.yml and model files are all located under test/scenarios/.
In the unit testing suite, there are some scenario helpers (e.g., for_each_scenario) in test/test_helper.rb that allow us to run the tests under one or more scenarios using nested describe blocks.
Isolate the unit tests with bin/test-unit. The test files are all under test/unit/.
Isolate the integration testing suite with bin/test-integration, which:
- for each scenario
- makes a copy of the
test/smarty/app - write the scenario files: database.yml, models, and migrations
- copy the config and test files from
test/integration/ - setup the databases
- run the integration tests
- makes a copy of the
A quick checklist for releasing activerecord-tenanted
- Prechecks
- make sure CI is green!
- update
CHANGELOG.mdandlib/active_record/tenanted/version.rb - commit and create a git tag
- Release
-
bundle exec rake build -
git push && git push --tags -
gem push pkg/activerecord-tenanted*.gem - create a release at https://github.com/basecamp/activerecord-tenanted/releases
-
- Post-release
- bump
lib/active_record/tenanted/version.rbto a prerelease version like1.2.3.dev
- bump