Travis and Circle: test automation and reality of CI

Why u do this?
Why u do this?

I guess it’s time to do some sort of benchmarking and evaluation on test automation we started to use recently in the company.

*Captain Obvious mode on*

For those companies/developers that still haven’t figured out what’s test automation (front-end/back-end, TDD, BDD, etc) and continuous integration –  guys, you’re doing it wrong. Yeah, I know, I know that “everything works fine for us and there’s no need to waste more money for things we don’t use”.  By the end of the day it’s your time you’re spending on doing things we stopped doing at all focusing on more important things.

Here, I should’ve started explaining you that CI is a money saver in complex projects, when you can iterate faster with production systems increasing the responsiveness of your product/service. Setting up CI infrastructure and pipelining the project/task management is closing down the topic of “D-days” for the projects and all that pressure on the team once you release.

But, I’m pretty sure that you all know about that!

*Captain Obvious mode off*

Coming back to some basic comparisons on Travis and Circle, you won’t find in this post a massive judgement on what’s better. Working with WHMCS-API gem I’ve used Travis-CI for test automation.

Stating that Travis and Circle are interconnected with Coverall, GitHub, Zapier, Asana, and other great services – out of comparison list. It’s just there – live with it and be happy!

Speed performance fully depends on the type of tests you have and level of their complexity. Comparing Ruby gems we test on Circle and Travis – I’d recommend Travis – config file is few lines shorter. Comparing the list of supported languages, platforms – definitely Travis, but I guess it’s the matter of time when Circle gets there.

What was chosen for the next few quarters:

  1. Travis-CI remains for now a a service where we release our open-source projects to do the tests and CI in the company
  2. Technology we use is fully supported by both – thus services can be swapped any time.
  3. Task management is streamlined from “Task given” to “Task deployed, tests ran, check the diff and deploy once feel like it”.

Next time I’ll grumble about something less tech’y.

WHMCS API: heritage of whmcs-ruby gem

Joshua Priddle did a great job back in DotBlock accomplishing Ruby binding for WHMCS API.  Unfortunately, last signs of activity were 3 years ago. It’s a pity, as gem is great, and works like charm, but it became massively outdated, and piled with pull requests no one merged in the master branch for ages.

The code was published by MIT license on 2011, thus whmcs-api gem will be its descendant, which I’ll try to keep updated as much as possible.

For now it’s being tested on Ruby 2.x and WHMCS 5.3.x without any problems. The source code and any issues are better be reported on the Github repo.


Punycode domains: why?!


Honestly, I couldn’t get the idea of non-latin alphabet used in domain names. Especially when the standards were passed, and Registrars started offering cyrillic, arabic domain names, but web browsers still were preferring to output it as a punycode mess.

A pretty simple cyrillic domain like ‘президент.рф’ (stands for president.rf) becomes ‘xn--d1abbgf6aiiy.xn--p1ai’. Not all the browsers still keep cyrillic domains in the address bars, so you’d see some punycode mess in there.

Ugly indeed, and not really useful, so for fast domain unicode/ascii checking that all of them are properly synced, got this tiny script:

How bad is your Change Risk Anti-Pattern index?

Measures the C.R.A.P. (Change Risk Anti-Patterns) score. It is designed to analyze and predict the amount of effort, pain, and time required to maintain an existing body of code.

A method with a CRAP score over 30 is considered CRAPpy (i.e., unacceptableoffensive, etc.).

 C.R.A.P.(m) = comp(m)^2 * (1 – cov(m)/100)^3 + comp(m)

Where comp(m) is the cyclomatic complexity of method m, and cov(m) is the test code coverage provided by automated tests.