librelist archives

« back to archive

Acceptance tests with bash as /bin/sh

Acceptance tests with bash as /bin/sh

From:
Athos Ribeiro
Date:
2014-01-06 @ 19:34
Hello guys,

I got Analizo to run on Fedora 20 last weekend and will try to generate
rpms for it and some dependencies like doxyparse as well. While running
the acceptance tests one of the tests failed with the following output:

(::) failed steps (::)

Output does not match
"^id,previous_commit_id,author_date,author_name,author_email,.*,sc_mean"! 
(expected to match)!
Standard output:
-------------------------------------------------
-------------------------------------------------

Standard error:
-------------------------------------------------
sh: ((: analizo metrics-history -o metrics.csv . && cat metrics.csv:
syntax error in expression (error token is "metrics-history -o
metrics.csv . && cat metrics.csv")
-------------------------------------------------

 (AnalizoException)
./features/step_definitions/analizo_steps.rb:124:in `/^the output must
match "([^\"]*)"$/'
features/metrics_history.feature:24:in `Then the output must match
"^id,previous_commit_id,author_date,author_name,author_email,.*,sc_mean"'

Failing Scenarios:
cucumber features/metrics_history.feature:21 # Scenario: actually
processing


I got the test to pass removing the parenthesis on
features/metrics_history.feature line 23:

And I run "(analizo metrics-history -o metrics.csv . && cat
metrics.csv)"

Changing it to:

And I run "analizo metrics-history -o metrics.csv . && cat metrics.csv"

Still not sure why that happens, but maybe it happens because of the
differences between the default /bin/sh (used by ruby) in the distros.

Anyway, is it ok/safe to remove those parenthesis from the test?
-- 
Athos Ribeiro
athoscribeiro@gmail.com
+55 61 8446-0606

Re: [analizo] Acceptance tests with bash as /bin/sh

From:
Antonio Terceiro
Date:
2014-01-06 @ 21:34
On Mon, Jan 06, 2014 at 05:34:22PM -0200, Athos Ribeiro wrote:
> I got the test to pass removing the parenthesis on
> features/metrics_history.feature line 23:
> 
> And I run "(analizo metrics-history -o metrics.csv . && cat
> metrics.csv)"
> 
> Changing it to:
> 
> And I run "analizo metrics-history -o metrics.csv . && cat metrics.csv"
> 
> Still not sure why that happens, but maybe it happens because of the
> differences between the default /bin/sh (used by ruby) in the distros.

that's exactly it:

$ dash -c '((echo foo))'
foo
$ bash -c '((echo foo))'
bash: ((: echo foo: syntax error in expression (error token is "foo")

> Anyway, is it ok/safe to remove those parenthesis from the test?

yes

-- 
Antonio Terceiro <terceiro@softwarelivre.org>
http://softwarelivre.org/terceiro