function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ken KoellnerKen Koellner 

Running test, Classed not showing up in code coverage list, Test @Invalid Date

I'm running a test class that invokes three batchable classes via three test methods.  The test methods include startTest and stopTest methods.  I'm getting 0% on all three modules.

 

In the Dev Console on the Tests tab on the bottom, it lists the test runs and says it ran three tests with server value.  In the outer folder for the test run, the test is listed as "Test @Invalid Date".  Maybe that has something to do with it.  I've tried running the test by going to the page for it and using the Run Test button and also tried running the test from the Dev Console.  I always get the same thing.  And the classes the Test class calls continue to hae 0% coverage and don't show up in the Overall Code Coverage list.

 

 

Any idea?

 

 

LKozakewyczLKozakewycz
I'm having a real issue with testing in the developer console.

The console is giving up on tests, saying "Test @Invalid Date" on every execution, and finally not showing coverage for all classes and triggers.

Testing is becoming a nightmare.

I have submitted a case for this.
Ken KoellnerKen Koellner

I worked with tech support a bit on the issue.

 

We discovered that the @invalidDate happened in Firefox and not Chrome.

 

However it looks like that is a separate and minor issue compared to the zero code coverage thing. 

 

When starting from FF, Chrome, or the web page for the test class it appears that often test coverage for the exercised class shows up as 0% when you know it isn't.  It may be that you really did get the coverage and you'll be okay when you deploy but you can tell

 

I have a case open on this issue also.

 

As far as Dev Console, I'm just not that impressed.  I happen to think heavy-weight features written client-side running in javascript in a browser are bad.  JS just isn't that strong an environemnt.  You also have to make sure it works on six or eight common browsers.

LKozakewyczLKozakewycz
Yes, I had figured out the @InvalidDate problem was a Firefox issue but couldn't find this thread again.

I absolutely agree about the developer console. I've never liked using it. And I've just read that Salesforce are planning to move the entire setup to the developer console too. Which sounds awful.

My issue is, is that I need to see the code coverage to do our unit testing. It is no good that I am being told that we are getting a 58% coverage rate and not show us why. And then when I use Force.com IDE to run my tests, I am being given my more realistic coverage of 80% and above.

The Force.com IDE does not seem to record the code coverage on the Salesforce UI and also tells us what lines are not covered, but doesn't provide the useful red/blue coverage look.

Everyone must be having the same problem, surely?
Ken KoellnerKen Koellner

LSLK wrote:.... And I've just read that Salesforce are planning to move the entire setup to the developer console too. Which sounds awful...

Yuck, indeed it sounds terrible.

 

The best thing aboust SF is both in regular mode and Setup is that almost everything is just a web page with an HTTP get and a URL..

 

Want to replace the current window, click.

 

Want it in a new tab, click and put it in a new tab.

 

Want it in a new window, click and put in a new window.

 

 

LKozakewyczLKozakewycz
That ol' saying hey - "if it ain't broke, don't fix it"