• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

BDD with JS: Continuous integration

 
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marco,
Do you advocate plugging the BDD code into a Continuous Integration server like Jenkins or Hudson, or are they slow enough you'd recommend running them only at scheduled times?

Thanks,
Burk
 
Burk Hufnagel
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marco,
Based on your answer in another thread, I'm guessing that the kind of BDD testing you're advocating is not very slow since you're looking mostly at business logic and not testing through the UI. Is that an accurate statement of your position?

Burk
 
Author
Posts: 20
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Burk,

exactly! The specs usually execute very fast. And even in the case, they do not - I strongly recommend going through CI server. If you have a slow suite, you should build various stages (e.g.. a low level and a high level stage - with the slower high level stage only running, if the first stage was a success). Just google on build pipelines and Continous Delivery. There is a lot of information available how to setup this stuff. We use Jenkins in our company, but I also heard a lot of good things about JetBrains Teamcity.

If your tests/specs takes more than about two hours to run, you really have other problems In this case I would invest time in optimizing them first.

Do you do GUI tests with different browsers/emulators - for your Sencha Touch stuff?
 
Burk Hufnagel
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Marco Emrich wrote:If your tests/specs takes more than about two hours to run, you really have other problems In this case I would invest time in optimizing them first.


Two hours seems very long - unless you're doing full blown end-to-end testing, and even then I'd make that a scheduled event that runs when nobody's around and delivers a report after it's done.

For developers, I target five minutes for the suite so only unit tests (no network, no file handling, no db access, etc) are allowed, Otherwise it takes too long and they won't run the tests. Which reminds me, some testing frameworks allow the author to tag a test and then just run the tests with that tag - so you can have tests tagged with labels like '@Fast', or '@Slow-DB', so the test runner can run a subset of the test suite then (if those tests passed) run the rest of the suite. Does Jasmine support that? If not, are you aware of another framework that might?

Marco Emrich wrote:Do you do GUI tests with different browsers/emulators - for your Sencha Touch stuff?


The app I'm writing with Sencha is intended to be wrapped as a mobile app and run on a smartphone, so there's only one browser I have to support - though I have tested it out (manually) on Chrome as well.

Burk
 
Marco Emrich
Author
Posts: 20
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Burk Hufnagel wrote:
Which reminds me, some testing frameworks allow the author to tag a test and then just run the tests with that tag - so you can have tests tagged with labels like '@Fast', or '@Slow-DB', so the test runner can run a subset of the test suite then (if those tests passed) run the rest of the suite. Does Jasmine support that? If not, are you aware of another framework that might?



Actually, we do exactly that to create various stages in our Jenkins-Build-Pipeline. It's, however, not Jasmine in this case. It's a ruby application with the RSpec bdd-framework, which supports spec tagging. The Jasmine-specs for this project (there aren't many) disguise themselves as RSpec specs and run within the fast-stage. The remapping of the runner output is done by the Jasmine-gem.

I'm not aware of any JavaScript BDD framework, that provides spec tagging yet. Maybe it's time to write a Jasmine-plugin
 
Burk Hufnagel
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. BTW, if you do write a plugin you should probably add a section to the book that shows folks how to use it. <grin>
Burk
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic