Unit Test Runner question

Hello,

How does Resharper choose the assembly to scan for the unit tests? It seems that the currenly opened document affects its behavior in some way. It would rather expect Resharper to use active project instead.

Regards,
Maxim

21 comments
Comment actions Permalink

Hello Maxim,

ho do you run unit tests? Actually there are many ways to do this. You can

- run them directly from the editor using the icons on the left gutter or
the context menu. In this
case ReSharper runs only the specified test case or test fixture.

- run them from the solution explorer. In this case ReSharper shoud run tests
from the active project.

Could you please describe the situation in more detail?


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello,

How does Resharper choose the assembly to scan for the unit tests? It
seems that the currenly opened document affects its behavior in some
way. It would rather expect Resharper to use active project instead.

Regards,
Maxim



0
Comment actions Permalink

Hello Dmitry,

I'm trying to use Unit Test Runner window.
1) I open the solution. The active project is set to 'Tests'.
2) I see most of icons disabled in that window. Why? I understand that you need to parse the assembly to figure out what tests exist, but how can I trigger such parsing?
3) I invoke Resharper|Run Unit Tests command. The window is now populated, but with wrong assembly (not the active one).

Also, I have just got exception 13404...

Regards,
Maxim

0
Comment actions Permalink

If you run some test T in the project P, then

1) UnitTestRunner takes the output path using active configuration for the
project P
2) If the option to run tests from specific folder is set, then
UnitTestRunner combines that directory with the assembly file name from "1)"
3) Otherwise, it takes path from "1)" directly


--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:640385.1133094833693.JavaMail.javamailuser@localhost...

Hello,

>

How does Resharper choose the assembly to scan for the unit tests? It
seems that the currenly opened document affects its behavior in some way.
It would rather expect Resharper to use active project instead.

>

Regards,
Maxim



0
Comment actions Permalink

Hello Eugene,

So what should happen when I start unit tests via Resharper|Run unit tests command? For me, it scans the wrong assembly (not the one which is produced by the active project in the solution). Hence, it shows no tests.

Regards,
Maxim

0
Comment actions Permalink

It should scan assembly, mentioned as an output assembly in active
configuration.
If you think that UnitTestRunner scans some another assembly, please let me
know - I'll include some logging in 211 build, and then I'll ask you to send
these logs back to me

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:21962936.1133176934032.JavaMail.javamailuser@localhost...

Hello Eugene,

>

So what should happen when I start unit tests via Resharper|Run unit tests
command? For me, it scans the wrong assembly (not the one which is
produced by the active project in the solution). Hence, it shows no tests.

>

Regards,
Maxim

>



0
Comment actions Permalink

The assembly which is scanned by TR depends on the currently open file. I don't think it should be so.

If you add logging I will surely send the logs back to you.

Regards,
Maxim

0
Comment actions Permalink

The assembly which is scanned by TR depends on the currently open
file. I don't think it should be so.


What assembly it should scan in your opinion?

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

The assembly which is scanned by TR depends on the currently open
file. I don't think it should be so.

If you add logging I will surely send the logs back to you.

Regards,
Maxim



0
Comment actions Permalink

What assembly it should scan in your opinion?

The assembly which is produced by the active project. Or even all assemblies which are produced by the solution.

Let me explain why I find the current behavior inconvinient. When I see failed tests I usually fix bugs in core assemblies and rerun tests via menu command. But these core assemblies do not contain tests! So I need to open some file from the project containing tests and invoke the command afterwards.

0
Comment actions Permalink

Huh! I see.
Please find the button "Build project" in the UnitTestRunner local toolbar -
it will re-make all dependent project of the loaded tests.

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:1858171.1133288205775.JavaMail.javamailuser@localhost...
>> What assembly it should scan in your opinion?

The assembly which is produced by the active project. Or even all
assemblies which are produced by the solution.

>

Let me explain why I find the current behavior inconvinient. When I see
failed tests I usually fix bugs in core assemblies and rerun tests via
menu command. But these core assemblies do not contain tests! So I need to
open some file from the project containing tests and invoke the command
afterwards.



0
Comment actions Permalink

Could you please explain why this button is initially disabled when I load the solution?

0
Comment actions Permalink

Please post small screenshot

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:1587053.1133345768316.JavaMail.javamailuser@localhost...

Could you please explain why this button is initially disabled when I load
the solution?



0
Comment actions Permalink

Attached is what I see just right after opening the solution.



Attachment(s):
bug.JPG
0
Comment actions Permalink

No attachement
"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:1984995.1133348852673.JavaMail.javamailuser@localhost...

Attached is what I see just right after opening the solution.



0
Comment actions Permalink

I see it via web-interface.

0
Comment actions Permalink

Hello Maxim,

this is a manifestation of the well-known problem with loosing synchronization
between
Web forums and newsgroups - some attachments are only visible via forums.


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I see it via web-interface.



0
Comment actions Permalink

As I see in your picture, the test tree is not yet loaded.
So the "build" button is disabled, 'cos it doesn't know what to build

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Maxim Babenko" <mab@shade.msu.ru> wrote in message
news:17441307.1133360390879.JavaMail.javamailuser@localhost...

Here is the direct link:
http://adde.math.msu.su/max/Temp/bug.jpg



0
Comment actions Permalink

Anyway you can right-click on a project to test (in Solution Explorer) and
invoke Run Unit Tests..

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

As I see in your picture, the test tree is not yet loaded. So the
"build" button is disabled, 'cos it doesn't know what to build



0
Comment actions Permalink

Hello Valentin,

Could you please elaborate on the suggested way of using TR? It seems my
problem comes from different usage model. I have created a separate project
(and also a solution) solely for the testing purposes. This project contains
testcases and references other (core) assemblies which are being tested.
This test project is marked as active. That is why I expect TR to use it
each time I invoke TR.

How do you use TR in your daily work? From what I have already heared I believe
that you do not use such distinguisted solutions.

Regards,
Maxim



0
Comment actions Permalink

Hello Maxim,

there was perhaps a misunderstanding on our site concerning the terminology.
When you tell about the active
project, you likely mean the active in the sense of VS, that is, the project
you'll debug when the VS enters the
debug mode. ReSharper doesn't currently respect this notion - instead, it
only tracks the selected project
in the Solution Explorer. These two notions don't necessarily coincide.

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello Valentin,

Could you please elaborate on the suggested way of using TR? It seems
my problem comes from different usage model. I have created a separate
project (and also a solution) solely for the testing purposes. This
project contains testcases and references other (core) assemblies
which are being tested. This test project is marked as active. That is
why I expect TR to use it each time I invoke TR.

How do you use TR in your daily work? From what I have already heared
I believe that you do not use such distinguisted solutions.

Regards,
Maxim



0
Comment actions Permalink

Hello Maxim,

Yes, you are right we have a different solution structure and unit test runner
usage model.

Our solution currently contains 61 project, most of projects contains some
unit tests that test functionality implemented by this project. We also have
a couple of projects which contains only tests. The reason why we have such
projects is avoiding cyclic dependencies. Almost all our tests use our test
framework which is located in a separate project. This project references
many notions of higher level than that of tested projects. That's why we
put tests for these low-level projects into separate projects.

Another difference with your usage model (if I understood you right) is that
we often run only particular test/test-fixture because running all tests
even in one project usually takes a few minutes. We often invoke testing
from the source code of a test fixture class. Then when we finished our changes
we invoke testing of all tests in the assembly.

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello Valentin,

Could you please elaborate on the suggested way of using TR? It seems
my problem comes from different usage model. I have created a separate
project (and also a solution) solely for the testing purposes. This
project contains testcases and references other (core) assemblies
which are being tested. This test project is marked as active. That is
why I expect TR to use it each time I invoke TR.

How do you use TR in your daily work? From what I have already heared
I believe that you do not use such distinguisted solutions.

Regards,
Maxim



0

Please sign in to leave a comment.