Skip to content

I want to create my own task

aniaw edited this page May 20, 2016 · 6 revisions

It's a great idea!

We preapare some tips that should help you create good task. Just pick the main technology you want to use in your task:

How to write a good task

A good task has good tests

Tests are a must, because it's the only way our Jenkins can check solution correctness. Test scenarios should help developer to properly adjust their solution.

Minimize dependencies

If developer's task is to write DAO layer then probably there is no need to create project with REST layer.

Tag properly

Tags are very handy tool to narrow down the search results. If your task is about Bower, then you could tag it with Bower, JavaScript. But if your task is about AngularJS you should not tag it with Bower even you use bower in your project's configuration. In other words, tags should be related to main skill that is tested by the task.

Use fixed versions in bower.json and package.json

By default bower and package add dependencies like this:

q:"^0.1.0"

Note the ^. If new version arrives (i.e. 0.1.1) then developer will have that version installed, but what if that version introduces a bug? It's not a rare case, so better define your dependencies without ~ and ^:

q:"0.1.0"

Make sure package names in bower.json and package.json are meaningful

Protect important files

Imagine yourself having important files that are not allowed to be changed by third party. Unfortunately git by default doesn't provide you with any countermeasures to lock part of the files in the repository to not to be overwriten by user. We at Realskill decided to introduce realskill.json, a simple JSON pattern file to fill that gap. With realskill.json you can easily lock files in your repository and not to worry that someone may bypass your test data. For more informations visit "Locking files in repository".

Keep it multiplatform

Our platform is designed to met requirements of every kind of platforms and tools that are available on the market. We recommend not to use platform specific features that would prevent people to use your tasks on another platforms unless that is certainly what you need. However, keep in mind that you are required to keep compatibility with Linux platforms as our Jenkins container is running in that environment.

ex.

./node_modules/mocha/bin/mocha test.js

The above example is incorrect because unfortunately Windows platforms are having problems with interpretation of unix alike path, instead they use their own system:

\node_modules\mocha\bin\mocha test.js

To prevent that issues you are provided with multiple tools like Grunt runner to allow you to keep your tasks multiplatform.

Do not use dots, exclamation or question marks in task title

Should tasks have Documentation or Before you start sections?

RealSkill can be used to examine skill of developer and also as a help during training. Examine tasks' readmes should not contain links to documentations, hint videos, etc. On the other hand, we encourage training exercises to include links to documentations, videos and other helpful learning materials.