-
Notifications
You must be signed in to change notification settings - Fork 0
Development
This page documents useful commands you may need when working on the Lamorinda Spirit Van project during local development, testing, and debugging.
Run these commands after cloning the project and installing dependencies to initialize your local database:
You can view all available Rake tasks with:
rake --tasks
All-in-one Rake task command that resets the database, runs migrations, seeds, and imports data:
rake setup:all
Standard setup commands:
# Drop the database (use only if you want to reset from scratch)
rake db:drop
# Create the database
rake db:create
# Run all migrations
rake db:migrate
# Seed with base data
rake db:seed
# Import mock address, passenger, and ride data
rake import:all
Use the following commands to verify that everything is working:
bundle exec rspec # Run RSpec unit and integration tests
bundle exec cucumber # Run Cucumber feature tests
After running tests, you can open the SimpleCov HTML report locally:
open coverage/index.html
First, ensure xdg-utils
is installed:
sudo apt install -y xdg-utils # -y auto-confirms installation
Then open the report with:
xdg-open coverage/index.html
This report shows line-by-line test coverage for the codebase, including both RSpec and Cucumber tests.
If you need to manually push local changes to Heroku and reinitialize the remote database, follow the steps below.
If this is your first time using Heroku CLI on this machine, log in via:
heroku login
This will open a browser window to authenticate your Heroku account.
git branch --show-current # Shows your current Git branch
heroku apps # Lists your Heroku apps
Check whether the heroku
remote is configured:
git remote -v
If not, add it by replacing <your-app-name>
with your actual Heroku app name:
heroku git:remote -a <your-app-name>
You should now see heroku
listed as a Git remote.
Replace your-branch-name
with the result of git branch --show-current
:
git push heroku your-branch-name:main
Example:
git push heroku 85-feat-password-reset-emails:main
heroku pg:reset --confirm <your-app-name>
heroku run rake db:migrate
heroku run rake db:seed
heroku run rake import:all
heroku restart
To simplify future command usage, you can rename the heroku
remote:
git remote rename heroku my
After this, use --remote my
instead of --remote heroku
in all future commands.
If you are running into environment or setup issues, please refer to the Getting Started page for full setup instructions.
Before deploying to Heroku, make sure all required environment variables have been properly configured. See Environment Configuration for details.