News & Tipps für Gebäudereiniger und Betreuungsdienste
Catch the obvious bugs earlier
Of course, everyone has really good test suites, don’t you? So when we use invalid syntax, the test suite will catch it. But there is a better, faster, more thorough way to detect these errors.
We have a build step on our continous integration server that checks all ruby source files in the project for syntax errors in under five seconds. It is run before the test suite. Because the earlier you catch a bug, the lower the costs of fixing it.
If you use git, I also recommend a pre-commit hook that checks all staged ruby source files before you can commit them - so the bugs are caught even earlier.
We achieve this using a small script that integrates the ruby syntax checker (ruby -c) into our workflow at several levels. Wi...
You must establish a database connection before using acts_as_authentic
Today I had some fun when I was deploying my rails application to jenkins. When I tried to
rake test
I got an exception saying
You must establish a database connection before using acts_as_authentic
So I thought: Hey, then I will
rake db:schema:load
first. But I got the same error message again.
After doing some research I discovered that authlogic was expecting the users table to exist. So I created a dummy users table with the dbconsole:
CREATE TABLE users (email varchar(255);
Now I was able to load the schema. Funny. Not.
Custom rake task for Hudson
When I tried to setup up a Hudson job for continuously running our unit and Cucumber tests, I came across several difficulties (e.g. producing proper output which is readable by Hudson). These ultimately lead to writing a custom Rake task for properly setting up and running the tests.
The task requires the ci_reporter plugin to generate JUnit output from the unit tests (Cucumber supports this out of the box). Additionally, everything required for gathering code coverage data is included as well.
Put this into lib/tasks/hudson.rb:
require 'ci/reporter/rake/test_unit'
require 'rcov/rcovtask'
namespace :hudson do
def report_path
"hudson/reports"
end
task :all => [:report_set...
On NoSQL and NoScalability
Currently, there is a lot of buzz around about NoSQL databases. Bold claims are made about NoSQL databases like they “typically scale horizontally”, are “generally designed for horizontal scalability” or “provide developers with levels of […] and scalability not easily attainable using traditional relational databases”. It seems that a NoSQL database inevitably is highly scalable.
This is wrong and misleading. I think, people seem to mix up two completely unrelated things here. For me, the term “NoSQL” in itself only means “not like a traditional SQL database”. In ...
Der Renner: Photovoltaikreinigung
Wir wissen es alle: Die Energiewende kommt und in Deutschland wird dabei auch stark auf Solar und Photovoltaik gesetzt. Im gesamten Land ist zu beobachten, wie eine Dachfläche nach der anderen mit Solarmodulen “zugepflastert” wird. Doch aufgemerkt! Verschmutzung der Module kann den Ertrag aus der Sonnenernergie erheblich beeinträchtigen. Deshalb wird eine neue Reinigungsdienstleistung plötzlich sehr stark nachgefragt: Die Photovoltaikreinigung. Hierbei kommt auf den Reinigungsspezialisten ein völlig neues Betätigungsfeld zu. Die empfindlichen Solarmodule bedürfen spezieller Behandlung, und auch um sich sicher auf den Dächern zu bewegen bedarf es besonderer Qualifikation. Jedes Reinigungsunternehmen sollte sich daher schnell mit diesem Them...