Clover can't interact with IDEA

Roman Topka April 8, 2016

HI! Can your explain me why Clover doesn't interact with IDEA? I send you my video, sorry for some slow moments - it is due to VMware - http://screencast.com/t/PgF1qmwAFvU2 

There is a wrong java example but I think that project should be rebuild with Clover anyway!

Thank you in advance.

1 answer

1 vote
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2016

Hi Roman, thanks for attaching the video. I'd like to clarify few issues:

  1. I see that you set the "rebuild immediately" policy and ran compilation. Can you confirm that the Clover database has been created (there should be .clover/coverage.db file present)?
  2. Could you open the "Cloverage" view and check if if shows classes from your project?
  3. What and how did you execute? I don't see it on the video... You have the MyManualTest file opened in the editor but the error is about com.company.Main from another package - did you run the MyManualTest as JUnit test or did you run the Main class as application? Did you use "Run as ..." or "Debug as..." option (these are correct) or the "Run with coverage ..." one (this is not correct)?
  4. I noticed that the "Enable Clover" toggle turned off after opening the settings dialog - am I right? Did you click on any toolbar button or use a shortcut key? What happens if you enable it again, close the dialog and open the dialog again (without rebuilding a project) - does it disable again?

 

Roman Topka April 8, 2016

Thank you Marek for your quick answer.

1-2. I just wanted to reproduce step-by-step process written here - https://confluence.atlassian.com/display/CLOVER/Clover-for-IDEA+User%27s+Guide and it forwarded me here - https://confluence.atlassian.com/display/CLOVER/1.+Clover+for+IDEA+in+10+minutes

so there was any whole word about installing that features that you said before my steps. So could you please forward me to correct step-by-step guide or show me in details which actions must be done primarily.

3. Sorry, I should be cover more space for video. I clicked on main green triangle with "Run" meanung.

4. Yes, Enable option turned off next opening. No, I didn't press any key. I'll try to steps as you said.

Have a good day!

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2016

ad 1&2. I wrote these steps in order to troubleshoot it. Normally, there's no need to check for presence for the Clover database.

ad 4. This option should not turn off itself. It may be a bug. 

Could you please tell what IDEA and Clover version do yo use?

Could you check if IDEA logs have any errors related with Clover?

Could you try to download the Clover-for-Ant ZIP file (https://www.atlassian.com/software/clover/download/) and unpack it? You will find a tutorial project there, which you can open in IDEA. Could you do it, enable Clover, build it and run tests and check if you see coverage?

 

PS: feel free to raise a ticket at support.atlassian.com, if necessary.

Roman Topka April 11, 2016

1-2. So, where I can obtain info about installing clover db? Or it isn't necessary? 

4. a) The IDEA version is 14.0.2, the Clover version is the latest - 4.1.1. b) I don't know exactly where I can check these logs. c) I've downloaded the tutorial, thank you, but I can't install and open it in proper way - http://i.shotnes.com/a/11/c5qjoucn.03l_570b94e5dce47.png - sorry, but I know Java not so good, and my main goal here is to know how Clover can work in manual testing as it written in guide. Nevertheless, I want to help you catch the bag at "Enable Clover" - http://screencast.com/t/HrKkySjtKBlw - maybe it depends of missing clover db?

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2016

ad 1&2. You don't have to install any Clover database - this file will be automatically created by Clover during compilation. 

ad 4a. Your IDEA and Clover versions are fine - they are compatible. 

ad 4b. First, you can click on the "Event log" button (you shall find it in the status bar). Second, you can locate log files as described in this article: https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files 

ad 4c. I see that you just modified original sources from the tutorial - please revert these changes. I see that you have at least one typo in the first line: "ppackage" instead of "package". 

 

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2016

Regarding the bug with "Enable Clover" - I suspect that there's a problem with writing configuration to the disk by IntelliJ IDEA - please check if IntelliJ IDEA has write permissions to the configuration directory. See this article: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs

Roman Topka April 11, 2016

Here is the event log with correct sources and without second letter "p" in "package" - http://i.shotnes.com/a/11/w33vijbd.m0c_570ba025e30fb.png

Regarding the write permissions. IDEA is inside the VMware, but the directory seems to be correct -  http://i.shotnes.com/a/11/j1wvv52r.o12_570b9f0eefec5.png

 

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 11, 2016

"Here is the event log with correct sources" - nope; you still don't have original sources; the MoneyBag class is located in Main.java, which is not correct; please use the original code from tutorial to ensure that you won't be bothered by irrelevant errors

"but the directory seems to be correct" - please check folder permissions

Roman Topka April 11, 2016
  • Sincerely, I don't know how to open the tutorial sample in proper way. Previously I've created two java classes (Main and Test) and just copied content from MoneyBug in sample into Main in IDEA and from MoneyBugTest in sample into Test in IDEA. Could you help me to re-open tutorial sample in proper way?
  • Thank you, I've checked the folder permission and, actually, it was only for reading. Now the "Enable Clover" is always "on".
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 12, 2016

"Sincerely, I don't know how to open the tutorial sample in proper way. "

Please delete your current project and unpack the Clover-for-Ant ZIP and open it again. Please do not modify any sources until you will have a successful build and you will see code coverage in IDEA.


"sorry, but I know Java not so good, and my main goal here is to know how Clover can work in manual testing as it written in guide"

I suggest to read/watch some Java tutorial, there are many good ones on the internet, for instance:

https://www.youtube.com/watch?v=Cfd9DOnuF9w

https://www.udemy.com/java-tutorial/

Roman Topka April 15, 2016

Finally we managed to install tutorial project properly - it became possible due to installing maven before, and fortunally, the Run button appeared.

Thank you Marek for links, but it takes some time for learning java, meanwhile I'd like to understand how to provide manual tests with Clover as soon as I can. As is written in the guide - "...all manual test cases were wrapped into JUnit tests...", and could you explain what kind of manual tests are mentioned in guide? Are they some kind of auto-tests, or naturally, manual tests? Could you place any link on such manual test?

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 15, 2016

First, could you please clarify why do you want to use Clover for manual tests? What would you like to achieve? For instance:

 * knowledge what application areas were covered by manual tests

 * knowledge what application areas were covered by each manual tests (separately)

 * knowledge which manual tests have to be repeated in a new version of an application (due to code changes)

 

Second, please read the https://confluence.atlassian.com/display/CLOVER/Measuring+per-test+coverage+for+manual+tests manual. It describes in details how to wrap manual tests into the JUnit test framework.

Roman Topka April 17, 2016

Yes, I'd like to clarify my request. We prepare some educational materials for testers and we put there some info concerning tools of code coverage. These materials should be used both as for automated as for manual testers and we'd like to know more about using of manual tests in Clover. The manual testing in this case is implied as exploratory testing or testing by strict following of check-lists. I've red this manual before my first question in the head, thank you, but there is some info about auto-tests. So, can I ask you to answer my questions written above or should I clarify something more? Regarding your question, the right answer is first one for us - "knowledge what application areas were covered by manual tests".

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 18, 2016

"knowledge what application areas were covered by manual tests"

In such case you don't have to setup per-test coverage feature at all. What is you need is global coverage for your manual/automatic tests. 

You can just ignore the Measuring+per-test+coverage+for+manual+tests manual. Instead of this:

  1. Build you application with Clover. You can use any of existing Clover integrations for this purpose - Ant/Maven/Gradle/...,depending on what build system is used for your application.
  2. Run application. Just ensure that:
    1. clover.jar is present on the classpath
    2. clover.db is accessible (there's no need to worry about it if you compile and run on the same machine)
  3. Perform tests (manual or automatic). Clover will record coverage data at this time.
  4. Generate Clover report.
Roman Topka April 19, 2016

Thank you for updating info, but I suspect that I should clarify more, especcially concerning point 3 "Perform tests.." So, we'd like to know how to use some tools for code coverade of manual tests. These tools should write code coverage in a runtime mode (like Bullseye for C++ as my colleague tells me). We install some tool, make some manual tests in a runtime mode and tool write code coverage and finally genarate a report. Is Clover fit for this task?

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 20, 2016

"Is Clover fit for this task?"

Not exactly. Clover requires to recompile the application from the source code. You cannot use a binary which was already compiled and modify it at runtime (like Cobertura or JaCoCo do). 

Roman Topka April 20, 2016

Thank you Marek for explaining. Then I'll try to investigate these mentioned tools to apply them for my task.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events