-
Notifications
You must be signed in to change notification settings - Fork 83
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
JSCover.log is blank after running my manual test on instrumented code #126
Comments
Maybe your referring to When you say "coverage is zero", you mean you opened |
Yes. You are right. I opened jscoverage.html and coverage is zero. |
Using file-system instrumentation?
The JSCover proxy? If so there's no need to do the first instrumentation as the proxy will instrument the JavaScript on the fly (if not using SSL). If you are using the proxy, take a look at #116 for some useful links to get this working. |
Hi,Before I wrote this mail I tried running the tests by instrumenting and After your reply, I ran the tests against a fresh instance in proxy mode "Error: NetworkError: A network error occurred.". Could you let me know how this issue can be fixed please? These are the steps I followed:
There was no coverage but saw the above error "Error: NetworkError: A Any help would be of a great help! Thanks On Mon, Apr 7, 2014 at 2:36 AM, tntim96 [email protected] wrote:
Cheers! |
Try starting chrome with the |
I opened the file in firefox instead. The issue with "Error: NetworkError: A network error occurred.". |
I have no way of determining what went wrong from the information you've provided. Have you got the 'examples/localStorage-proxy' sample working? You may need to save coverage results between tests and merge later, as I don't think even localStorage survives the WebDriver client closing. Also, check the jscover.log file for errors. |
Hi, Just a quick thing, if that helps... We see a lot of traffic to our application through JSProxy, but cannot see any data in the JSON file after the test run. Am I missing something here? |
The Check that you can get the samples working, and/or try running just one of your tests. Also, you should be able to test the scenario manually to troubleshoot if your are having trouble finding the issue when automated. |
I'm setting loglevel=FINEST when running the test. Hence JScover.log is not empty. If I leave the logging level to default, it would not show up any data. I tried manual testing option as well, it still shows zero on coverage. |
That's good as it means there were no errors.
So inspecting that doesn't give you a clue as to what's wrong? It should log the URLs it is instrumenting (at INFO level in InstrumenterService). Maybe you can put the results somewhere for me to review.
Again, I don't have enough information to solve this. Can you describe your setup with:
|
Hi, I'll try these options and let you know. Thanks On Fri, Apr 11, 2014 at 5:58 AM, tntim96 [email protected] wrote:
Cheers! |
Hi, Thanks for your help and suggestions! Greatly appreciate your help! After trying all the above options, I tried the sample example for running some of the JUnit tests I have. I've integrated the needed code into my infrastructure. This is the challenge I have: The test runs fine without JSCover. It does all the needed operations with minimal sleep time. However, when I start proxy for coverage and run my JUnit tests against the code, the system just crawls. I crashes in the middle of a test execution as it cannot locate the object. I'm running these tests on firefox. Is there a fix that would help me run the tests without making any changes? Would highly appreciate! Thanks again for helping! Real great work... |
Hi tntim96, Yeah. Manishr works with me. Could you provide a solution for the issue mentioned above please? |
I need a detailed response to this post above. |
Sorry..My Bad. I should have given details about the issue Im running into. My Set-up: Firefox driver, JUnit tests. Used WebDriverGeneralProxyTest.java to setup the infrastructure. The issue I'm running into is that tests really crawl....when I integrate with JSCover. They work perfectly fine without coverage data. Because of this reason, lot of tests are failing as it takes a bit of time for objects to get displayed. Do you know of a solution that would make the execution smoother with coverage ON. Thanks for your help! |
You haven't provided any of the points listed above that could assist in solving this. There could be several things wrong (e.g. you're not trying JSCover with SSL are you?).
|
the host and port of the web-server I've solved all the issue with test execution. I have no issues there. I have only one issue right now, which is that it really runs pretty slow. I'm using the proxy mode to execute my tests. No. I'm not running SSL with my tests. |
So you get non-zero coverage now? |
Yes. I'm getting non-zero coverage.
|
OK, so if there are no errors in jscover.log, and your unit tests all pass (when there aren't time-out errors)...
Make sure you use web-driver wait for condition rather than just thread sleeps. JSCover will slow down things for a couple of reasons:
You can set logging to finest to see where the time is being spent for a minimal test-case. If you post jscover.log somewhere I could take a look. |
Hi, I've set the logging level to FINEST and attached is the log for your Could you let me know what change I can do to get the issue fixed? On Thu, Apr 17, 2014 at 4:05 AM, tntim96 [email protected] wrote:
Cheers! |
I can't see any attachment. You need to upload the file somewhere and provide a link to it.
I'll try with the logs (when provided), but the more you can isolate the issue and enable me to reproduce the issue, the more likely I'll be able to assist you in resolving it. |
Hi, Here is the link for the log. As I told before, test fails in the middle of the execution. However, it runs fine without coverage code. http://www31.zippyshare.com/v/69304586/file.html Thanks |
There's a bit too much logging. Can you cut it down with the following settings:
...also there is an error...
...while I'd like to solve this, you probably want to exclude this from instrumentation with something like Will add further comments if I see anything else. |
Also found |
Also found |
Also, |
How would I add proxy by-pass list programmatically: something like the server URL... |
I tried all the options including... no-instrument as well as log level as severe, I see no luck! :-(. Test execution crashes in the middle of a test run. |
Something like: Proxy proxy = new Proxy().setHttpProxy("localhost:3129");
proxy.setNoProxy("intuit.sp1.convertro.com,ocsp.verisign.com");
Those changes are beneficial, but don't necessarily solve all your issues. Changing the log level was to remove some of the extraneous logging - can you re-post the results?
Can you isolate that issue and perhaps make it available to me so that I can reproduce the issue? This would certainly speed up this process. |
Hi, Here are the latest logs: http://www8.zippyshare.com/v/48218943/file.html |
I can still see you're instrumenting things you shouldn't be. For example:
|
I've included the unneeded folders under "--no-instrument" parameter as part of args. It still shows up in the log. Not sure if it is actually instrumenting or not. |
It shouldn't show up in the log, so it could be a problem with JSCover in proxy-mode. I'll look into it. |
Had a quick look -
...this shows that the pattern was matched and that instrumentation is to be skipped. |
I checked all the logs to figure out the pattern match. All the unneeded code is NOT getting instrumented. |
Maybe you have to show me the latest logs as well as the program arguments. The log I'm looking at has
Can the issue be isolated so that I can reproduce it? |
Here is the latest latest log... http://www60.zippyshare.com/v/47960927/file.html where private final String[] args = new String[]{
|
OK, that looks a lot better. You can probably replace There also still seems to be some library code there (e.g. Mojo) and test code (e.g. abTest.js). Maybe try the approach described below: Testing Suggestion To Eliminate JavaScript Instrumentation as a Cause Of Your Failing Test |
I'll try your suggestions and get back to you.... |
Any update? BTW, there's a minor fix checked-in for a proxy content -length issue. To try it you can either build yourself, download a snap-shot I've built, or grab the latest maven snap-shot from here - NB this has to be combined with the Rhino JAR here. |
I'll try the fix and let you know.... |
Closing due to inactivity, but feel free to re-open if you have more information. |
I instrumented the code,started running web server in proxy mode, started JSCOver as well and then started running few manual tests on the instrumented code. I see all the file structure getting created in the target folder. However, coverage is zero.
Could you let me know if I'm missing something here?
The text was updated successfully, but these errors were encountered: