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

DotCover aliasses are using windows style cli arguments on unix-like systems #4096

Open
2 tasks done
Raikovm opened this issue Dec 12, 2022 · 6 comments
Open
2 tasks done

Comments

@Raikovm
Copy link

Raikovm commented Dec 12, 2022

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

Cake runner

Cake .NET Tool

Cake version

2.3.0

Operating system

Linux

Operating system architecture

64-Bit

CI Server

TeamCity and localy

What are you seeing?

When running on unix-like systems (im my case mcr.microsoft.com/dotnet/sdk:6.0-alpine docker container) DotCoverAliasses are still using windows style cli arguments. For example, when running task:

Task("Tests")
    .IsDependentOn("Build")
    .Does(() => 
{
    DotCoverCover(tool => {
      tool.DotNetTest(pathToSolution, new DotNetTestSettings
        {
            Configuration = configuration,
            NoBuild = true,
        });
      },
      new FilePath(pathToCoverage),
      new DotCoverCoverSettings()); 
});

DotCoverCover executes:
/usr/bin/mono "/src/tools/JetBrains.dotCover.GlobalTool.2022.3.0/tools/netcoreapp3.1/any/dotCover.exe" Cover /TargetExecutable="/usr/bin/dotnet" /TargetArguments="test \"./Test.sln\" --configuration Release - -no-build" /Output="/src/Out/Coverage/result.dcvr"
As a result an error occures:
[JetBrains dotCover] Configuration file '/TargetExecutable=/usr/bin/dotnet' not found.

Running on Windows 10 works perfectly

What is expected?

DotCover works on linux same way it is works on Windows

Steps to Reproduce

Run DotCoverCover(or other DotCoverAlias) in a cake file with any test runner (even passing null as an Action has the same result) on a linux system

Output log

When running task:

Task("Tests")
    .IsDependentOn("Build")
    .Does(() => 
{                    
    DotCoverCover(tool => {
      tool.DotNetTest(pathToSolution, new DotNetTestSettings
        {
            Configuration = configuration,
            NoBuild = true,
        });
      },
      new FilePath(pathToCoverage),
      new DotCoverCoverSettings()); 
});
#18 0.952 Looking for modules...
#18 0.994 No modules found to install.
#18 1.000 Module directory does not exist.
#18 1.007 Analyzing build script...
#18 1.008 Analyzing /src/build.cake...
#18 1.009 Analyzing /src/scripts/teamcity.cake...
#18 1.016 Processing build script...
#18 1.017 Installing tools...
#18 1.548 Adding assembly reference to System.Private.CoreLib.dll...
#18 1.548 Adding assembly reference to System.Linq.Expressions.dll...
#18 1.548 Adding assembly reference to Microsoft.CSharp.dll...
#18 1.548 Adding assembly reference to System.Runtime.dll...
#18 1.548 Adding assembly reference to System.Runtime.InteropServices.dll...
#18 1.548 Adding assembly reference to System.Collections.Concurrent.dll...
#18 1.548 Adding assembly reference to System.Threading.dll...
#18 1.548 Adding assembly reference to System.Linq.dll...
#18 1.548 Adding assembly reference to System.Collections.dll...
#18 1.548 Adding assembly reference to Microsoft.VisualBasic.Core.dll...
#18 1.548 Adding assembly reference to System.Reflection.Emit.Lightweight.dll...
#18 1.548 Adding assembly reference to System.Reflection.Emit.ILGeneration.dll...
#18 1.549 Adding assembly reference to System.Reflection.Primitives.dll...
#18 1.549 Adding assembly reference to System.ObjectModel.dll...
#18 1.549 Adding assembly reference to System.Threading.Thread.dll...
#18 1.549 Adding assembly reference to System.IO.FileSystem.DriveInfo.dll...
#18 1.549 Adding assembly reference to System.Collections.Specialized.dll...
#18 1.549 Adding assembly reference to System.ComponentModel.Primitives.dll...
#18 1.549 Adding assembly reference to System.Text.RegularExpressions.dll...
#18 1.549 Adding assembly reference to System.Collections.NonGeneric.dll...
#18 1.549 Adding assembly reference to Microsoft.Win32.Registry.dll...
#18 1.549 Adding assembly reference to Microsoft.VisualBasic.dll...
#18 1.549 Adding assembly reference to Microsoft.Win32.Primitives.dll...
#18 1.549 Adding assembly reference to System.Security.AccessControl.dll...
#18 1.549 Adding assembly reference to System.Security.Principal.Windows.dll...
#18 1.549 Adding assembly reference to mscorlib.dll...
#18 1.549 Adding assembly reference to netstandard.dll...
#18 1.549 Adding assembly reference to System.IO.MemoryMappedFiles.dll...
#18 1.549 Adding assembly reference to System.IO.Pipes.dll...
#18 1.549 Adding assembly reference to System.Diagnostics.Process.dll...
#18 1.549 Adding assembly reference to System.Security.Cryptography.X509Certificates.dll...
#18 1.549 Adding assembly reference to System.Memory.dll...
#18 1.549 Adding assembly reference to System.ComponentModel.TypeConverter.dll...
#18 1.549 Adding assembly reference to System.ComponentModel.EventBasedAsync.dll...
#18 1.550 Adding assembly reference to System.ComponentModel.dll...
#18 1.550 Adding assembly reference to System.Console.dll...
#18 1.550 Adding assembly reference to System.Data.Common.dll...
#18 1.550 Adding assembly reference to System.Diagnostics.TraceSource.dll...
#18 1.550 Adding assembly reference to System.Diagnostics.Contracts.dll...
#18 1.550 Adding assembly reference to System.Diagnostics.TextWriterTraceListener.dll...
#18 1.550 Adding assembly reference to System.Diagnostics.FileVersionInfo.dll...
#18 1.550 Adding assembly reference to System.Diagnostics.StackTrace.dll...
#18 1.550 Adding assembly reference to System.Diagnostics.Tracing.dll...
#18 1.550 Adding assembly reference to System.Drawing.Primitives.dll...
#18 1.550 Adding assembly reference to System.IO.Compression.Brotli.dll...
#18 1.550 Adding assembly reference to System.IO.Compression.dll...
#18 1.550 Adding assembly reference to System.IO.Compression.ZipFile.dll...
#18 1.550 Adding assembly reference to System.IO.FileSystem.Watcher.dll...
#18 1.551 Adding assembly reference to System.IO.IsolatedStorage.dll...
#18 1.551 Adding assembly reference to System.Linq.Queryable.dll...
#18 1.551 Adding assembly reference to System.Linq.Parallel.dll...
#18 1.551 Adding assembly reference to System.Net.Requests.dll...
#18 1.551 Adding assembly reference to System.Net.Primitives.dll...
#18 1.551 Adding assembly reference to System.Net.HttpListener.dll...
#18 1.551 Adding assembly reference to System.Net.ServicePoint.dll...
#18 1.551 Adding assembly reference to System.Net.NameResolution.dll...
#18 1.551 Adding assembly reference to System.Net.WebClient.dll...
#18 1.551 Adding assembly reference to System.Net.Http.dll...
#18 1.551 Adding assembly reference to System.Net.WebHeaderCollection.dll...
#18 1.551 Adding assembly reference to System.Net.WebProxy.dll...
#18 1.551 Adding assembly reference to System.Net.Mail.dll...
#18 1.551 Adding assembly reference to System.Net.NetworkInformation.dll...
#18 1.551 Adding assembly reference to System.Net.Ping.dll...
#18 1.551 Adding assembly reference to System.Net.Security.dll...
#18 1.551 Adding assembly reference to System.Net.Sockets.dll...
#18 1.551 Adding assembly reference to System.Net.WebSockets.Client.dll...
#18 1.552 Adding assembly reference to System.Net.WebSockets.dll...
#18 1.552 Adding assembly reference to System.Runtime.Numerics.dll...
#18 1.552 Adding assembly reference to System.Numerics.Vectors.dll...
#18 1.552 Adding assembly reference to System.Reflection.DispatchProxy.dll...
#18 1.552 Adding assembly reference to System.Reflection.Emit.dll...
#18 1.552 Adding assembly reference to System.Resources.Writer.dll...
#18 1.552 Adding assembly reference to System.Runtime.CompilerServices.VisualC.dll...
#18 1.552 Adding assembly reference to System.Runtime.InteropServices.RuntimeInformation.dll...
#18 1.552 Adding assembly reference to System.Runtime.Serialization.Primitives.dll...
#18 1.552 Adding assembly reference to System.Runtime.Serialization.Xml.dll...
#18 1.552 Adding assembly reference to System.Runtime.Serialization.Json.dll...
#18 1.552 Adding assembly reference to System.Runtime.Serialization.Formatters.dll...
#18 1.552 Adding assembly reference to System.Security.Claims.dll...
#18 1.552 Adding assembly reference to System.Security.Cryptography.Algorithms.dll...
#18 1.553 Adding assembly reference to System.Security.Cryptography.Csp.dll...
#18 1.553 Adding assembly reference to System.Security.Cryptography.Encoding.dll...
#18 1.553 Adding assembly reference to System.Security.Cryptography.Primitives.dll...
#18 1.553 Adding assembly reference to System.Text.Encoding.Extensions.dll...
#18 1.553 Adding assembly reference to System.Threading.Overlapped.dll...
#18 1.553 Adding assembly reference to System.Threading.ThreadPool.dll...
#18 1.553 Adding assembly reference to System.Threading.Tasks.Parallel.dll...
#18 1.553 Adding assembly reference to System.Transactions.Local.dll...
#18 1.553 Adding assembly reference to System.Web.HttpUtility.dll...
#18 1.553 Adding assembly reference to System.Xml.ReaderWriter.dll...
#18 1.553 Adding assembly reference to System.Xml.XDocument.dll...
#18 1.553 Adding assembly reference to System.Xml.XmlSerializer.dll...
#18 1.553 Adding assembly reference to System.Xml.XPath.XDocument.dll...
#18 1.554 Adding assembly reference to System.Xml.XPath.dll...
#18 1.554 Adding assembly reference to System.AppContext.dll...
#18 1.554 Adding assembly reference to System.Buffers.dll...
#18 1.554 Adding assembly reference to System.Collections.Immutable.dll...
#18 1.554 Adding assembly reference to System.Runtime.CompilerServices.Unsafe.dll...
#18 1.554 Adding assembly reference to System.ComponentModel.Annotations.dll...
#18 1.554 Adding assembly reference to System.ComponentModel.DataAnnotations.dll...
#18 1.554 Adding assembly reference to System.Runtime.Loader.dll...
#18 1.554 Adding assembly reference to System.Configuration.dll...
#18 1.554 Adding assembly reference to System.Core.dll...
#18 1.554 Adding assembly reference to System.Private.Uri.dll...
#18 1.554 Adding assembly reference to System.Data.DataSetExtensions.dll...
#18 1.554 Adding assembly reference to System.Data.dll...
#18 1.554 Adding assembly reference to System.Diagnostics.Debug.dll...
#18 1.555 Adding assembly reference to System.Diagnostics.DiagnosticSource.dll...
#18 1.555 Adding assembly reference to System.Reflection.Metadata.dll...
#18 1.555 Adding assembly reference to System.Diagnostics.Tools.dll...
#18 1.555 Adding assembly reference to System.dll...
#18 1.555 Adding assembly reference to System.Drawing.dll...
#18 1.555 Adding assembly reference to System.Dynamic.Runtime.dll...
#18 1.555 Adding assembly reference to System.Formats.Asn1.dll...
#18 1.555 Adding assembly reference to System.Globalization.Calendars.dll...
#18 1.555 Adding assembly reference to System.Globalization.dll...
#18 1.555 Adding assembly reference to System.Globalization.Extensions.dll...
#18 1.555 Adding assembly reference to System.IO.Compression.FileSystem.dll...
#18 1.555 Adding assembly reference to System.IO.dll...
#18 1.556 Adding assembly reference to System.IO.FileSystem.AccessControl.dll...
#18 1.556 Adding assembly reference to System.IO.FileSystem.dll...
#18 1.556 Adding assembly reference to System.IO.FileSystem.Primitives.dll...
#18 1.556 Adding assembly reference to System.IO.Pipes.AccessControl.dll...
#18 1.556 Adding assembly reference to System.IO.UnmanagedMemoryStream.dll...
#18 1.556 Adding assembly reference to System.Net.dll...
#18 1.556 Adding assembly reference to System.Net.Quic.dll...
#18 1.556 Adding assembly reference to System.Threading.Channels.dll...
#18 1.556 Adding assembly reference to System.Net.Http.Json.dll...
#18 1.556 Adding assembly reference to System.Text.Json.dll...
#18 1.556 Adding assembly reference to System.Security.Cryptography.OpenSsl.dll...
#18 1.556 Adding assembly reference to System.Numerics.dll...
#18 1.556 Adding assembly reference to System.Reflection.dll...
#18 1.556 Adding assembly reference to System.Reflection.Extensions.dll...
#18 1.557 Adding assembly reference to System.Reflection.TypeExtensions.dll...
#18 1.557 Adding assembly reference to System.Resources.Reader.dll...
#18 1.557 Adding assembly reference to System.Resources.ResourceManager.dll...
#18 1.557 Adding assembly reference to System.Runtime.Extensions.dll...
#18 1.557 Adding assembly reference to System.Runtime.Handles.dll...
#18 1.557 Adding assembly reference to System.Runtime.Intrinsics.dll...
#18 1.557 Adding assembly reference to System.Runtime.Serialization.dll...
#18 1.557 Adding assembly reference to System.Private.DataContractSerialization.dll...
#18 1.557 Adding assembly reference to System.Security.Cryptography.Cng.dll...
#18 1.557 Adding assembly reference to System.Security.dll...
#18 1.557 Adding assembly reference to System.Security.Principal.dll...
#18 1.557 Adding assembly reference to System.Security.SecureString.dll...
#18 1.558 Adding assembly reference to System.ServiceModel.Web.dll...
#18 1.558 Adding assembly reference to System.ServiceProcess.dll...
#18 1.558 Adding assembly reference to System.Text.Encoding.CodePages.dll...
#18 1.558 Adding assembly reference to System.Text.Encoding.dll...
#18 1.558 Adding assembly reference to System.Text.Encodings.Web.dll...
#18 1.558 Adding assembly reference to System.Threading.Tasks.Dataflow.dll...
#18 1.558 Adding assembly reference to System.Threading.Tasks.dll...
#18 1.558 Adding assembly reference to System.Threading.Tasks.Extensions.dll...
#18 1.558 Adding assembly reference to System.Threading.Timer.dll...
#18 1.558 Adding assembly reference to System.Transactions.dll...
#18 1.558 Adding assembly reference to System.ValueTuple.dll...
#18 1.558 Adding assembly reference to System.Web.dll...
#18 1.558 Adding assembly reference to System.Windows.dll...
#18 1.559 Adding assembly reference to System.Xml.dll...
#18 1.559 Adding assembly reference to System.Xml.Linq.dll...
#18 1.559 Adding assembly reference to System.Private.Xml.dll...
#18 1.559 Adding assembly reference to System.Xml.Serialization.dll...
#18 1.559 Adding assembly reference to System.Private.Xml.Linq.dll...
#18 1.559 Adding assembly reference to System.Xml.XmlDocument.dll...
#18 1.559 Adding assembly reference to WindowsBase.dll...
#18 1.559 Adding assembly reference to Cake.Core.dll...
#18 1.559 Adding assembly reference to Cake.Common.dll...
#18 1.559 Adding assembly reference to Spectre.Console.dll...
#18 1.560 Importing namespace Cake.Common...
#18 1.560 Importing namespace Cake.Common.Build...
#18 1.560 Importing namespace Cake.Common.Build.AppVeyor...
#18 1.560 Importing namespace Cake.Common.Build.AppVeyor.Data...
#18 1.560 Importing namespace Cake.Common.Build.AzurePipelines...
#18 1.560 Importing namespace Cake.Common.Build.AzurePipelines.Data...
#18 1.560 Importing namespace Cake.Common.Build.Bamboo...
#18 1.560 Importing namespace Cake.Common.Build.Bamboo.Data...
#18 1.561 Importing namespace Cake.Common.Build.BitbucketPipelines...
#18 1.561 Importing namespace Cake.Common.Build.BitbucketPipelines.Data...
#18 1.561 Importing namespace Cake.Common.Build.Bitrise...
#18 1.561 Importing namespace Cake.Common.Build.Bitrise.Data...
#18 1.561 Importing namespace Cake.Common.Build.ContinuaCI...
#18 1.561 Importing namespace Cake.Common.Build.ContinuaCI.Data...
#18 1.561 Importing namespace Cake.Common.Build.GitHubActions...
#18 1.561 Importing namespace Cake.Common.Build.GitHubActions.Data...
#18 1.561 Importing namespace Cake.Common.Build.GitLabCI...
#18 1.561 Importing namespace Cake.Common.Build.GitLabCI.Data...
#18 1.561 Importing namespace Cake.Common.Build.GoCD...
#18 1.561 Importing namespace Cake.Common.Build.GoCD.Data...
#18 1.561 Importing namespace Cake.Common.Build.Jenkins...
#18 1.561 Importing namespace Cake.Common.Build.Jenkins.Data...
#18 1.561 Importing namespace Cake.Common.Build.MyGet...
#18 1.561 Importing namespace Cake.Common.Build.TeamCity...
#18 1.561 Importing namespace Cake.Common.Build.TravisCI...
#18 1.561 Importing namespace Cake.Common.Build.TravisCI.Data...
#18 1.561 Importing namespace Cake.Common.Diagnostics...
#18 1.562 Importing namespace Cake.Common.IO...
#18 1.562 Importing namespace Cake.Common.IO.Paths...
#18 1.562 Importing namespace Cake.Common.Net...
#18 1.562 Importing namespace Cake.Common.Security...
#18 1.562 Importing namespace Cake.Common.Solution...
#18 1.562 Importing namespace Cake.Common.Solution.Project...
#18 1.562 Importing namespace Cake.Common.Solution.Project.Properties...
#18 1.562 Importing namespace Cake.Common.Solution.Project.XmlDoc...
#18 1.562 Importing namespace Cake.Common.Text...
#18 1.562 Importing namespace Cake.Common.Tools.Cake...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.ApiKey...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Config...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Download...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Export...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Features...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Install...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.New...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Pack...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Pin...
#18 1.562 Importing namespace Cake.Common.Tools.Chocolatey.Push...
#18 1.563 Importing namespace Cake.Common.Tools.Chocolatey.Sources...
#18 1.563 Importing namespace Cake.Common.Tools.Chocolatey.Uninstall...
#18 1.563 Importing namespace Cake.Common.Tools.Chocolatey.Upgrade...
#18 1.563 Importing namespace Cake.Common.Tools.Command...
#18 1.563 Importing namespace Cake.Common.Tools.DotCover...
#18 1.563 Importing namespace Cake.Common.Tools.DotCover.Analyse...
#18 1.563 Importing namespace Cake.Common.Tools.DotCover.Cover...
#18 1.563 Importing namespace Cake.Common.Tools.DotCover.Merge...
#18 1.563 Importing namespace Cake.Common.Tools.DotCover.Report...
#18 1.563 Importing namespace Cake.Common.Tools.DotNet...
#18 1.563 Importing namespace Cake.Common.Tools.DotNet.Build...
#18 1.563 Importing namespace Cake.Common.Tools.DotNet.BuildServer...
#18 1.563 Importing namespace Cake.Common.Tools.DotNet.Clean...
#18 1.563 Importing namespace Cake.Common.Tools.DotNet.Execute...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Format...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.MSBuild...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.NuGet.Delete...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.NuGet.Push...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.NuGet.Source...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Pack...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Publish...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Restore...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Run...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.SDKCheck...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Test...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Tool...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.VSTest...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Workload.Install...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Workload.List...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Workload.Repair...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Workload.Restore...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Workload.Search...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Workload.Uninstall...
#18 1.564 Importing namespace Cake.Common.Tools.DotNet.Workload.Update...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Build...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.BuildServer...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Clean...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Execute...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.MSBuild...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Delete...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Push...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.NuGet.Source...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Pack...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Publish...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Restore...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Run...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Test...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.Tool...
#18 1.564 Importing namespace Cake.Common.Tools.DotNetCore.VSTest...
#18 1.564 Importing namespace Cake.Common.Tools.DupFinder...
#18 1.564 Importing namespace Cake.Common.Tools.Fixie...
#18 1.564 Importing namespace Cake.Common.Tools.GitLink...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.AddAssets...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.Close...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.Create...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.Discard...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.Export...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.Label...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.Open...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseManager.Publish...
#18 1.564 Importing namespace Cake.Common.Tools.GitReleaseNotes...
#18 1.564 Importing namespace Cake.Common.Tools.GitVersion...
#18 1.564 Importing namespace Cake.Common.Tools.ILMerge...
#18 1.564 Importing namespace Cake.Common.Tools.ILRepack...
#18 1.564 Importing namespace Cake.Common.Tools.InnoSetup...
#18 1.564 Importing namespace Cake.Common.Tools.InspectCode...
#18 1.564 Importing namespace Cake.Common.Tools.MSBuild...
#18 1.564 Importing namespace Cake.Common.Tools.MSpec...
#18 1.564 Importing namespace Cake.Common.Tools.MSTest...
#18 1.564 Importing namespace Cake.Common.Tools.NSIS...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Add...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Delete...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Init...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Install...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.List...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Pack...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Push...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Restore...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.SetApiKey...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.SetProxy...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Sources...
#18 1.564 Importing namespace Cake.Common.Tools.NuGet.Update...
#18 1.564 Importing namespace Cake.Common.Tools.NUnit...
#18 1.564 Importing namespace Cake.Common.Tools.OctopusDeploy...
#18 1.564 Importing namespace Cake.Common.Tools.OpenCover...
#18 1.564 Importing namespace Cake.Common.Tools.ReportGenerator...
#18 1.564 Importing namespace Cake.Common.Tools.ReportUnit...
#18 1.564 Importing namespace Cake.Common.Tools.Roundhouse...
#18 1.564 Importing namespace Cake.Common.Tools.SignTool...
#18 1.564 Importing namespace Cake.Common.Tools.SpecFlow...
#18 1.565 Importing namespace Cake.Common.Tools.SpecFlow.StepDefinitionReport...
#18 1.565 Importing namespace Cake.Common.Tools.SpecFlow.TestExecutionReport...
#18 1.565 Importing namespace Cake.Common.Tools.TextTransform...
#18 1.565 Importing namespace Cake.Common.Tools.VSTest...
#18 1.565 Importing namespace Cake.Common.Tools.VSWhere...
#18 1.565 Importing namespace Cake.Common.Tools.VSWhere.All...
#18 1.565 Importing namespace Cake.Common.Tools.VSWhere.Latest...
#18 1.565 Importing namespace Cake.Common.Tools.VSWhere.Legacy...
#18 1.565 Importing namespace Cake.Common.Tools.VSWhere.Product...
#18 1.565 Importing namespace Cake.Common.Tools.WiX...
#18 1.565 Importing namespace Cake.Common.Tools.WiX.Heat...
#18 1.565 Importing namespace Cake.Common.Tools.XBuild...
#18 1.565 Importing namespace Cake.Common.Tools.XUnit...
#18 1.565 Importing namespace Cake.Common.Xml...
#18 1.565 Importing namespace Cake.Core...
#18 1.565 Importing namespace Cake.Core.Diagnostics...
#18 1.565 Importing namespace Cake.Core.IO...
#18 1.565 Importing namespace Cake.Core.Scripting...
#18 1.565 Importing namespace Cake.Core.Tooling...
#18 1.565 Importing namespace System...
#18 1.565 Importing namespace System.Collections.Generic...
#18 1.565 Importing namespace System.IO...
#18 1.565 Importing namespace System.Linq...
#18 1.565 Importing namespace System.Text...
#18 1.566 Importing namespace System.Threading.Tasks...
#18 1.616 Compiling build script...
#18 4.250 Executing custom task setup action (CheckFormat)...
#18 4.257
#18 4.257 ========================================
#18 4.257 CheckFormat
#18 4.257 ========================================
#18 4.257 Executing task: CheckFormat
#18 4.260 Finished executing task: CheckFormat
#18 4.260 Executing custom task teardown action (CheckFormat)...
#18 4.261 Completed in 00:00:00.0113364
#18 4.261 Executing custom task setup action (SetVersion)...
#18 4.261
#18 4.261 ========================================
#18 4.261 SetVersion
#18 4.261 ========================================
#18 4.261 Executing task: SetVersion
#18 4.264 Finished executing task: SetVersion
#18 4.264 Executing custom task teardown action (SetVersion)...
#18 4.264 Completed in 00:00:00.0032694
#18 4.265 Executing custom task setup action (Build)...
#18 4.265
#18 4.265 ========================================
#18 4.265 Build
#18 4.265 ========================================
#18 4.265 Executing task: Build
#18 4.290 Resolved tool to path /usr/bin/dotnet
#18 4.293 Executing: /usr/bin/dotnet build "Test.sln" --configuration Release
#18 4.396 MSBuild version 17.3.2+561848881 for .NET
#18 5.230   Determining projects to restore...
****************
#18 34.79
#18 34.79 Build succeeded.
#18 34.79
#18 34.79 Time Elapsed 00:00:30.31
#18 34.86 Finished executing task: Build
#18 34.86 Executing custom task teardown action (Build)...
#18 34.86 Completed in 00:00:30.5925739
#18 34.86 Executing custom task setup action (Tests)...
#18 34.86
#18 34.86 ========================================
#18 34.86 Tests
#18 34.86 ========================================
#18 34.86 Executing task: Tests
#18 34.89 Resolved tool to path /usr/bin/dotnet
#18 34.89 Resolved tool to path /usr/bin/mono
#18 34.89 /src/tools/JetBrains.dotCover.GlobalTool.2022.3.0/tools/netcoreapp3.1/any/dotCover.exe is a .NET Framework executable, will try execute using Mono.
#18 34.89 Executing: /usr/bin/mono "/src/tools/JetBrains.dotCover.GlobalTool.2022.3.0/tools/netcoreapp3.1/any/dotCover.exe" Cover /TargetExecutable="/usr/bin/dotnet" /TargetArguments="test \"./Test.sln\" --configuration Release -
-no-build" /Output="/src/Out/Coverage/result.dcvr"
#18 35.14 JetBrains dotCover Console Runner 2022.3. Build 777.0.20221205.174336
#18 35.14 Copyright (c) 2009–2022 JetBrains s.r.o. All rights reserved.
#18 35.20 [JetBrains dotCover] Configuration file '/TargetExecutable=/usr/bin/dotnet' not found.
#18 35.22 An error occurred when executing task 'Tests'.
#18 35.22 Executing custom task teardown action (Tests)...
#18 35.22 Completed in 00:00:00.3649610
#18 35.23 Error: Cake.Core.CakeException: DotCover: Process returned an error (exit code 254).
#18 35.23    at Cake.Core.Tooling.Tool`1.ProcessExitCode(Int32 exitCode) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 118
#18 35.23    at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action`1 postAction) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 103
#18 35.23    at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 60
#18 35.23    at Cake.Common.Tools.DotCover.Cover.DotCoverCoverer.Cover(ICakeContext context, Action`1 action, FilePath outputPath, DotCoverCoverSettings settings) in C:\projects\cake\src\Cake.Common\Tools\DotCover\Cover\DotCoverCove
rer.cs:line 65
#18 35.23    at Cake.Common.Tools.DotCover.DotCoverAliases.DotCoverCover(ICakeContext context, Action`1 action, FilePath outputFile, DotCoverCoverSettings settings) in C:\projects\cake\src\Cake.Common\Tools\DotCover\DotCoverAliases.
cs:line 127
#18 35.23    at Submission#0.DotCoverCover(Action`1 action, FilePath outputFile, DotCoverCoverSettings settings)
#18 35.23    at Submission#0.<<Initialize>>b__0_3()
#18 35.23    at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass31_0.<Does>b__0(ICakeContext _) in C:\projects\cake\src\Cake.Core\CakeTaskBuilder.Execution.cs:line 26
#18 35.23    at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass34_0.<Does>b__0(ICakeContext context) in C:\projects\cake\src\Cake.Core\CakeTaskBuilder.Execution.cs:line 81
#18 35.23    at Cake.Core.CakeTask.Execute(ICakeContext context) in C:\projects\cake\src\Cake.Core\CakeTask.cs:line 119
#18 35.23    at Cake.Core.DefaultExecutionStrategy.ExecuteAsync(CakeTask task, ICakeContext context) in C:\projects\cake\src\Cake.Core\DefaultExecutionStrategy.cs:line 72
#18 35.23    at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 322
#18 35.23    at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 345
#18 35.23    at Cake.Core.CakeEngine.ExecuteTaskAsync(ICakeContext context, IExecutionStrategy strategy, Stopwatch stopWatch, CakeTask task, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 357
#18 35.23    at Cake.Core.CakeEngine.RunTask(ICakeContext context, IExecutionStrategy strategy, CakeTask task, String target, Stopwatch stopWatch, CakeReport report) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 258
#18 35.23    at Cake.Core.CakeEngine.RunTargetAsync(ICakeContext context, IExecutionStrategy strategy, ExecutionSettings settings) in C:\projects\cake\src\Cake.Core\CakeEngine.cs:line 221
#18 35.23    at Cake.Cli.BuildScriptHost`1.RunTargetAsync(String target) in C:\projects\cake\src\Cake.Cli\Hosts\BuildScriptHost.cs:line 73
#18 35.23    at Cake.Core.Scripting.ScriptHost.RunTarget(String target) in C:\projects\cake\src\Cake.Core\Scripting\ScriptHost.cs:line 105
#18 35.23    at Submission#0.<<Initialize>>d__0.MoveNext()
#18 35.23 --- End of stack trace from previous location ---
#18 35.23    at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationTo
ken cancellationToken)
#18 35.23    at Microsoft.CodeAnalysis.Scripting.Script`1.RunSubmissionsAsync(ScriptExecutionState executionState, ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, Func`2 catchExceptionOpt, CancellationToken cancellation
Token)
#18 35.23    at Cake.Infrastructure.Scripting.RoslynScriptSession.Execute(Script script) in C:\projects\cake\src\Cake\Infrastructure\Scripting\RoslynScriptSession.cs:line 206
#18 35.23    at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath) in C:\projects\cake\src\Cake.Core\Scripting\ScriptRunner.cs:line 172
#18 35.23    at Cake.Features.Building.BuildFeature.RunCore(IRemainingArguments arguments, BuildFeatureSettings settings) in C:\projects\cake\src\Cake\Features\Building\BuildFeature.cs:line 99
#18 35.23    at Cake.Features.Building.BuildFeature.Run(IRemainingArguments arguments, BuildFeatureSettings settings) in C:\projects\cake\src\Cake\Features\Building\BuildFeature.cs:line 49
#18 35.23    at Cake.Commands.DefaultCommand.Execute(CommandContext context, DefaultCommandSettings settings) in C:\projects\cake\src\Cake\Commands\DefaultCommand.cs:line 73

@Sebazzz
Copy link

Sebazzz commented Feb 5, 2024

This should be fairly easy to fix:

  • dotCover on Linux only supports Unix-style arguments
  • dotCover on Windows supports both Unix-style and Windows style arguments

The fix would be to always emit Unit-style arguments.

@Vikram-Raghu
Copy link

I've tried changing the paths to Unix-style in the variables stored in cake file, yet the issue is not resolved. Can you explain what approach is "dotCover on Linux only supports Unix-style arguments", you are referring here.

Is DotCover supports Linux distribution. From the Jetbrains official site for DotCover download under system requirements I can only see Windows machine. Is this also same for CLI, if that so it wouldn't support in Linux distributions right ?

I've also searched for any alternatives to dotCover to run in linux env, but I couldn't find any. Is there any alternative present to run in Linux OS.

@Sebazzz
Copy link

Sebazzz commented Mar 15, 2024

I'm not changing to change the paths, I'm saying that Cake should pass Unix-style arguments, so prefixed by -- instead of / so the command line looks like:

/usr/bin/mono "/src/tools/JetBrains.dotCover.GlobalTool.2022.3.0/tools/netcoreapp3.1/any/dotCover.exe" Cover --TargetExecutable="/usr/bin/dotnet" --TargetArguments="test \"./Test.sln\" --configuration Release - -no-build" /Output="/src/Out/Coverage/result.dcvr"

instead of:

/usr/bin/mono "/src/tools/JetBrains.dotCover.GlobalTool.2022.3.0/tools/netcoreapp3.1/any/dotCover.exe" Cover /TargetExecutable="/usr/bin/dotnet" /TargetArguments="test \"./Test.sln\" --configuration Release - -no-build" /Output="/src/Out/Coverage/result.dcvr"

The -- prefix works on all platforms, the / prefix only on Windows.

@Vikram-Raghu
Copy link

Vikram-Raghu commented Mar 20, 2024

@Sebazzz Got it, I understand your approach. Before dive into deeper, let me update you I'm kinda new in cake build working, I'm constantly learning though.

What I guess or have knowledge so far:

Task("Tests")
    .IsDependentOn("Build")
    .Does(() => 
{
    DotCoverCover(tool => {
      tool.DotNetTest(pathToSolution, new DotNetTestSettings
        {
            Configuration = configuration,
            NoBuild = true,
        });
      },
      new FilePath(pathToCoverage),
      new DotCoverCoverSettings()); 
});

This code part in cake script executes like this:
/usr/bin/mono "/src/tools/JetBrains.dotCover.GlobalTool.2022.3.0/tools/netcoreapp3.1/any/dotCover.exe" Cover /TargetExecutable="/usr/bin/dotnet" /TargetArguments="test \"./Test.sln\" --configuration Release - -no-build" /Output="/src/Out/Coverage/result.dcvr"

Cake build translates the code-part to this CLI argument based and then executes, right ?
(Kindly do update me if I'm wrong)
So in windows machine it worked fine, as the CLI arguments were supported. But same is not in the case of Linux.

What I would like to have:
If dotCover translate to that command , could you update me how to overcome and use (the dotcover in cake) your solution in cake itself ?

Can we able to configure this dotCoverCover, translate the execution according to linux ? Or Is there any approach in achieving the Goal.

@Sebazzz
Copy link

Sebazzz commented Mar 20, 2024

If dotCover translate to that command , could you update me how to overcome and use (the dotcover in cake) your solution in cake itself ?

Sorry, you can't (or at least, not really). This needs to be fixed in Cake.

As a workaround you can do this.

dotcover-xplatform.cake

// Workaround for: https://github.com/cake-build/cake/issues/4096

internal sealed class DotCoverProcessRunner : IProcessRunner {
    public FilePath FilePath { get; set; }

    public ProcessSettings ProcessSettings { get; set; }

    private sealed class InterceptedProcess : IProcess
    {
        public void Dispose()
        {
        }

        public void WaitForExit()
        {
        }

        public bool WaitForExit(int milliseconds)
        {
            return true;
        }

        public int GetExitCode()
        {
            return 0;
        }

        public IEnumerable<string> GetStandardError()
        {
            return Enumerable.Empty<string>();
        }

        public IEnumerable<string> GetStandardOutput()
        {
            return Enumerable.Empty<string>();
        }

        public void Kill()
        {
        }
    }

    public IProcess Start(FilePath filePath, ProcessSettings settings)
    {
        FilePath = filePath;
        ProcessSettings = settings;
        return new InterceptedProcess();
    }
}

internal sealed class DotCoverContext : CakeContextAdapter {
    private readonly DotCoverProcessRunner _runner;

    public override ICakeLog Log { get; }

    public override IProcessRunner ProcessRunner => _runner;

    public FilePath FilePath => _runner.FilePath;

    public ProcessSettings Settings => _runner.ProcessSettings;

    public DotCoverContext(ICakeContext context) : base(context)
    {
        Log = new NullLog();
        _runner = new DotCoverProcessRunner();
    }
}

void RunDotCoverWithFixedArgs(ICakeContext context, Action<ICakeContext> callback) {
  	var interceptor = new DotCoverContext(context);
    callback.Invoke(interceptor);

    Information("Original args: {0}", interceptor.Settings.Arguments.Render());

    FilePath toolPath = context.Tools.Resolve("dotnet-dotCover.exe") ?? context.Tools.Resolve("dotnet-dotCover");

    string toolArgs = interceptor.Settings.Arguments.Render();
    toolArgs = System.Text.RegularExpressions.Regex.Replace(toolArgs, @"\s/", " --");

    Information("Replaced args: {0}", toolArgs);

    var settings = interceptor.Settings;
    settings.Arguments =  ProcessArgumentBuilder.FromString(toolArgs);

    context.StartProcess(toolPath, settings);
}

And in your build.cake:

#load "dotcover-xplatform.cake"

RunDotCoverWithFixedArgs(context, ctx => ctx.DotCoverCover(
	tool => tool.DotNetTest(pathFilter, testSettings), 
	codeCoverageResultsFile,
	dotCoverSettings));

This is a huge hack of course, but it works as a workaround until this bug is fixed.

@hotchkj
Copy link

hotchkj commented Aug 2, 2024

One of the confusions I have with Cake DotCover, related to this issue, is it's not clear to me how to tell Cake to use all the different command line tools JetBrains now have for running DotCover. For example, there's at a minimum, either running dotnet dotcover or dotcover.exe. Which are supported, which should be supported, do they have the same command lines?

I certainly agree that the Unix-style arguments should be used uniformly, I guess I'm curious whether this issue is highlighting a wider mismatch in expectations (i.e. it's only ever been designed with Windows DotCover in mind). I don't see how the current Cake Tool design really can cope with supporting both executables and dotnet tools, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants