Failing Unit Tests with most recent NOP version

Posted: May 14, 2018 at 8:07 PM Quote #204300
I just downloaded the source code and built the app in VS.

I am planning on extending NOP so I ran the unit tests while I was setting up my CI/CD pipeline.

I am getting 20 failed tests.  

Anyone else seeing this?

I have not dug into it fully - but a few of them are null reference exceptions from the moqs not being set-up or set-up correctly?
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 16, 2018 at 3:42 AM Quote #204358
How do you run the test ?
I saw this post https://www.nopcommerce.com/boards/t/24005/run-all-tests.aspx
In VS Menu
Test -> Run -> All Tests

Its the same for me builds and get

[16/05/2018 5:41:19 PM Informational] ------ Load Playlist started ------
[16/05/2018 5:41:19 PM Informational] ========== Load Playlist finished (0:00:00.1055253) ==========
[16/05/2018 5:44:10 PM Informational] ------ Run test started ------
[16/05/2018 5:44:16 PM Warning] No test is available in M:\Production\nopCommerce_4.00_Source\Tests\Nop.Core.Tests\bin\Debug\net461\Nop.Core.Tests.dll M:\Production\nopCommerce_4.00_Source\Tests\Nop.Data.Tests\bin\Debug\net461\Nop.Data.Tests.dll M:\Production\nopCommerce_4.00_Source\Tests\Nop.Services.Tests\bin\Debug\net461\Nop.Services.Tests.dll M:\Production\nopCommerce_4.00_Source\Tests\Nop.Tests\bin\Debug\net461\Nop.Tests.dll M:\Production\nopCommerce_4.00_Source\Tests\Nop.Web.MVC.Tests\bin\Debug\net461\Nop.Web.MVC.Tests.dll.
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.SelectSystems.com.au
Select Systems is a computer systems technology solution developer and integration service provider.
Posted: May 16, 2018 at 8:15 AM Quote #204380
NOP uses nunit.  It looks like you do not have the nunit adapter installed.  That's why the tests are not picking up.

I use resharper and used it to run the tests.  I get 20 of 500+ tests failing.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 16, 2018 at 8:36 AM Quote #204383
I guess it is expected, over 90% passed are very good. I think we could make those 10% works contributing code changes for those unit tests. but for now, i guess for you you could just by pass those failed unit tests or add attribute to skip those unit tests to complete CI.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Justin in Austin
Posted: May 16, 2018 at 9:07 AM Quote #204386
Not sure I share the same sentiment.  90% code coverage is ok - not great.  I have our coverage filter set to 95.  If one of my developers cannot get it there, we have a talk.  Maybe we refactor so we can get more testable code.

Failing tests are not ok.  It implies something changed and possibly broke the app.

Not to mention a failing test will stop the CI build.

Ignoring tests is a bad precedent.  If they are no longer relevant then it should be removed.  

I was curious if anyone else saw this.  I may just fix them and get it submitted.  Good way to become more familiar with the app.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 16, 2018 at 10:58 AM Quote #204398
johndbennett, I agree with you totally on test cases cannot be ignored. However, this is an open source project and it needs many of us in the community help building and testing test cases. I was not saying the coverage is 90% and considering this is a open source project and I don't know how many percentage covered. If you look at in github, not many open source projects have unit tests... I am just saying if you are developer and if you see the test failed, then perhaps we as developers should consider fixing it.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Justin in Austin
Posted: May 16, 2018 at 6:33 PM Quote #204414
Ok I installed Nunit adapter and tests are working
560 Tests in total
One issue was settings to use x86 rather than x64
Then I only had failure on 2 tests

Failed on Can_publish_event() and Can_get_shipping_total_discount_excluding_tax()

Im only new to this but from what I can see one is a null value - seems to be the test setup not correct
The other still to work it out
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
www.SelectSystems.com.au
Select Systems is a computer systems technology solution developer and integration service provider.
Posted: May 16, 2018 at 9:33 PM Quote #204416
Weird.  You get only two failures.

I am going to dig into it when I get a chance.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2018
Learn more