This is a migrated thread and some comments may be shown as answers.

JustMock + dotCover + TeamCity problem

19 Answers 202 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 29 Mar 2013, 05:15 PM
Hello, 

I'm trying to make a setup on my TeamCity server with JustMock and dotCover. Unsuccessful, unfortunately.

When all three elements work together I'm getting "Profiler must be enabled" exception during tests phase (tests with static mocking).
I followed all recommendations from Telerik.
When I use TeamCity with JustMock  without  dotCover - tests are passing without a problem.
I'm also able to run tests without TeamCity (in Visual Studio or executing msbuild from console) using JustMock and dotCover together (on the same machine). No problem here.

But when I use all three together - "Profiler must be enabled" exception got raised.

I'm trying to use MSTest Build Step with
.NET Coverage enabled.

Do you have any recommendation on how to run it? May be someone had implemented this kind of configuration?

Thanks,

Alex




19 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 02 Apr 2013, 12:16 PM
Hello Alexander,

Thank you for contacting Telerik support.

The reason for experiencing this behavior in JustMock, most probably is that, the profiler is not loading during the test execution. The MS Test build step (provided with TeamCity) does not have the option to be called through the JustMockRunner, as you will do if executing your test DLLs manually, via the cmd (shown here).

However, there is a workaround for this. You will have to set the JustMock environment variables manually for your build. (Note: This approach could decrease your build performance.) To achieve this, simply follow the next steps:
  1. Go to your Build Parameters.
  2. Add the following new parameters of kind: Environment variable:
    • Name: JUSTMOCK_INSTANCE, Value: 1
    • Name: COR_PROFILER, Value: {B7ABE522-A68F-44F2-925B-81E7488E9EC0}
    • Name: COR_ENABLE_PROFILING, Value: 1
  3. Save and run your build.

I hope this helps. Please, contact us again if you need further assistance.

All the best,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Alexander
Top achievements
Rank 1
answered on 02 Apr 2013, 01:56 PM
Hello,

Thank you for an answer, but unfortunately it did not help. I attached setup options screenshots.

I added these env vars, restarted server (just in case).

Nothing changed, I still get "profiler must be enabled" exception for the same test.
(I've changed testing framework to NUnit recently, but the error is not related to testing framework is is the same for MSTest and NUnit).

All tests passes if I remove dotCover coverage option.
Is there anything else I have to do? 

Alex

0
Kaloyan
Telerik team
answered on 02 Apr 2013, 02:49 PM
Hello again Alexander,

Just to be sure we are on the same page, please confirm that you have synced both profilers as shown here.

In addition, I will give you the steps, I followed to achieve this:
  1. I linked both profilers, like described here;
  2. I configured MS Test build step with dotCover;
  3. I entered the environment variables inside my builds "Build Parameters";

As a result, my simple test, passed in TeamCity:

[TestMethod]
public void SimpleTestMethod()
{
     Asssert.IsTrue(Mock.IsProfilerEnabled);
}


Greetings,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Alexander
Top achievements
Rank 1
answered on 02 Apr 2013, 03:24 PM
Hello again,

Just double checked everything,

1. Yes, I linked docCover profiler. (BTW, Is where any way to link bundled with TeamCity dotCover profiler? I had to install trial version of dotCover because bundled one is missing from JustMock Link Profiler combobox).
2. Now I'm working with NUnit test step (I've changed test framework). But I had same problem initially with MSTest. If this can be the case I can try simple project with MSTest.
3. As you can see in screenshot - these variables had been set up.

I added the same simple test to testsuite and it failed too.

If I understood you correctly, you have a setup with TeamCity, dotCover and JustMock and this setup is working. This at least means this kind of collaboration possible. Good. It might be environment problem then,

I have TeamCity 7.1.3
JustMock Q1 2013
dotCover (2.0, 2.2)
.NET 4.5
Windows Server 2008 R2 x64

If you have other recommendations - please, let me know,
If this kind of settings should work I will make a brand new environment installation to check it from scratch.

Thank You for Your time,

Alex

0
Alexander
Top achievements
Rank 1
answered on 02 Apr 2013, 05:53 PM
I just checked on another server. Same config.

1. Installed TeamCity 7.1.3
2. Installed JustMock
3. Installed dotCover 2.2
4. Linked dotCover profiler with JustMock 
5. Created a simple NUnit test project with just 1 test (Assert.IsTrue(Mock.IsProfilerEnabled()))
6. Created TeamCity project with 1 Build Step (NUnit + dotCover)
7. Added Environment parameters to TeamCity project.

And I'm still getting the same error: Profiler must be enabled.

If I disable dotCover option - test passes.

So, what am I doing wrong or forgot to do?

Thanks,
Alex
0
Kaloyan
Telerik team
answered on 05 Apr 2013, 10:47 AM
Hello Alexander,

We plan to release JustMock Q1 2013 SP2 next week. We made some changes in the way JustMock configures with the shipped with TeamCity, dotCover.

Until the official version is out, there is one more thing you could try. Having your steps completed (1 to 7), just apply the ones in red(8 and 9):

1. Installed TeamCity 7.1.3
2. Installed JustMock
3. Installed dotCover 2.2
4. Linked dotCover profiler with JustMock 
5. Created a simple NUnit test project with just 1 test (Assert.IsTrue(Mock.IsProfilerEnabled()))
6. Created TeamCity project with 1 Build Step (NUnit + dotCover)
7. Added Environment parameters to TeamCity project.
8. Remove the COR_ENABLE_PROFILING and the COR_PROFILER environment variables from your build project. Leave only JUSTMOCK_INSTANCE with value 1.
9. Open the JustMock Configuration. Choose <none> from the list and click Link Profiler. Then link it with dotCover once again.

Please, notify us if this had solved the issue.

Kind regards,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Alexander
Top achievements
Rank 1
answered on 05 Apr 2013, 01:00 PM
Hello Kaloyan,

Great news about SP2, thank you.

Unfortunately your last suggestion (8, 9) did not work. I've tried on both my servers with the same results. Test failed with the same error. 
Also I checked with bundled dotCover (2.0) and trial 2.2. No difference.

Does it work in your environment?

Thank you,
Alex
0
Kaloyan
Telerik team
answered on 05 Apr 2013, 01:08 PM
Hello again Alexander,

It works on my end.

Can you confirm that, dotCover is working as expected in your build project. Even, after the failing JustMock tests? I am asking this, because if you are experiencing an issue with the TeamCity/dotCover integration, it could also prevent the JustMock profiler from loading correctly.

Kind regards,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Alexander
Top achievements
Rank 1
answered on 05 Apr 2013, 01:12 PM
Yes, dotCover shows results with coverage after build. 

Alex
0
Kaloyan
Telerik team
answered on 10 Apr 2013, 07:29 AM
Hi Alexander,

Can I suggest you to wait for JustMock Q1 2013 SP2 to be released and try to reintegrate it in your TeamCity + dotCover build project? Note, it should be official in the very near future (by the end of this week or a bit later).

However, if the issue persists we will be glad to hear from you and assist you further.

Thank you for the understanding.

All the best,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Alexander
Top achievements
Rank 1
answered on 10 Apr 2013, 07:33 AM
Hello Kaloyan,

Thank you for update, I'll wait for SP2 and try again. I'll tell you how it goes.

Thanks again,
Alex
0
Alexander
Top achievements
Rank 1
answered on 24 Apr 2013, 01:06 PM
Hello,

Do you have any news about Q1 2013 SP2 release date?

Alex
0
Kaloyan
Telerik team
answered on 25 Apr 2013, 08:38 AM
Hello Alexander,

We apologize for the delay of the Service Pack. However, there were some critical issues that had to be fixed.

Currently, we have planned the release of JustMock Q1 2013 SP2 for next week.

Thank you for the patience and the understanding.

Greetings,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Mohd
Top achievements
Rank 1
answered on 01 May 2013, 09:24 AM
I reported couple of issues related to Generic andTask. How do we know that in the next release these are taken care.
Since we have already place order for the product and worried whether those will be addressed or not. Those issues are must fix for us.
0
Kaloyan
Telerik team
answered on 02 May 2013, 02:59 PM
Hello Mohd,

We will do our best in order to provide fixes for your issues in the upcoming service pack of JustMock. However, if for some reason this does not happen, we will further contact you with possible solutions.

I hope this information helps.

Greetings,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Mohd
Top achievements
Rank 1
answered on 06 May 2013, 03:40 AM
Hello Kaloyan,
Is there any update on the  Q1 2013 SP2 release?
As you wrote, it was expected in the previous week.





0
Kaloyan
Telerik team
answered on 07 May 2013, 03:28 PM
Hello,

The JustMock Q1 2013 SP2 is planned for tomorrow.

@Mohd:
I have replied in ticket with ID: 678500 about the issues you are experiencing. Please, let us know if the proposed solution is convenient for you.

Greetings,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Alexander
Top achievements
Rank 1
answered on 10 May 2013, 07:33 AM
Hello,

Thank you for update,

Are there any guidelines for integrating TeamCity + dotCover with JustMock after 2013 SP2? Which configuration should work?

Alex
0
Kaloyan
Telerik team
answered on 10 May 2013, 07:50 AM
Hi Alexander,

Yes, there are guidelines for configuring JustMock with TeamCity. You could find them here.

I hope this helps.

Regards,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
Tags
General Discussions
Asked by
Alexander
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Alexander
Top achievements
Rank 1
Mohd
Top achievements
Rank 1
Share this question
or