Run Rails tests on Gitlab CI with a Postgres database
Gitlab CI can be used to run rails tests on every push. It’s pretty straight forward to setup.
First create a
before_scriptinstalls everything we need to run the tests.
testjob creates the database and executes the tests.
Next, create a gitlab specific database config
config/database-gitlab.ymlto connect to the database setup earlier.
Now the tests will be run on each push!
Reading passwords from a file with Selenium IDE and SelBlock
Recently I found the need to have Selenium loop through a bunch of commands for different users, each with their own usernames and passwords.
Thankfully, it's fairly painless to setup using the SelBlock plugin for Selenium IDE.
Create a datafile:
If the file is saved in the same directory as the test script, you can use a relative path.
Loop through it and log the username:
Moving from Heroku to Dokku
With Heroku's recent changes to their plan offerings, my hosting costs were suddenly about to increase form $0 a month to $42. To run an app 24 hrs a day, you need to be on the hobby tier ($7/month). Not really happy with that, I decided to look elsewhere.
I had previously explored Amazon's elastic beanstalk PaaS, but this time around I wanted to try hosting my own PaaS. Dokku bills itself as being a "Docker powered mini-Heroku in around 200 lines of Bash". After reading good things about it, I decided to give it a shot on a Digitial Ocean dropet.
- Older posts