Skip to content

SchemaException: Stacktrace differs on Unix vs. Windows / Test failure on Windows #8517

@N-Olbert

Description

@N-Olbert

Product

Hot Chocolate

Version

15.1.8

Link to minimal reproduction

  • F.e. FilterInputTypeTest.FilterInputType_Should_ThrowException_WhenNoConventionIsRegisteredDefault

Steps to reproduce

On Unix, the path is elided from the stacktrace, resulting in something like:

For more details look at the `Errors` property.

1. For more details look at the `Errors` property.

1. No default filter convention found. Call `AddFiltering()` on the schema builder.
 (HotChocolate.Types.ObjectType)

   at HotChocolate.Data.FilterDescriptorContextExtensions.<>c__DisplayClass1_0.<GetFilterConvention>b__0() in FilterDescriptorContextExtensions.cs:line 19
   at HotChocolate.Types.Descriptors.DescriptorContext.GetConventionOrDefault[T](Func`1 factory, String scope) in DescriptorContext.cs:line 167
   at HotChocolate.Data.FilterDescriptorContextExtensions.GetFilterConvention(IDescriptorContext context, String scope) in FilterDescriptorContextExtensions.cs:line 18
   at HotChocolate.Types.FilterObjectFieldDescriptorExtensions.<>c__DisplayClass5_0.<UseFiltering>b__1(IDescriptorContext c, ObjectFieldConfiguration definition) in FilterObjectFieldDescriptorExtensions.cs:line 128
   at HotChocolate.Types.Descriptors.DescriptorBase`1.<>c__DisplayClass21_0.<OnBeforeCreate>b__0(IDescriptorContext c, ITypeSystemConfiguration d) in DescriptorBase~1.cs:line 99
   at HotChocolate.Types.Descriptors.Configurations.OnCreateTypeSystemConfigurationTask.Configure(IDescriptorContext context) in OnCreateTypeSystemConfigurationTask.cs:line 28
   at HotChocolate.Types.Descriptors.DescriptorBase`1.CreateConfiguration() in DescriptorBase~1.cs:line 59
   at HotChocolate.Types.Descriptors.ObjectTypeDescriptor.OnCreateConfiguration(ObjectTypeConfiguration definition) in ObjectTypeDescriptor.cs:line 96
   at HotChocolate.Types.Descriptors.DescriptorBase`1.CreateConfiguration() in DescriptorBase~1.cs:line 47
   at HotChocolate.Types.ObjectType.CreateConfiguration(ITypeDiscoveryContext context) in ObjectType.Initialization.cs:line 39
   at HotChocolate.Types.TypeSystemObject`1.Initialize(ITypeDiscoveryContext context) in TypeSystemObjectBase~1.cs:line 31
   at HotChocolate.Configuration.TypeRegistrar.InitializeType(TypeSystemObject typeSystemObject, String scope, Boolean isInferred) in TypeRegistrar.cs:line 179

On Windows, this does not happen, resulting in something like:

For more details look at the `Errors` property.

1. For more details look at the `Errors` property.

1. No default filter convention found. Call `AddFiltering()` on the schema builder.
 (HotChocolate.Types.ObjectType)

   at HotChocolate.Data.FilterDescriptorContextExtensions.<>c__DisplayClass1_0.<GetFilterConvention>b__0() in D:\GitHub\graphql-platform\src\HotChocolate\Data\src\Data\Filters\Extensions\FilterDescriptorContextExtensions.cs:line 19
   at HotChocolate.Types.Descriptors.DescriptorContext.GetConventionOrDefault[T](Func`1 factory, String scope) in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\Descriptors\Conventions\DescriptorContext.cs:line 167
   at HotChocolate.Data.FilterDescriptorContextExtensions.GetFilterConvention(IDescriptorContext context, String scope) in D:\GitHub\graphql-platform\src\HotChocolate\Data\src\Data\Filters\Extensions\FilterDescriptorContextExtensions.cs:line 18
   at HotChocolate.Types.FilterObjectFieldDescriptorExtensions.<>c__DisplayClass5_0.<UseFiltering>b__1(IDescriptorContext c, ObjectFieldConfiguration definition) in D:\GitHub\graphql-platform\src\HotChocolate\Data\src\Data\Filters\Extensions\FilterObjectFieldDescriptorExtensions.cs:line 128
   at HotChocolate.Types.Descriptors.DescriptorBase`1.<>c__DisplayClass21_0.<OnBeforeCreate>b__0(IDescriptorContext c, ITypeSystemConfiguration d) in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\Descriptors\DescriptorBase~1.cs:line 99
   at HotChocolate.Types.Descriptors.Configurations.OnCreateTypeSystemConfigurationTask.Configure(IDescriptorContext context) in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\Descriptors\Configurations\OnCreateTypeSystemConfigurationTask.cs:line 28
   at HotChocolate.Types.Descriptors.DescriptorBase`1.CreateConfiguration() in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\Descriptors\DescriptorBase~1.cs:line 59
   at HotChocolate.Types.Descriptors.ObjectTypeDescriptor.OnCreateConfiguration(ObjectTypeConfiguration definition) in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\Descriptors\ObjectTypeDescriptor.cs:line 96
   at HotChocolate.Types.Descriptors.DescriptorBase`1.CreateConfiguration() in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\Descriptors\DescriptorBase~1.cs:line 47
   at HotChocolate.Types.ObjectType.CreateConfiguration(ITypeDiscoveryContext context) in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\ObjectType.Initialization.cs:line 39
   at HotChocolate.Types.TypeSystemObject`1.Initialize(ITypeDiscoveryContext context) in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Types\TypeSystemObjectBase~1.cs:line 31
   at HotChocolate.Configuration.TypeRegistrar.InitializeType(TypeSystemObject typeSystemObject, String scope, Boolean isInferred) in D:\GitHub\graphql-platform\src\HotChocolate\Core\src\Types\Configuration\TypeRegistrar.cs:line 179

For this reason, some tests in the project fail when executed under Windows, f.e. FilterInputTypeTest.FilterInputType_Should_ThrowException_WhenNoConventionIsRegisteredDefault

What is expected?

Consistens behaviour.
Since the stacktrace is explicitly sanitized, Windows should behave like Unix.

What is actually happening?

The regex here doesnt consider the fact that under windows there is already a : after the the drive letter (C:...`)

[GeneratedRegex(@" in ([^:]+):line (\d+)", RegexOptions.Compiled)]

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions