Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change failed test message to use lucene.testsettings.json instead of .runsettings #999

Closed
1 task done
paulirwin opened this issue Oct 26, 2024 · 0 comments · Fixed by #1021
Closed
1 task done
Labels
is:task A chore to be done

Comments

@paulirwin
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Task description

When a unit test fails, it prints a message instructing the user on how they can set the random seed and culture to reproduce the test. The output today looks like:

To reproduce this test result:

Option 1:

 Apply the following assembly-level attributes:

[assembly: Lucene.Net.Util.RandomSeed("0x9a2b7430d6d33f0d")]
[assembly: NUnit.Framework.SetCulture("en-IE")]

Option 2:

 Use the following .runsettings file:

<RunSettings>
  <TestRunParameters>
    <Parameter name="tests:seed" value="0x9a2b7430d6d33f0d" />
    <Parameter name="tests:culture" value="en-IE" />
  </TestRunParameters>
</RunSettings>

See the .runsettings documentation at: https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file.

The .runsettings option is more verbose than the lucene.testsettings.json version, it requires structuring the XML properly to work, and has the extra documentation link that could be removed with the JSON approach. This message could instead look like:

To reproduce this test result:

Option 1:

 Apply the following assembly-level attributes:

[assembly: Lucene.Net.Util.RandomSeed("0x9a2b7430d6d33f0d")]
[assembly: NUnit.Framework.SetCulture("en-IE")]

Option 2:

 Create the following lucene.testsettings.json file somewhere between the test assembly and your root drive:

{
  "tests": {
     "seed": "0x9a2b7430d6d33f0d",
     "culture": "en-IE"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:task A chore to be done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant