curl + swat VS selenium

No, this is not about holy war ! I do respect other tools (-: , really

But rambling on stackoverflow I found quite interesting question about web tests automation. The author started using curl for quite simple test automation task and then changed to selenium web driver, the reason was quite obvious - curl has request oriented design which make it hard to use it when making complicated, sequential requests in a whole test story.

But curl is still cool stuff to get rid of , but you don't have to ... if you use swat PLUS curl.

So here is my answer ...

testing JSON/XML applications using swat

Hi!

I have just released swat, version 0.1.80 to support JSON/XML applications testing with the help of so called response processors.

Regards

-- Alexey

Outthentic v0.0.11 has just released

Hi!

Outthentic is a generic test framework based on Outthentic::DSL

Here is the link.

Small, but hopefully useful improvements:

  • ability to pass configuration files as ini files in Config::Tiny format - thanks to Ron Savage for great module.

  • set_stdout could be called more then once acting like push into array.

  • test runner - host parameter is respected in case you are going to write tests for some network application

Testing chef coobooks using swat and test kitchen

HI!

Today I want to write a short post about my recent attempts to test chef cookbooks with test kitchen and swat.

I am not going to explain here what chef and test kitchen is. I believe most of us heard about this configuration management system and testing framework for it.

But in few words test kitchen provides some capabilities for chef cookbook developers rapidly test their recipes under various platforms and environments.

Recently a good idea came into my mind. Swat could be a good companion for all this eco system. As far as:

  • swat provides DSL for rapid web tests development
  • sparrow is a small swat infrastructure tool acting like cpan client for swat modules get installed from SparrowHub - central repository for shareable swat test suites

So I went ahead and created some useful test suites could be run as simple integration tests for 2 popular chef cookbooks:

Here it is 2 sparrow plugins to test those cookbooks:

Ok, to make long story short. What do these plugins do?

Once test kitchen run test action:

kitchen test

A brand new instance gets created and converged by chef using one of mentioned cookbook (apache2 or httpd), then test part comes into play, and so swat plugins gets run. This is how it looks for example for apache2 cookbook:

$ kitchen verify swat-debian                                                                                                               10:32-----> Starting Kitchen (v1.4.2)
-----> Verifying <swat-debian-76>...
       Preparing files for transfer
-----> Busser installation detected (busser)
       Installing Busser plugins: busser-bash
       Plugin bash already installed
       Removing /tmp/verifier/suites/bash
       Transferring files to <swat-debian-76>
-----> Running bash test suite
-----> [bash] swat_test.bash
       project foo already exists - nothing to do here ...

       checkpoint foo/apache already exists at /usr/local/share/perl/5.14.2/Sparrow/Commands/CheckPoint.pm line 39
        Sparrow::Commands::CheckPoint::check_add('foo', 'apache') called at /usr/local/bin/sparrow line 123
       set base_url

       set plugin to public@swat-apache2-cookbook

       # running export swat_my=/home/vagrant/sparrow/projects/foo/checkpoints/apache/swat.my && cd /home/vagrant/sparrow/plugins/public/swat-apache2-cookbook && carton exec 'swat ./ working.computers.biz' ...

       /home/vagrant/.swat/.cache/18283/prove/00.GET.t ..
       ok 1 - GET working.computers.biz/ succeeded
       # response saved to /home/vagrant/.swat/.cache/18283/prove/drIQlxuYOf
       ok 2 - output match '200 OK'
       ok 3 - output match /Server: Apache/
       ok 4 - output match 'Hello World'
       1..4
       ok
       All tests successful.
       Files=1, Tests=4,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.04 cusr  0.00 csys =  0.06 CPU)
       Result: PASS
       Finished verifying <swat-debian-76> (0m14.54s).
-----> Kitchen is finished. (0m19.20s)
zlib(finalizer): the stream was freed prematurely.

Very simple!

As far as I know ruby folks have no by hand rubygems for real integration tests under test kitchen, all I found:

(IMHO) Are not being competitive in web testing against a swat! I have just heard that ospcode guys run recently InSpec which does something similar as swat, but I still think swat/perl could have a good chance to be a real player on this field .

And , finally if you:

  • code on Perl
  • love web test automation
  • and ( perhaps ) interested in infrastructure automation

You could be one of perl community representative in a ( foreign ? ((: ) world of chef and ruby, it could be intrigues ...

Let me know if you need any help with swat tests development, so we could go together and promote Perl into configuration management.

PS For those who want to look at implementation - here are two pull requests for both cookbooks awaited for being reviewed:

Swat tests for blogs.perl.org

Hi! This is a simple swat monitoring test suite for blogs.perl.org. Probably blogs.perl.org maintainers already have some monitoring stuff, but if not, guys, I would be glad to share this one with you! :-) , let me know in case you have other ideas on how this suite could be adjusted for your needs.

About melezhik

user-pic Dev & Devops --- Then I beheld all the work of God, that a man cannot find out the work that is done under the sun: because though a man labour to seek it out, yet he shall not find it; yea further; though a wise man think to know it, yet shall he not be able to find it. (Ecclesiastes 8:17)