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

[BUG] Parameter : threshold-stat triggered error #1634

Closed
zy8008 opened this issue Feb 28, 2024 · 5 comments · Fixed by #1635
Closed

[BUG] Parameter : threshold-stat triggered error #1634

zy8008 opened this issue Feb 28, 2024 · 5 comments · Fixed by #1635
Labels
bug Something isn't working

Comments

@zy8008
Copy link

zy8008 commented Feb 28, 2024

when build found the following errors with ver 6.0.1 and. netcore6.0:

Unhandled exception. System.ArgumentException: Type Coverlet.Core.Enums.ThresholdStatistic cannot be created without a custom binder.
   at System.CommandLine.Binding.ArgumentConverter.CreateEnumerable(Type type, Type itemType, Int32 capacity)
   at System.CommandLine.Binding.ArgumentConverter.ConvertTokens(Argument argument, Type type, IReadOnlyList`1 tokens, LocalizationResources localizationResources, ArgumentResult argumentResult)
   at System.CommandLine.Binding.ArgumentConverter.TryConvertArgument(ArgumentResult argumentResult, Object& value)
   at System.CommandLine.Parsing.ArgumentResult.Convert(Argument argument)
   at System.CommandLine.Parsing.ArgumentResult.GetArgumentConversionResult()
   at System.CommandLine.Parsing.ParseResultVisitor.ValidateAndConvertArgumentResult(ArgumentResult argumentResult)
   at System.CommandLine.Parsing.ParseResultVisitor.ValidateAndConvertOptionResult(OptionResult optionResult)
   at System.CommandLine.Parsing.ParseResultVisitor.Stop()
   at System.CommandLine.Parsing.ParseResultVisitor.Visit(SyntaxNode node)
   at System.CommandLine.Parsing.Parser.Parse(IReadOnlyList`1 arguments, String rawInput)
   at System.CommandLine.CommandExtensions.GetDefaultInvocationPipeline(Command command, String[] args)
   at System.CommandLine.CommandExtensions.Invoke(Command command, String[] args, IConsole console)
   at Coverlet.Console.Program.Main(String[] args) in /_/src/coverlet.console/Program.cs:line 134

After checking, I found that the reason is due to the following parameters: --threshold-stat total , Restore normal after removing this parameter

Following is full command:
coverlet xxxx.Test.dll --target "dotnet" --targetargs "test ./ --no-build" --threshold 80 --threshold-type line --threshold-stat total --format opencover

@github-actions github-actions bot added the untriaged To be investigated label Feb 28, 2024
@zy8008 zy8008 changed the title [BUG] [BUG] Parameter : threshold-stat triggered error Feb 28, 2024
@daveMueller
Copy link
Collaborator

I can confirm the bug. Easy to reproduce just use the command --threshold-stat total.

@daveMueller daveMueller added bug Something isn't working and removed untriaged To be investigated labels Feb 28, 2024
@daveMueller
Copy link
Collaborator

I'll work on it as I already nearly have the PR ready.

@daveMueller
Copy link
Collaborator

Hi guys, we finally merged everything we broke with the last release including this issue. We would really appreciate if someone could give it a try.
Here is how to consume the nightly: https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md

@daveMueller
Copy link
Collaborator

We now have a new official release 6.0.2 that can be consumed from nuget.org.

@zy8008
Copy link
Author

zy8008 commented Mar 13, 2024

It's work ok on 6.0.2, thanks alot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants