Coder Social home page Coder Social logo

Comments (10)

CharliePoole avatar CharliePoole commented on July 1, 2024 1

I edited your description so your XML displays.

from nunit-v2-framework-driver.

Almewty avatar Almewty commented on July 1, 2024 1

I ran into the same problems and decided to look at the code.
I fixed it in my fork here but I am not too sure if it does what it should do because I'm not that familiar with all the States of NUnit.
Feedback would be appreciated!

from nunit-v2-framework-driver.

CharliePoole avatar CharliePoole commented on July 1, 2024

Looking at the filename in your last example, I gather these are xamarin tests. If that's the case, the NUnit engine (and hence the console runner) would not know how to run them. Can you clarify how you are running the tests?

from nunit-v2-framework-driver.

owenniblock avatar owenniblock commented on July 1, 2024

These are just standard tests (I'm working at Xamarin hence the namespace). For example:

        [Test]
        public void SimpleSuccessTest()
        {
            Console.WriteLine("SimpleSuccessTest BEFORE WAIT:: " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));

            Thread.Sleep(10000);

            Console.WriteLine("SimpleSuccessTest AFTER WAIT:: " + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));

            Assert.IsTrue(true);
        }

I'm running the tests using the console:

nunit3-console "D:\\MS\\test-apps\\Xamarin.NUnit2.Tests\\bin\\Debug\\Xamarin.NUnit2.Tests.dll"  --workers=0 --process=Single

from nunit-v2-framework-driver.

CharliePoole avatar CharliePoole commented on July 1, 2024

The results are interesting. The nunit2 format output is actually created from the nunit3 output. The nunit3 output is generated by the extension from the v2 object model. That suggests an error in creating the nunit3 output followed by a compensating error in reformatting to nunit2. Like a perfect storm of errors.

from nunit-v2-framework-driver.

owenniblock avatar owenniblock commented on July 1, 2024

Interesting - so the correct data must be in there somewhere :) Sounds like it's just not getting mapped correctly.

EDIT: Looking at the code in the v2 report writer - it's mapping based on the "result" attribute on each test case. I'll have a look and see how it's totting up the values in the console.

from nunit-v2-framework-driver.

CharliePoole avatar CharliePoole commented on July 1, 2024

Rather than checking the full ResultState you should probably just look at the TestStatus component. Its values map directly to the four attributes that need to be set.

from nunit-v2-framework-driver.

Almewty avatar Almewty commented on July 1, 2024

Thanks for the advice!
I didn't really find a way to get access to the TestStatus component so I at least used the same logic to determine the state here. The only way I found was via TestContext.Result.State. But I could not find a way to get a TestContext.
But now that I know that there is a place to get this information from I would rather find a proper way.
Any advice?

from nunit-v2-framework-driver.

CharliePoole avatar CharliePoole commented on July 1, 2024

AH! Apologies... I forgot you are dealing with a V2 ResultState, which is nothing but an enum. In NUnit 3, that becomes a class with Status, Label and Site properties.

I think you should handle them consistent with how we translate to NUnit 3 result states in the GetTranslatedResultState method. I think you have done that with the sole exception of NotRunnable, which NUnit 3 treats as failed.

It would also be cool if you could avoid recursing through all the children four times and do it just once, but I don't see that as essential to the PR.

from nunit-v2-framework-driver.

CharliePoole avatar CharliePoole commented on July 1, 2024

Fixed by PR #23

from nunit-v2-framework-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.