You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "NightOwl888 (via GitHub)" <gi...@apache.org> on 2024/01/19 08:23:47 UTC

Re: [I] Make assertions into a 1st class feature in the test framework [lucenenet]

NightOwl888 commented on issue #306:
URL: https://github.com/apache/lucenenet/issues/306#issuecomment-1899961979

   Just an update on our NUnit integration.
   
   We added the repeatable randomized testing functionality in #547, so now it is much easier to debug random tests. This was done primarily by implementing our own `[TestFixture]` attribute that enables running the functionality. This attribute is placed within `LuceneTestCase` so even if any test file has a `using NUnit.Framework` at the top, the compiler will choose our `[TestFixture]` instead of the one in NUnit as long as it is a subclass of `LuceneTestCase`.
   
   The `[SuppressCodecs]` attribute functions inside of the `TestRuleSetupAndRestoreClassEnv`, which is executed by NUnit when it calls our `LuceneTestCase` methods that are decorated with the `[OneTimeSetup]` and `[OneTimeTearDown]` attributes. Unfortunately, this means that a user can disable this functionality by overriding these methods without calling the base class (we probably should address that).
   
   We also added `[AwaitsFix]`, `[Nightly]`, `[Weekly]`, and `[Slow]` attributes so we can classify tests accordingly. These attributes extend NUnit interfaces so NUnit will execute them. Some of them still have issues because they run the most time consuming bits of the test before the attribute has a chance to run. See #739.
   
   We are still missing the `[BadApple]` attribute, which we don't really have a use for. This was for putting the tests into a "vault" in Jenkins if they fail frequently.
   
   The `[SuppressTempFileChecks]` attribute still does not function, which we should address at some point.
   
   So, we are very much integrated with NUnit at this point, and I am not sure there is another test framework that can support all of this functionality (at least not without making our own fork of it).
   
   That said, NUnit 4 has already shipped and it is not yet known how much work is involved with supporting it.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org