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

Gherkin.NoSuchLanguageException: 'Language not supported: en-US' when debugging #341

Open
hideintheclouds opened this issue Dec 4, 2024 · 2 comments
Labels
cannot reproduce We could not reproduce the problem

Comments

@hideintheclouds
Copy link

hideintheclouds commented Dec 4, 2024

Reqnroll Version

2.2.1

Which test runner are you using?

NUnit

Test Runner Version Number

4.2.2

.NET Implementation

.NET 8.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

{
"livingDocExecutionDataCollector": {
"enabled": true,
"filepath": "TestExecution.json"
},

"language": {
"feature": "en-US",
"binding": "en-US"

},

"bindingAssemblies": [
{ "assembly": ...}
...
]
}

Issue Description

When running the Reqnroll test scenarios in Debug mode, there are uncaught exceptions that look like:
Exception thrown: 'Gherkin.NoSuchLanguageException' in Gherkin.dll

Gherkin.NoSuchLanguageException: 'Language not supported: en-US'
at Gherkin.GherkinDialectProvider.GetDialect(String language, Location location)

These are thrown in the following method:
[global::NUnit.Framework.OneTimeTearDown]
[MethodImpl(MethodImplOptions.NoInlining)]
public static async ValueTask AssemblyCleanupAsync()
{
var currentAssembly = typeof(MYPROJECT_NUnitAssemblyHooks).Assembly;
await global::Reqnroll.TestRunnerManager.OnTestRunEndAsync(currentAssembly);
}

It seems that the Gherkin.dll is always trying to load the 'en-US' language in the GherkinDialectProvider.GetDialect() method.
Setting the language in either the feature files or reqnroll to a different value still seems to take the same default 'en-US'.

Values tried:

  • en-NL
  • en-UK
  • en
  • en-US

Steps to Reproduce

Run the tests in debug mode in Visual Studio 2022.
The tests are executed in an air-gapped environment.
The system locale is set to en-US English (United States)
Regional Format: English (United Kingdom)

Stack trace:
at Gherkin.GherkinDialectProvider.GetDialect(String language, Location location) in Gherkin\GherkinDialectProvider.cs:line 31

Link to Repro Project

No response

@hideintheclouds hideintheclouds added the bug Something isn't working label Dec 4, 2024
@obligaron
Copy link
Contributor

I have tried to reproduce the problem, but I cannot.
I can reproduce a NoSuchLanguageException being thrown (the debugger stops when I enable "Break when thrown" in the "Exception Settings", but it is handled.

Does this also happen with a newly created reqnroll NUnit project?
If not, could you provide a small repro where this also happens?
Does this not happen in other environments, e.g. not air-gapped?
Can you provide the full call stack when the exceptions occur (including wrapped exceptions)?

@gasparnagy
Copy link
Contributor

gasparnagy commented Dec 18, 2024

For the record, even the handled version of the exception might be reduced now significantly with #336 by @obligaron. It is merged already, but not released yet.

@gasparnagy gasparnagy added cannot reproduce We could not reproduce the problem and removed bug Something isn't working labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cannot reproduce We could not reproduce the problem
Projects
None yet
Development

No branches or pull requests

3 participants