I made a simple example: 

→ cat Makefile 
test:
echo '1' > tmp.out
echo '2' > tmp2.out
diff tmp.out tmp2.out



And run in in GitLab CI with `make test`

It returns failed build.

make test
echo '1' > tmp.out
echo '2' > tmp2.out
diff tmp.out tmp2.out
1c1
< 1
---
> 2
make: *** [test] Error 1


 If I change `2` to `1` it returns green build 

make test
echo '1' > tmp.out
echo '1' > tmp2.out
diff tmp.out tmp2.out


It seems to work correctly for simple case. Try to move from simple 
Makefile to your example to find out a point where things goes wrong 


On Wednesday, July 2, 2014 7:27:08 PM UTC+3, Neal Lewis wrote:
>
>
> I posted this in stackoverflow also:   
> http://stackoverflow.com/questions/24410998/gitlab-ci-runner-hangs-after-makefile-test-fails
>
>
> I am using Gitlab-CI for my build tests. I have a very simple test which 
> compares the output of the test install/build with the known output. I put 
> the test in a makefile. 
>
> The Makefile entry looks like this:
>
> test:clean
>     make install DESTDIR=$(TEST_DIR)
>     $(TEST_DIR)/path/to/executable > $(TEST_DIR)/tmp.out
>     diff test/test.result $(TEST_DIR)/tmp.out
>
> When the diff passes, an exit code of 0 is returned, a exit code of 1 is 
> returned if the diff shows a difference in the files. 
>
> What I've tried:
>
>    1. Running make test from any shell runs the tests and exits, 
>    regardless of diff result
>    2. Running make test from the shell as gitlab_ci_runner runs the tests 
>    and exists regardless of diff result
>    3. When ran from Gitlab-CI, and the diff exit status is 0, the build 
>    returns success
>
> The problem:
>
>    - When ran in the Gitlab-CI and the diff exit status is non-0, the 
>    build hangs. 
>    - The output on the build screen is the output of the diff, and the 
>    last line is the expected error: make: *** [test] Error 1
>    - After that, the cycle symbol keeps on, the runner does not exit with 
>    a build fail. 
>
> Any ideas? I thought that it might be something with Makefiles, but the 
> Gitlab-CI will exit with a fail status if the Make exits with Error 1 for 
> any other test. I can only see it happening on the output of the diff. 
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/1a020ba2-a73b-49de-b76f-c3d023e22370%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to