Skip to content

Write up recommended way to test and link it from the readme #2973

Description

@jnm2

I find https://github.com/nunit/nunit/blob/master/BUILDING.md#build-script a bit vague and we've had a number of folks asking us how we test.

I think there's a lot of room for personal style assuming we have solid CI. My ideal workflow:

  1. Locate existing tests or write new tests
  2. Pin that test fixture to make it quick to rerun the tests while typing (even better, start continuous testing) by filtering classes in Test Explorer or adding tests to a new ReSharper test session
  3. Implement a change
  4. Before creating a Git commit, run .\build.ps1 -t test to make sure the passes and failures are as expected
  5. If there are any surprises, find and pin the affected tests I didn't know about and go to step 3

Activity

  1. BrunoJuchli commented on Aug 21, 2018

    @BrunoJuchli
    Contributor

    Thanks for taking the time to write up the readme!

    The reason I was asking in the first time is because I looked at the contribution guide and it didn't mention it. I did a search on the repo for "run tests" "running tests" and couldn't find anything. I found the build script (it's in the root directory....) but couldn't figure out whether I could use it to run tests. Also I didn't think to look at the build-script page because.. you know I found the script already. My mistake.
    Also I can't seem to get the test to run with Resharper. So, mainly because I was too lazy, I just thought I'd create the pull requests and have the CI servers run the tests for me (although I would have preferred to run them myself before publishing the PR and causing anyone to invest time into reviewing an incomplete PR).

    Since you mention Resharper: I've tried running the tests with R# (2018.2 EAP 7 or 8, VS 2017.7) but they all end up with "Inconclusive". Starting with debugging there's an exception stating that Nunit 3.11 is not supported.
    I've tried manually configuring the path to Nunit @ Resharper settings. I've chosen bin/Debug/net4.5 (and tried /Release, too) of the checked-out and built repository. Resharper finds nunit but the tests are still inconclusive.
    What do I need to do to get the tests running @r#?

  2. jnm2 commented on Sep 7, 2018

    @jnm2
    ContributorAuthor

    What do I need to do to get the tests running @r#?

    I opened #3008 to track this.

  3. FrankRay78 commented on May 31, 2021

    @FrankRay78
    Contributor

    Hi @BrunoJuchli

    A multi-year follow up I know, but I wondered if you had any joy getting the Rider test runner working such that you could run tests directly in the IDE?

    It seems that JetBrains have had a bit of trouble circa 2018 / 2019 with their auto-detection of tests, see: https://twitter.com/jetbrainsrider/status/1123930158627299328

    However, it's 2021, I'm using the latest Rider (2021.1.2) and the issue is still occurring for me.

  4. BrunoJuchli commented on Jun 1, 2021

    @BrunoJuchli
    Contributor

    @FrankRay78
    Haven't tried again ever since. We're currently using xunit only in our projects, so...
    On a sidenote: xunit 2.0 features are mostly still unsupported by R#/rider. There's been no significant development there for years.

  5. FrankRay78 commented on Jun 9, 2021

    @FrankRay78
    Contributor

    FYI - I'm going to take this issue @rprouse

  6. rprouse commented on Jun 9, 2021

    @rprouse
    Member
  7. rprouse commented on Jun 9, 2021

    @rprouse
    Member

    FYI, I made a pass at getting the tests to run in Visual Studio recently but couldn't get them working. Now that @OsirisTerje has released the 4.0 version of the adapter, we might have more luck.

  8. FrankRay78 commented on Jun 9, 2021

    @FrankRay78
    Contributor

    Hi Rob. I propose to address this issue with a more general documentation update to the BUILDING.md file, and then specifically address issue #3008 which covers running tests in the IDE. I hope this approach is acceptable.

  9. FrankRay78 commented on Jun 11, 2021

    @FrankRay78
    Contributor

    Update. PR submitted to (hopefully) close this issue - #3875

  10. FrankRay78 commented on Oct 1, 2022

    @FrankRay78
    Contributor

    Hi @rprouse, see my most recent comment above - PR #3875 has been merged. Unless there is something else regarding this issue that I'm not aware of, I suggest it can now be marked as closed.

  11. added this to the 3.13.4 milestone on Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions