pycharm debug console unreadable because of teamcity - console

Since a few days my pycharm debug console is systematically polluted by teamcity infos, e.g. when i want to print out a variable value, the following will be displayed:
>>> df
##teamcity[testStdOut timestamp='2017-11-02T15:55:00.670' flowId='test_pricing_36_weight_provider.TestPricing36WeightProvider.test_add_weights' locati...
Any hint how to deactivate this teamcity thing ?

This is a PyCharm/IntelliJ bug.
PyCharm replaces stdout with its own object.
They do a bunch of screwing around with objects that get printed, resulting in:
some object are not printed to the prompt
some programs cannot be run if they expect stdout to be a file object and not a StringIO.
This is a long standing bug with PyCharm - there's really no excuse for it in a piece of software with a $500/yr license fee. Being able to debug my program in my IDE out of the box is way up there in my list of requirements.
The work around they recommend is to set:
JB_DISABLE_BUFFERING=1
... which you can do for all unit tests.
See: no output in console for unittests in pycharm 2017

Any chance you've installed a teamcity test runner or debugger of some kind in your pip requirements? The ##teamcity bit is a service message used to report output to a TeamCity build log.
Check this for more info about TC service messages: https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity

Related

RobotFramework RIDE cannot import library

I have a file right here: Library ../../MyLib/My_Lib.py, and I try to import the python file in RIDE, but RIDE still report "FAIL : No keyword with name '****' found", and this keyword is defined in the My_Lib.py, seems RIDE cannot find the python file.
I using python 2.7.8+Robot Framework 3.1.2+windows server 2012r2. I even selected Library -> Name -> Browse in RIDE, but the error still there and this whole robot test case folder is copied from another server which is working fine
Can anyone suggest what have I missed?
Ah! I have worked this out, if anyone else meets the same issue, you can click Tools->view RIDE Log, to see what's happening there. For my case, it's because I didn't install thrift but the My_Lib.py obviously used thrift module, so the My_Lib.py compile failed with "No module named thrift.Thrift".
Is it possible the Python library was created to work with Python 3.x.x leading it to not work on your Python 2.7.8? See https://wiki.python.org/moin/Python2orPython3
Check what python version is being run on the other server where the test is running fine. You might need to update your local Python version.
Also, you could try running the Robot test outside of RIDE just in case. You may do so by navigating to the test folder where the .robot file resides and running the following command:
robot test_file_name.robot
See if you get the same error that way. Please report back after doing the mentioned checks and we can continue debugging, my reputation doesn't let me comment on your question so I will just update the answer as we go along.

How to see logs of running robot script?

The robot scripts when ran on RIDE, generate output.xml, report.html etc files, once run is over.
Is there any way available to view logs when script is still running? (When I use pause on failure)
Also some times I had to Stop/Abort the run in middle, and no logs are generated in such cases.
Kindly help,
Thanks in advance
As for first part — RIDE runs tests adding own listener, providing more verboseness of the output and pausing/resuming functionality.The easiest thing is to run tests not from RIDE, but from console using robot/pybot script. In this case much less logs are written to output (though it doesn't provide pause/resume functionality).
For second part — robot (RIDE starts robot script — you can see it in execution log: command: pybot.bat...) generates output.xml file not after but during execution, so generated output.xml is not valid until test is finished. After normal execution rebot tool generating log.html automatically. So generally it's possible to take following steps:
"Fix" your incomplete output.xml file after execution stop with fixml. output.xml location for RIDE execution can be found in the very same execution log of yours (e.g. ...\appdata\local\temp\RIDEv_0yrp.d\ in my case)
Run rebot stand-alone: rebot output.xml --log log.html --report report.html. Rebot options description you can check using rebot --help (as usual)
Please also note that directory where RIDE output files are stored is temporary — exists only when RIDE is started. You will lose your output on exiting RIDE
I'm using RIDE 1.5 so maybe my answer is not valid for other versions
In RIDE, under Run Tab , when you are running the scripts , you have a option, show message log, it will shows the runtime log.
Try this out.

How to find out what happened when SBT says "javac returned nonzero exit code"?

I'm trying to move our projects to Java 8. When I run a compile I get this:
[error] (MyProject/compile:compileIncremental) javac returned nonzero exit code
This doesn't happen with Java 7. I suspect it's something to do with us using Lombok.
Is there any way to get the actual output from the javac? I've tried "last" and "lastgrep" but I only see SBT logs.
I'm using SBT 0.13.8
Thanks.
Ashley
When javaHome setting is set, sbt calls javac by forking the process, and attempts to screen scrape the error message out of the output, which is error-prone. sbt 1.2.0-RC3 improves it a bit, but it's a hack.
One way to avoid that is to make sure javaHome setting is set to None. Around 2015 sbt-extras used to set javaHome quietly from JAVA_HOME environment variable, but I think that's been dropped since 2016 in https://github.com/paulp/sbt-extras/pull/160. Since this question was asked in June 2015, maybe that's what it was hitting at the time. If you're using sbt-extras, please update to the latest.
This might be further supported by Parag's answer/observation:
The error message disappeared on my Mac when I removed the JAVA_HOME variable in .bash_profile and then restarting Terminal.
If you continue to see this issue using sbt 1.x, please report on https://github.com/sbt/zinc/issues/520
I had SBT 0.13.9, RHEL and OpenJDK1.8 installed and was getting the same error (no further stack trace), and swapping to Oracle's JDK fixed it. Probably some issue with javac-configuration, but didn't manage to quickly fix it with the OpenJDK. Probably not the best solution though.
The error message disappeared on my Mac when I removed the JAVA_HOME variable in .bash_profile and then restarting Terminal.

Building Brackets Shell (After running the grunt build command)

On windows after running the grunt build command for creating brackets shell it gives done without errors but i dont see any .exe file generated..
What might be the problem???
Here are some possible solutions:
Are you following the full brackets-shell build instructions, including all prerequisites?
Make sure Brackets isn't running at the same time. The build will fail silently if the .exe file is currently in use (see bug).
Try with a fresh git clone of the repo. If your brackets-shell local copy has been around for a while, sometimes the build & deps folders can get in a bad state. (I'm assuming you haven't modified the source at all. If you have, try with an unmodified copy of the source first to make sure it builds correctly without any of your changes).
Check that python --version shows 2.7.x
Verbose build output would also be helpful in diagnosing issues like this, but unfortunately there's not yet an easy way to get that...
If you follow the instructions on bracket-shell's wiki page, the Windows executable should be created in the Release directory.

adobe brackets-shell : cef extract failed

I followed all the step is mention in given below url to build my project( I am using win7 OS).
https://github.com/adobe/brackets-shell/wiki/Building-brackets-shell.
actullly i want to create brackets installer (installed wix 3.7).
but i am getting cef-extract failed error.
even though i also used grunt cef-extract --force.
after that its throunging new error.
create -project failed after that i am not able to process further.
can some one help me.
thanks in advanced.
Regards
ashish .
If you include the exact console output you're seeing, it would be much easier to help you. But based on snags other people have encountered recently, you can try these things:
Make sure your PATH includes Python 2.7 (otherwise "create-project" will fail).
Delete all these folders to be sure you're starting from a clean slate: deps, Debug, include, libcef_dll, Release, Resources.
Just run the high-level tasks grunt setup and grunt build, following the Building brackets-shell instructions. (There's a known bug where grunt cef-extract fails when run standalone).

Resources