Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1354599 - RFE activate the tests during the package build
Summary: RFE activate the tests during the package build
Alias: None
Product: Fedora
Classification: Fedora
Component: newtonsoft-json
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Timotheus Pokorra
QA Contact: Fedora Extras Quality Assurance
Depends On: 1366713
TreeView+ depends on / blocked
Reported: 2016-07-11 16:28 UTC by Timotheus Pokorra
Modified: 2016-09-03 07:51 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-09-02 20:52:27 UTC

Attachments (Terms of Use)
adding reference to NUnit (deleted)
2016-07-11 16:28 UTC, Timotheus Pokorra
no flags Details | Diff
log of the failing unit tests (deleted)
2016-09-02 06:47 UTC, Timotheus Pokorra
no flags Details

Description Timotheus Pokorra 2016-07-11 16:28:59 UTC
Created attachment 1178482 [details]
adding reference to NUnit

first to say: I don't know if it is necessary to build the tests.

Related to comment in spec file: FIXME tests need xunit (not packaged yet)

I just tried that it works with nunit (see attached patch), and xunit is not really needed as far as I can see.

There are still other errors though...

DemoTests.cs(28,14): error CS0234: The type or namespace name `Buffers' does not exist in the namespace `System'. Are you missing an assembly reference?
Utilities/DateTimeUtilsTests.cs(56,24): error CS0122: `Newtonsoft.Json.Utilities.StringReference' is inaccessible due to its protection level

Comment 1 Raphael Groner 2016-08-30 22:53:44 UTC
Do we need nunit (currently version 3.4) or the nunit2 compatibility package?

Comment 2 Timotheus Pokorra 2016-09-01 21:35:19 UTC
I found one solution, to build not the Newtonsoft.Json.Tests.csproj but Newtonsoft.Json.Tests.Net40.csproj instead. This resolves already a number of issues.

But then there is still that error "is inaccessible due to its protection level".
I can replace all internal with public, but that is quite strange. 
I wonder if that ever can compile on .Net 4.x. By definition, if a struct or class is internal, it can only be accessed within the assembly ( I will ask upstream.

Comment 4 Timotheus Pokorra 2016-09-02 06:45:50 UTC
ok, the NewtonSoft.Json.Tests.dll now compiles, and I get the result of the tests:

Tests run: 2314, Errors: 10, Failures: 7, Inconclusive: 0, Time: 12.1892758 seconds
  Not run: 1, Invalid: 0, Ignored: 1, Skipped: 0

I therefore have not enabled the tests yet, but committed the fixes for the tests dll to build.

Comment 5 Timotheus Pokorra 2016-09-02 06:47:03 UTC
Created attachment 1197053 [details]
log of the failing unit tests

Comment 6 Timotheus Pokorra 2016-09-02 20:52:27 UTC
Thanks Raphael for the link on IRC to

I have now disabled the 17 tests that failed or had an error.

I also switched from NUnit2 to NUnit3.

Comment 7 Timotheus Pokorra 2016-09-02 21:08:51 UTC
actually, when I run the tests with nunit3-console, I get:

1) Invalid : /root/rpmbuild/BUILD/Newtonsoft.Json-9.0.1/Src/Newtonsoft.Json.Tests/bin/Release/Net40/Newtonsoft.Json.Tests.dll
No suitable tests found in '/root/rpmbuild/BUILD/Newtonsoft.Json-9.0.1/Src/Newtonsoft.Json.Tests/bin/Release/Net40/Newtonsoft.Json.Tests.dll'.
Either assembly contains no tests or proper test driver has not been found.

I need to look at this another day. I wonder if this is a packaging bug in the nunit package.

Comment 8 Raphael Groner 2016-09-03 07:51:42 UTC
Maybe some API thingy. IMHO, we should keep going with nunit2 for now.

Note You need to log in before you can comment on or make changes to this bug.