-
Notifications
You must be signed in to change notification settings - Fork 388
coverlet.msbuild not working on .net 7 #1391
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hey @maricomic The workaround is to use environment variables. |
I have this problem with the net7.0 release. |
Also hitting this. |
Hitting the same, just tried to upgrade a library project to .NET 7 and it failed to generate coverage. We're using https://github.com/nuke-build/nuke, so it was actually quite easy to resolve, but it looks really bad: DotNetTest(c => c
.EnableCollectCoverage()
// See https://github.com/coverlet-coverage/coverlet/issues/1391, MSBuild parameters
// in .NET 7 need to be set via environment variables
.SetProcessEnvironmentVariable("CollectCoverage", "true")
.SetCoverletOutputFormat(CoverletOutputFormat.cobertura)
.SetProcessEnvironmentVariable("CoverletOutputFormat", "cobertura") |
I'm also seeing this - using
With the msbuild plugin. No coverage shows up, just the standard output:
|
Hi all, I'm reporting the same, with the .NET 7 SDK released early this week and using Azure Pipelines and coverlet.msbuild version 3.2.0.
I can confirm that using environment variables in Azure Pipelines works, by using the PowerShell task: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=powershell Thanks @GeorgDangl for the suggestion! As I have several projects already configured for coverlet.msbuild, I'll wait until there is a solution for this issue with .NET 7. |
Hi, for the people could not wait for release 7.0.101. I was able to build the fixed version of dotnet.dll. |
Another option is to add the necessary properties to <PropertyGroup Condition="$(MSBuildProjectName.Contains('.Tests.'))">
<CollectCoverage>true</CollectCoverage>
<ExcludeByAttribute>GeneratedCodeAttribute</ExcludeByAttribute>
<Exclude>[*]*.Migrations.*</Exclude>
<ExcludeByFile>**/MyFile.cs</ExcludeByFile>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
</PropertyGroup> |
The coverlet msbuild doesn't work and thus the tests coverage report is not generated. It is a temporarily bug cause in .NET 7.0.100 version and will be fixed in .NET 7.0.101. For more info follow the issues: - [coverlet.msbuild not working on .net 7](coverlet-coverage/coverlet#1391) - [dotnet test does not forward MSBuild properties to msbuild in .NET 7 RC1]microsoft/vstest#4014
The coverlet msbuild doesn't work and thus the tests coverage report is not generated. It is a temporarily bug cause in .NET 7.0.100 version and will be fixed in .NET 7.0.101. For more info follow the issues: - [coverlet.msbuild not working on .net 7](coverlet-coverage/coverlet#1391) - [dotnet test does not forward MSBuild properties to msbuild in .NET 7 RC1]microsoft/vstest#4014
Hi all,
I tested in my Azure DevOps pipelines and works as expected. Now I can roll the upgrade to .NET 7 to all my personal projects 🎉 |
Is there any disadvantage to keeping the -e parameters to set the environment variables? I've updated 40+ projects... |
I don't think there is any disadvantage, the only question is whether the environment variables approach has precedence over the ones passed as parameters of dotnet test. |
Hi all, the issue was fixed by the microsoft guys with sdk 7.0.101 that was released last week microsoft/vstest#4014. I just checked it with a repro from another related issue and it works fine. Please give it a try again. Thanks @jmoralesv for already mentioning it. |
I close this as the external issue is fixed. Feel free to reopen. |
* initial of the branch * контракт адреса * Переезд на .NET 7 (#24) * обновление sdk в проекте * обновление sdk в ci * переход на json raw string literal * обновление nuget пакетов * Генерация отчёта о покрытии на уровне конфигурации проекта coverlet-coverage/coverlet#1391 * Генерация отчёта о покрытии на уровне конфигурации проекта coverlet-coverage/coverlet#1391 * versioning * Update Readme.md * draft алгоритма работы коллекции * Использование последних наворотов шарпа (#26) * versioning * enabling implicit usings (#25) * local scoped namespaces (#27) * after merge * разработка алгоритма вставки в коллекцию * пакетная вставка * доработка алгоритма вставки * индексатор * прямая итерация над коллекцией * важная доработка вставки - сгенерированный адрес проставляется инструкции, больше не требуется создавать адрес для создания инструкции * переименовал сущность адреса * доработка массовой вставки * алгоритм удаления инструкции * unit tests * more tests
- Reference to fix task that run tests: - coverlet.msbuild not working on .net 7 - coverlet-coverage/coverlet#1391 - Installed reportgenerator - https://www.nuget.org/packages/dotnet-reportgenerator-globaltool
- Reference to fix task that run tests: - coverlet.msbuild not working on .net 7 - coverlet-coverage/coverlet#1391 - Adding package reference coverlet.msbuild to tests project
Those variables were used as a temporarily solution to a regression bug of .NET 7.0.100. For more info: - [coverlet.msbuild not working on .net 7](coverlet-coverage/coverlet#1391) - [dotnet test does not forward MSBuild properties to msbuild in .NET 7 RC1]microsoft/vstest#4014
Those variables were used as a temporarily solution to a regression bug of .NET 7.0.100. For more info: - [coverlet.msbuild not working on .net 7](coverlet-coverage/coverlet#1391) - [dotnet test does not forward MSBuild properties to msbuild in .NET 7 RC1]microsoft/vstest#4014
Those variables were used as a temporarily solution to a regression bug of .NET 7.0.100. For more info: - [coverlet.msbuild not working on .net 7](coverlet-coverage/coverlet#1391) - [dotnet test does not forward MSBuild properties to msbuild in .NET 7 RC1](microsoft/vstest#4014)
Those variables were used as a temporarily solution to a regression bug of .NET 7.0.100. For more info: - [coverlet.msbuild not working on .net 7](coverlet-coverage/coverlet#1391) - [dotnet test does not forward MSBuild properties to msbuild in .NET 7 RC1](microsoft/vstest#4014)
Those variables were used as a temporarily solution to a regression bug of .NET 7.0.100. For more info: - [coverlet.msbuild not working on .net 7](coverlet-coverage/coverlet#1391) - [dotnet test does not forward MSBuild properties to msbuild in .NET 7 RC1](microsoft/vstest#4014)
* Добавил пакет с контрактом паттерна "Посетитель", на который переведу AST * migration to Visitor.NET 2.0.0 * базис внедрения шаблона Посетитель * move folder * merge * small refactoring + two nodes * fix build * Новая система адресации инструкций (#21) * initial of the branch * контракт адреса * Переезд на .NET 7 (#24) * обновление sdk в проекте * обновление sdk в ci * переход на json raw string literal * обновление nuget пакетов * Генерация отчёта о покрытии на уровне конфигурации проекта coverlet-coverage/coverlet#1391 * Генерация отчёта о покрытии на уровне конфигурации проекта coverlet-coverage/coverlet#1391 * versioning * Update Readme.md * draft алгоритма работы коллекции * Использование последних наворотов шарпа (#26) * versioning * enabling implicit usings (#25) * local scoped namespaces (#27) * after merge * разработка алгоритма вставки в коллекцию * пакетная вставка * доработка алгоритма вставки * индексатор * прямая итерация над коллекцией * важная доработка вставки - сгенерированный адрес проставляется инструкции, больше не требуется создавать адрес для создания инструкции * переименовал сущность адреса * доработка массовой вставки * алгоритм удаления инструкции * unit tests * more tests * переписал новые визиторы на AddressedInstructions * удаление конструкта "номер инструкции" * допиливание работы с Label.cs * удаление конструкта номера из алгоритмов инструкций * прогон инструкций в виртуальной машине по адресу * переписывание алгоритмов инструкций на работу с адресами * текущая реализация не требует такой сложной конструкции инструкции возврата * remove unused * подправил контракт AST * block statement * Proper HasReturnStatementImplementation * removed unused code * перегруппировка * address system refactoring * HashedAddress.cs fix * AddressedInstructions.cs fix * introducing brand new visitor architecture * unary expression visitor * refactoring + error removal * Simple.cs fix * BinaryExpression refactoring * move AddressedInstructions.cs back * remove unused * as string code gen * Constant.cs refactoring * доработка генерации существующих функций ExpressionInstructionProvider.cs * ArrayLiteral.cs visit * TypeStatement.cs fix * InsideLoopStatement.cs visit * ExpressionStatement.cs visit * ReturnStatement.cs visit * Label.cs fix * remove redunant override * Property.cs refactoring * ObjectLiteral.cs + FunctionDeclaration.cs visitor refactoring & decoupling * WhileStatement.cs visit refactoring * IfStatement.cs refactoring with visitor * IfStatement.cs fix * ConditionalExpression.cs visit fix * AssignmentExpression.cs visitor * fix * fix tests * ComplexLiteral.cs * AssignmentExpression visit fix * Исправление некорректной грамматики (#28) * new grammar.txt content * format grammar.txt * grammar fix * MemberExpression.cs visiting * refactoring * fix * replacement function in AddressedInstructions.cs * AssignmentExpression visiting fix * fix * call expr print * fix parser * parser fix 2 * restructuring * script body visit fix * formatting * parser fix * refactoring * semantic assertion draft * break support in if statatement * enum rename * rename * exceptions excluded from codecov * some semantic analysis rework * removed some tests * supress code cov * suppress * ReturnStatement.cs semantic * renane * parser fix * rename * move * mv SemanticChecker.cs * new visitor * region * SymbolTableBuilder.cs completed * module refactoring * removed symbol table construction from parsing * SymbolTableInitializer fix * integration with symbol table initializer * refactoring * DeclarationVisitor.cs * usage of decl visitor * fix recursion * - Visiting type decl - New type symbol - Removed types dict from symbol table * fix * small fix * update nuget * symbol refactoring * some work stuck long time ago * symbol state * предварительная версия инициализатора имён * fix ci * complete type loading system rework * type resolving example * refactoring of default js types consuming and custom types resolving * fix function codegen bug - end label was not emitted * type domain refactored * pre-load built types before reference resolving * fix bug in object type ref resolving * hierarchy enhancement * guard of type duplicates and built-in types declaration * initialized/declared type symbols * some new checks * more refac * proper render of type values * guard declarations from duplicates * do not return null * binary and unary expressions check * fix bug sequence has no elements * guard against no initializer * formatting * there is not symbol without initializer thus symbol cannot be not initialized * working with assignments * checking access expressions * check object literal without methods * реструктуризация сервисов посетителей * рефакторинг после реструктуризации * удалил ненавистный Utils * рефакторинг объектного типа * сохранение функций в хранилище, для которых не был сразу выведен возвращаемый тип, чтобы впоследствии его вычислить * call expr check v1 * fix * перенос проверок функции статическим анализом * Починил бекенд при работе с анонимными массивами и объектами * доработка вывода типов * поправил вывод типов в части необработанных функций * обновление версий экшенов * вторая волна обновлений * upd workflows * global using visitor.net * fix func decl gen * Revert "fix func decl gen" This reverts commit ef97623. * visit fix * Имеет ли функция пустое тело * исправил ошибку кодогенерации if statement при отсутствии else блока * базовая кодогенерация для вызова функции без учета метода объекта * доработка вывода типов * починил статический анализ доступа к элементу массива по индексу * fix * rename to hydrascript * #15 - удалил методы из объекта * #15 - удалил концепцию метода из бекенда * #15 - удалил FunctionType.cs * #15 - статический анализ вызова метода * #15 - кодогенерация вызова метода * #15 - актуализация лексической структуры * #15 - доработка "забытого" статического анализа * #15 - поправил кодген if-else * rm * #15 - если у функции не прописан тип и нет return'ов, то она void * #15 - корректировка примеров * #23 - рабочий пример
* Переезд на паттерн "Посетитель" (#4) * Добавил пакет с контрактом паттерна "Посетитель", на который переведу AST * migration to Visitor.NET 2.0.0 * базис внедрения шаблона Посетитель * move folder * merge * small refactoring + two nodes * fix build * Новая система адресации инструкций (#21) * initial of the branch * контракт адреса * Переезд на .NET 7 (#24) * обновление sdk в проекте * обновление sdk в ci * переход на json raw string literal * обновление nuget пакетов * Генерация отчёта о покрытии на уровне конфигурации проекта coverlet-coverage/coverlet#1391 * Генерация отчёта о покрытии на уровне конфигурации проекта coverlet-coverage/coverlet#1391 * versioning * Update Readme.md * draft алгоритма работы коллекции * Использование последних наворотов шарпа (#26) * versioning * enabling implicit usings (#25) * local scoped namespaces (#27) * after merge * разработка алгоритма вставки в коллекцию * пакетная вставка * доработка алгоритма вставки * индексатор * прямая итерация над коллекцией * важная доработка вставки - сгенерированный адрес проставляется инструкции, больше не требуется создавать адрес для создания инструкции * переименовал сущность адреса * доработка массовой вставки * алгоритм удаления инструкции * unit tests * more tests * переписал новые визиторы на AddressedInstructions * удаление конструкта "номер инструкции" * допиливание работы с Label.cs * удаление конструкта номера из алгоритмов инструкций * прогон инструкций в виртуальной машине по адресу * переписывание алгоритмов инструкций на работу с адресами * текущая реализация не требует такой сложной конструкции инструкции возврата * remove unused * подправил контракт AST * block statement * Proper HasReturnStatementImplementation * removed unused code * перегруппировка * address system refactoring * HashedAddress.cs fix * AddressedInstructions.cs fix * introducing brand new visitor architecture * unary expression visitor * refactoring + error removal * Simple.cs fix * BinaryExpression refactoring * move AddressedInstructions.cs back * remove unused * as string code gen * Constant.cs refactoring * доработка генерации существующих функций ExpressionInstructionProvider.cs * ArrayLiteral.cs visit * TypeStatement.cs fix * InsideLoopStatement.cs visit * ExpressionStatement.cs visit * ReturnStatement.cs visit * Label.cs fix * remove redunant override * Property.cs refactoring * ObjectLiteral.cs + FunctionDeclaration.cs visitor refactoring & decoupling * WhileStatement.cs visit refactoring * IfStatement.cs refactoring with visitor * IfStatement.cs fix * ConditionalExpression.cs visit fix * AssignmentExpression.cs visitor * fix * fix tests * ComplexLiteral.cs * AssignmentExpression visit fix * Исправление некорректной грамматики (#28) * new grammar.txt content * format grammar.txt * grammar fix * MemberExpression.cs visiting * refactoring * fix * replacement function in AddressedInstructions.cs * AssignmentExpression visiting fix * fix * call expr print * fix parser * parser fix 2 * restructuring * script body visit fix * formatting * parser fix * refactoring * semantic assertion draft * break support in if statatement * enum rename * rename * exceptions excluded from codecov * some semantic analysis rework * removed some tests * supress code cov * suppress * ReturnStatement.cs semantic * renane * parser fix * rename * move * mv SemanticChecker.cs * new visitor * region * SymbolTableBuilder.cs completed * module refactoring * removed symbol table construction from parsing * SymbolTableInitializer fix * integration with symbol table initializer * refactoring * DeclarationVisitor.cs * usage of decl visitor * fix recursion * - Visiting type decl - New type symbol - Removed types dict from symbol table * fix * small fix * update nuget * symbol refactoring * some work stuck long time ago * symbol state * предварительная версия инициализатора имён * fix ci * complete type loading system rework * type resolving example * refactoring of default js types consuming and custom types resolving * fix function codegen bug - end label was not emitted * type domain refactored * pre-load built types before reference resolving * fix bug in object type ref resolving * hierarchy enhancement * guard of type duplicates and built-in types declaration * initialized/declared type symbols * some new checks * more refac * proper render of type values * guard declarations from duplicates * do not return null * binary and unary expressions check * fix bug sequence has no elements * guard against no initializer * formatting * there is not symbol without initializer thus symbol cannot be not initialized * working with assignments * checking access expressions * check object literal without methods * реструктуризация сервисов посетителей * рефакторинг после реструктуризации * удалил ненавистный Utils * рефакторинг объектного типа * сохранение функций в хранилище, для которых не был сразу выведен возвращаемый тип, чтобы впоследствии его вычислить * call expr check v1 * fix * перенос проверок функции статическим анализом * Починил бекенд при работе с анонимными массивами и объектами * доработка вывода типов * поправил вывод типов в части необработанных функций * обновление версий экшенов * вторая волна обновлений * upd workflows * global using visitor.net * fix func decl gen * Revert "fix func decl gen" This reverts commit ef97623. * visit fix * Имеет ли функция пустое тело * исправил ошибку кодогенерации if statement при отсутствии else блока * базовая кодогенерация для вызова функции без учета метода объекта * доработка вывода типов * починил статический анализ доступа к элементу массива по индексу * fix * rename to hydrascript * #15 - удалил методы из объекта * #15 - удалил концепцию метода из бекенда * #15 - удалил FunctionType.cs * #15 - статический анализ вызова метода * #15 - кодогенерация вызова метода * #15 - актуализация лексической структуры * #15 - доработка "забытого" статического анализа * #15 - поправил кодген if-else * rm * #15 - если у функции не прописан тип и нет return'ов, то она void * #15 - корректировка примеров * #23 - рабочий пример * Feature/net 8 (#62) * #50 - .NET 8 * #44 - mac m1 * upd Readme.md * #32 - CommandLineSettings.cs теперь обычный dto с опциями (#63) * Update develop.yml - накинул фиксированных permissions * Add unique Guid check to HashAddress.Equals (#65) * Add unique Guid check to HashAddress.Equals * Update develop.yml - накинул фиксированных permissions --------- Co-authored-by: Степан <stepami@mail.ru> * Update develop.yml * Feature/nrt (#66) * #46 - nrt 1 * #46 - nrt 2 * #46 - nrt 3 * #46 - after merge * #46 - fix * Feature/lexer issue 58 (#67) * fix warnings * #58 - feature * #58 - tests * #58 - fix tests * рефакторинг структуры проекта (#68) * #31 - non code elements * #31 - samples * #31 - structure refac * #31 - one more file * rm cobertura * new ignore rule * Обновление Visitor.NET (#69) * minor fix * #31 - visitor.NET upgrade * #59 - переход на IReadOnlyList (#70) * #31 - change nullability of Parent * #31 unbound ast node from segment * #59 - переход на IReadOnlyList * Draft: Выделение поддоменов (#72) * #31 - IAbstractSyntaxTreeNode.cs * #31 - tree internal * #31 - separate ast from backend * #31 - segment * #31 - separate ast from backend 2 * #31 - value dto converter * #31 - удалил Type из TypeValue * #31 - fix test * #31 - symbol contracts * #31 - tuple -> dto * #31 - End is property * mv * #31 - backend mv * #31 - backend subdomain * #31 - scope dto for ast * #31 - rename * #31 - rename * #31 - ISymbolTable -> Scope * #31 - SymbolTableStorage.cs * #31 - fix bug * #31 - remove IR from codegen * Переход на чистую архитектуру и System.CommandLine (#73) * #51 - Скелет Луковой Архитектуры * #51 - удалил мусор * #51 - перенос backend * #51 - fix * #51 - перенос FrontEnd * #51 - Перенос IR * #51 - перенос StaticAnalysis * #51 - перенос Code Generation * #51 - code gen di refac * #51 - fix * #51 - fix * #51 - static analysis di refac * #51 - fix * #51 fix * #51 - fix * #51 - fix * #51 - nuget upgrade * #51 - infrastructure layer * #42 - внедрил system command line * di fix * #51 - fix * #47 - интеграционные тесты * #47 - ci cd * change ci cd setup * update Readme.md * Feature/generated lexer (#77) * #57 - абстракция IStructure.cs * #57 - token types provider * #57 - DI refactoring * #57 - json highlight * #57 - абстракция IGeneratedRegexContainer * fix * #57 - SG project * #57 - fix SG launch * #57 - tests * #57 - удаление динамического построения RegEx * #57 - убрал лишнее из TokenType * #57 - тест на проверку подстановки * fix * upd cvrg info * Перевод на Source Gen Json (#80) * #45 - тестовый workflow для проверки AOT publish на инфре GitHub Actions * #45 - перевёл бекенд на json source gen * fix * #45 - перевёл SG на json source gen * #45 - перевёл Infrastructure на json source gen * Revert "#45 - тестовый workflow для проверки AOT publish на инфре GitHub Actions" This reverts commit 3014c53. * Актуализация Readme и перенос файла грамматики в более подходящее место * small fix - return exit code * важное уточнение в Readme.md * logo * re-arrange * fix typo in logo * Merge pull request #83 * Перейти на FrozenDictionary в Structure. * Убран пробел. * I have read the CLA Document and I hereby sign the CLA * Remove cla (#85) * removed cla * fix * #48 - внедрение GitVersion (#86) * #48 - init GitVersion.yml * #48 - внедрение git-version в ci-cd * #48 - upload build * #48 - use version option * #48 - fix version * #48 - push builds only for dev * test * fix * fix * fix * fix * #48 - пуш тега на мерже в мастер * #48 - временное отключение релиз воркфлоу * убрал codecov для master - в нём нет смысла, так как подстановка данных все равно происходит руками +semver:skip * #48 - исключение release ветки из Develop Workflow * #48 - вернул release.yml * #48 - новый Release Workflow --------- Co-authored-by: Sergey Nazarov <insight.appdev@gmail.com> Co-authored-by: Georgy Levchenko <55885862+FoxTes@users.noreply.github.com>
Coverlet.msbuild (3.1.2) not working on .net 7
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:MergeWith="../CoverageResults/coverage.json"
Version .net: 7.0.100-rc.2.22477.23
The text was updated successfully, but these errors were encountered: