144 Commits

Author SHA1 Message Date
Thibault Jouan
35621e1f5f Implement condition DSL negated test prefix (no_*)
* Allow no_* to be used for every tests in condition DSL:
  condition { no_has_env :shell, '/bin/sh' };
* Modify Test constructor to accept negated: named argument, implement
  #negated? and #pass?;
* Rename #success? to #verify in all test classes.
2013-12-19 20:22:44 +00:00
Thibault Jouan
85a47df547 Use SSH user name configured for a given target:
When a user is configured for the targeted host name, use it for SSH
authentification instead of the name of current user logged in.

* Modify Remote#user_name to use configured user name.
2013-09-28 20:07:36 +00:00
Thibault Jouan
2cbe1726f7 Implement `has_file' condition keyword 2013-09-26 00:28:40 +00:00
Thibault Jouan
c01e143c86 Enable sftp subsystem in cucumber sshd config 2013-09-26 00:28:39 +00:00
Thibault Jouan
36cf2e041f Improve wording in sh cucumber feature 2013-09-07 21:40:59 +00:00
Thibault Jouan
85109afd46 Fix missing Then keywords in cucumber features 2013-09-07 21:40:25 +00:00
Thibault Jouan
33a2b9de5a Refactor producer invocation in cucumber features:
Use "When I successfully execute" instead of "When I execute", and
assert that exit status code was successful in this new step.
2013-09-06 20:10:28 +00:00
Thibault Jouan
7a1c01a299 Remove empty cucumber support file 2013-08-22 00:11:09 +00:00
Thibault Jouan
04afc82a29 Implement `has_env' condition keyword 2013-08-20 03:03:17 +00:00
Thibault Jouan
639bdc1c73 Implement basic condition DSL framework for tests:
Instead of interrupting task evaluation when condition is not met,
allow the whole task to be evaluated (including condition and
evaluation) so that the interpreter will get all tasks actions (whether
condition is met or not) and be able to query the condition.

* Modify Interpreter#process_task: test if task condition is met before
  applying the actions;
* Implement condition handling in Task and Task::DSL;
* Implement Condition and Condition::DSL (useless as they are, but
  needed to implement later test keywords as part of the condition DSL.
2013-08-18 00:29:14 +00:00
Thibault Jouan
a675c9c910 Implement `echo' task action 2013-08-14 23:43:36 +00:00
Thibault Jouan
53db841b2d Remove Env#current_recipe attribute 2013-08-13 01:36:33 +00:00
Thibault Jouan
a5d9ca26f4 Remove error handling for evaluation errors 2013-08-13 00:42:14 +00:00
Thibault Jouan
825bdec74d Improve `sh' task action error handling:
Handle exit status code in Remote#execute.
2013-08-07 23:39:49 +00:00
Thibault Jouan
f10914c7d7 Implement basic `sh' task action feature:
* Executes a command on the remote host;
* Forwards remote standard output.
2013-08-07 16:16:40 +00:00
Thibault Jouan
3c92b04b90 Rename task evaluation feature file 2013-08-06 19:05:43 +00:00
Thibault Jouan
6f563d75d7 Improve a test in task evaluation feature 2013-08-06 19:05:01 +00:00
Thibault Jouan
72d6a853ae Improve wording in task evaluation feature 2013-08-06 19:04:49 +00:00
Thibault Jouan
d5cbff9c4d Improve wording in `condition' task keyword feature 2013-08-06 19:02:35 +00:00
Thibault Jouan
786c2f56d6 Improve wording in `target' recipe keyword 2013-08-06 19:00:57 +00:00
Thibault Jouan
cd13cebfd8 Refactor `source' recipe keyword feature 2013-08-06 19:00:14 +00:00
Thibault Jouan
bc0ea65316 Improve wording in `source' recipe keyword feature 2013-08-06 18:55:24 +00:00
Thibault Jouan
64a57c7cfd Improve test in recipe evaluation output feature 2013-08-06 18:55:00 +00:00
Thibault Jouan
98b141136b Improve wording in `env' recipe keyword feature 2013-08-06 18:49:57 +00:00
Thibault Jouan
5c11487601 Fix indentation in CLI usage feature 2013-08-06 18:49:35 +00:00
Thibault Jouan
8069e1ceaf Improve features directory tree 2013-08-06 18:48:52 +00:00
Thibault Jouan
d7d7d42223 Implement @sshd cucumber tag hooks:
Fork an sshd server available for the duration of the scenario.

  $HOME will be set to aruba temporary directory, and a custom ssh
config will be written so that the test server is accessible with the
alias `some_host.test'. sshd will listen on port 2222 by default, this
can be overridden by setting DEFAULT_LISTEN_PORT environment variable to
the desired port.
2013-08-05 20:08:11 +00:00
Thibault Jouan
3e3547d3be Fix incorrect paths for env and target features 2013-08-05 19:54:32 +00:00
Thibault Jouan
47560e55c5 Extract cucumber and aruba monkey patches 2013-08-05 14:15:23 +00:00
Thibault Jouan
a3bba6d4da Implement target recipe keyword feature 2013-08-03 23:42:47 +00:00
Thibault Jouan
a6e27edfd2 Add env recipe keyword feature 2013-08-03 23:42:41 +00:00
Thibault Jouan
c4fc9828db Improve error reporting during recipe evaluation
* Report invalid action usages from tasks;
* Implement backtrace cleaning in CLI;
* Extract error class declarations in a new errors file;
* Replace raise with fail keyword in task DSL class.
2013-08-01 20:31:39 +00:00
Thibault Jouan
0ab6a4e246 Improve source feature with explicit exit status 2013-08-01 17:17:44 +00:00
Thibault Jouan
0aa043b61a Remove host argument:
Currently the idea is to later implement a -h (or -t) option to the
command, and/or a `target' recipe keyword. Another option might be to
use the target/host key when the key/value registry will be implemented
and made available to the recipe and task DSLs.
2013-08-01 00:01:20 +00:00
Thibault Jouan
3792f60a5c Improve source recipe keyword feature:
* Improve error reporting from sourced recipe;
* Extract cucumber feature from recipe one.
2013-08-01 00:01:19 +00:00
Thibault Jouan
e12dd5c0e7 Implement recipe error reporting feature 2013-08-01 00:01:15 +00:00
Thibault Jouan
d146566411 Implement tasks condition feature 2013-07-28 22:56:08 +00:00
Thibault Jouan
baaa957e9e Implement task evaluation feature 2013-07-28 19:18:53 +00:00
Thibault Jouan
c7295fb977 Implement source keyword feature for recipes 2013-07-28 18:38:00 +00:00
Thibault Jouan
0921be9ab0 Implement recipe evaluation feature 2013-07-27 18:20:45 +00:00
Thibault Jouan
a6cfd4d7cb Implement CLI usage feature 2013-07-27 13:04:30 +00:00
Thibault Jouan
929e82cd55 Add monkey patch to fix cucumber docstrings:
Cucumber chomp the last \n from multiline strings (docstrings), this
monkey patch modify Cucumber::Ast::DocString constructor to add the
missing ending new line character and
Cucumber::Formatter::Pretty#doc_string to remove it from the output.
2013-07-27 13:04:23 +00:00
Thibault Jouan
9a726dc389 Add monkey patch to hack aruba steps (must, should) 2013-07-27 13:04:23 +00:00
Thibault Jouan
b380e02e30 Add test dependencies 2013-07-27 13:04:16 +00:00