Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI test run does not reflect real production systems #68

Closed
stefanb2 opened this issue Apr 27, 2016 · 7 comments
Closed

CI test run does not reflect real production systems #68

stefanb2 opened this issue Apr 27, 2016 · 7 comments

Comments

@stefanb2
Copy link
Contributor

No wonder that I can't even get passing tests on Ubuntu 14.04. The CI test has a hard-coded

ln -sf /bin/bash /bin/sh

which normal users aren't allowed on production systems. It's a bad idea anyway, because it would corrupt the Ubuntu installation.

IMHO the test cases and/or test runner needs to be updated to use /bin/bash everywhere.

@stefanb2
Copy link
Contributor Author

test suite seems to be really unstable. Trying all cases (ruby runtest.rb -c, -c -n, -c -n -a) on Ubuntu 14.04, Fedora 23, Fedora 23 with make 3.81 in $PATH leaves me with 1 to 8 unexpected passes/failures.

I wish I had at least one combination with 0 :-/

@shinh
Copy link
Contributor

shinh commented May 2, 2016

Now runtest.rb sets SHELL=/bin/bash and "ln -sf /bin/bash /bin/sh" was removed from the travis CI setting: fc24bd2 I also made a bunch of changes for GNU make 4. Hopefully these changes mitigate your issue?

@stefanb2
Copy link
Contributor Author

stefanb2 commented May 3, 2016

Your latest changes improve the situation somewhat. "ruby runtest.rb -c" now passes on my Ubunut 14.04 machine.

But other tests can still fail, I think there is something wrong with handling of echo handling when using ninja?

err_error_in_recipe.mk: FAIL
--- out.make    2016-05-03 09:56:37.074432172 +0300
+++ out.kati    2016-05-03 09:56:37.074432172 +0300
@@ -1,4 +1,5 @@
 === test ===
+/bin/bash -c "echo -e \"Makefile:2: *** foo.\" 2>&1 && false"
 Makefile:2: *** foo.

 === FILES ===
fail_ignore_error.mk: FAIL
--- out.make    2016-05-03 09:56:38.302433053 +0300
+++ out.kati    2016-05-03 09:56:38.302433053 +0300
@@ -1,5 +1,6 @@
 === test ===
 *** [test] Error 1
+/bin/bash -c "(false ) && (false ; true ) && (echo FAIL )"

 === FILES ===

fail_subshell_in_recipe.mk: FAIL
--- out.make    2016-05-03 09:56:38.330433073 +0300
+++ out.kati    2016-05-03 09:56:38.330433073 +0300
@@ -1,5 +1,6 @@
 === test ===
 *** [test] Error 1
+/bin/bash -c "(false ) && ((true) ; echo FAIL )"

 === FILES ===

@shinh
Copy link
Contributor

shinh commented May 9, 2016

Could you tell me the result of

$ cd out/err_error_in_recipe.mk && ninja

For me, the output is

[1/1] build test
FAILED: /bin/bash -c "echo -e "Makefile:2: *** foo." 2>&1 && false"
Makefile:2: *** foo.
ninja: build stopped: subcommand failed.

The line with "FAILED:" should be removed by https://github.com/google/kati/blob/master/runtest.rb#L114 . But it looks like your ninja doesn't have the FAILED: prefix?

@stefanb2
Copy link
Contributor Author

stefanb2 commented May 9, 2016

I have two lines, where you have one line:

[1/1] build test
FAILED: test
/bin/bash -c "echo -e \"Makefile:2: *** foo.\" 2>&1 && false"
Makefile:2: *** foo.
ninja: build stopped: subcommand failed.

Maybe you are not using upstream master of ninja?

shinh added a commit that referenced this issue May 9, 2016
@shinh
Copy link
Contributor

shinh commented May 9, 2016

Ah, it seems very recent ninja outputs two lines. The above change works?

@stefanb2
Copy link
Contributor Author

stefanb2 commented May 9, 2016

Yes, on Ubuntu 14.04 (make 3.81 in $PATH) and Fedora 23 (make 4.0 in $PATH) I now get passing result for -c, -c -n and -c -n -a

Closing this issue.

@stefanb2 stefanb2 closed this as completed May 9, 2016
zchee pushed a commit to zchee/kati that referenced this issue Nov 29, 2016
zchee pushed a commit to zchee/kati that referenced this issue Nov 29, 2016
zchee pushed a commit to zchee/kati that referenced this issue Nov 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants