Unable to run ct_netconfc_SUITE testcase - erlang

When I try to run a testcase specified in the test suite ct_netconfc_SUITE, I am getting an error “Failed to start CTH, see the CT Log for details”. What could be the issue? Please give me pointer to resolve the issue. I did not find any clue in the CT log.
cd otp\lib\common_test
ct_run -suite test\ct_netconfc_SUITE -case get
Failed: "Failed to start CTH, see the CT Log for details", [{ct_netconfc_SUITE, init_per_suite}]

How to run the tests in the Erlang/OTP repo is documented here.
In that documentation it tells you that you should run make test to run the tests, so try that and see if it works.

Related

Git Bash: "bash: env: command not found" but only after running the 'export' command first. Why?

I use git bash on a windows 10 machine through Windows Terminal. The command 'env' works perfectly every time I start up a session in git bash. However, if I try to do any 'export' command, running any 'env' command after that will raise the error 'bash: env: command not found'. If I close my session and start another one, 'env' works perfectly again. Why is this happening?
I've tried all permutations of the 'env' command, but nothing works. The 'export' command always works, which I know because I tested it to see if it does indeed modify my PATH.
Note: I'm not sure what relevant system info would be helpful to include here, so please tell me what you'd need to solve this issue, but I'd prefer to include as little as possible for privacy.

How to gain visibility of the output of a bash script executed from a Dockerfile?

I received this error message which means something is erroring inside a bash script executed by the Dockerfile.
As an example, if something inside test.sh errors:
RUN test.sh
# 16 ERROR: executor failed running [/bin/sh -c test.sh]: exit code: 127
Question
What is the recommended way to gain visibility over the exact error message (i.e. to find out what's gone wrong) and to diagnose which line(s) of a bash script executed from a Dockerfile are problematic? Can docker be made to provide the output of the bash script so the exact error message is provided? Rather than just the somewhat cryptic:
executor failed running exit code: 127
as seen here.
What I know so far
One way to diagnose which line(s) is playing up is to survey the script, assess which line(s) might be causing problems, and comment out the suspect line and everything after it. If the error goes away, you've found the (first) line that is a problem, and it can be addressed. Rinse and repeat until the script is error-free. But this seems more manual than one would hope.

Codeship marks the test as "failed" even when there is no error

I have some rails-cucumber tests, all looks fine but CS says the test suite failed:
I didn't set "--strict" in the command line.
You'll want to investigate why it is that your process might be returning a non-zero exit code. The recommendation here is to hop into an ssh debug for your build and verify that each step is returning a zero exit code:
echo $?

android.test did not get installed. Reason: 'Aborted '

I am running calabash android test on docker and whenever I run the test the error
com.beats.android.test did not get installed. Reason: 'Aborted '. Aborting! (RuntimeError)
./features/support/app_installation_hooks.rb:19:in `Before'
Will not start test server because of previous failures. (RuntimeError)
./features/support/app_life_cycle_hooks.rb:5:in `Before'
is getting. I have tried the below commands and even after getting the same error.
calabash console
Here in this case I will have to use the virtual emulator and I am running the test on docker. All kind of helps are appreciated.
Please check if ENV['TEST_APP_PATH'] has been set.

Jenkins post build task script aborting when result of `{cmd}` is empty in script

I got strange behavior of Jenkins post build task script.
its purpose is showing build error in slack like following.
EDIT: our Jenkins running on Mac OSX Yosemite (10.10.4) and using Unity3d as build tool.
SLACK_BOT_PATH=$WORKSPACE/tools/bot.rb
SLACK_BOT_NAME="cortana"
SLACK_BOT_TOKEN=`cat $WORKSPACE/../../sendchat_token`
ERRORS=`tail -5000 ~/Library/Logs/Unity/Editor${BUILD_NUMBER}.log | grep ": error"`
ruby $SLACK_BOT_PATH $SLACK_BOT_NAME $SLACK_BOT_TOKEN "build fails : $ERRORS"
and strange behavior is, it aborted on the ERRORS= line when ERRORS has no contents (empty string). Jenkins console output is like following.
[workspace] $ /bin/sh -xe /var/folders/j3/8x825bdn2l9dm497yjs2144c0000gn/T/hudson7348609981772923445.sh
+ SLACK_BOT_PATH=*snip*
+ SLACK_BOT_NAME=cortana
++ cat *snip*/../../sendchat_token
+ SLACK_BOT_TOKEN=*snip*
++ tail -5000 ~/Library/Logs/Unity/Editor1710.log
++ grep ': error'
+ ERRORS=
POST BUILD TASK : FAILURE
after I change grep filter so that ERRORS has some contents, the post build script runs correctly again.
I want to report some general error message (eg. build fails) when no actual ERRORS found in logs. but also report detail error message when its available.
of course it is easy that inserting some line to send general message before grep error log so that every time such a general message sent to slack, but I want know the reason why empty ERRORS terminate entire script.
does anyone encounter same issue? if so, finally you know the cause of problem? thanks.
To be precise Jenkins will terminate your build when ERRORS is empty in you code because when there is no output from the grep command, your shell errorlevel will be set to 1 automatically , therefore it terminates your build with error ERRORS= , you can debug the same by printing errorlevel value. echo $ERRORLEVEL [linux] or echo %ERRORLEVEL% [windows]. Error 0 stand for success and other error codes stands for failure. if you want your post build script to be executed ignoring even if grep output is empty , then set errorlevel value in post build step of jenkins build.
ERRORLEVEL=0
Try the above and see if that helps
As #prudviraj explained, the issue is that your grep command returns without finding anything, and therefore returns with exit code 1.
Read detailed answer here: Jenkins Build Script exits after Google Test execution
In short: your script is launched with /bin/sh -xe, the -e means "fail immediately on any error", and your grep "errors out" when nothing is found.
The quick fix is to put set +e before the command. But the better way is proper error handling, as explained in the other answer I've linked.

Resources