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

dotnet test on a multi-target projects logs only the last target #1603

Closed
SidShetye opened this issue May 17, 2018 · 7 comments
Closed

dotnet test on a multi-target projects logs only the last target #1603

SidShetye opened this issue May 17, 2018 · 7 comments
Assignees
Labels

Comments

@SidShetye
Copy link

Description

dotnet test "--logger:trx;LogFileName=results.trx" on a multi-target project (e.g. <TargetFrameworks>netcoreapp2.0;net45</TargetFrameworks> in the .csproj) causes the logger to only log the last target. Possibly because the previous targets' logger output file is overwritten by subsequent targets. FYI, this also happens with the nunit logger extension.

Steps to reproduce

dotnet test "--logger:trx;LogFileName=results.trx"

Expected behavior

Either generate as many .trx files as there are targets (e.g. results.net45.trx, results.netcoreapp2.0.trx) OR assemble the results into the single .trx (if file format allows for it). Perhaps the user can pick a behavior.

Actual behavior

Only a single results.trx is created and it's contents only hold the results of the last target framework in the .csproj.

Environment

In case it matters, our multi-target project uses nunit 3.9 with the the following inside it's .csproj

<PackageReference Include="NUnit" Version="3.9.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="NunitXml.TestLogger" Version="1.1.0" />

that last bit is so we can also do dotnet test --logger:"nunit;LogFilePath=results.xml" since our CI can use either trx or nunit xml - but that also fails similarly.

OS: Windows 10 v1803
.NET SDK: dotnet --version shows 2.1.0
Not sure if/how dotnet test wraps over vstest but this is vstest.console.exe

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow>vstest.console.exe
Microsoft (R) Test Execution Command Line Tool Version 15.7.1
Copyright (c) Microsoft Corporation.  All rights reserved.
@SidShetye
Copy link
Author

SidShetye commented May 24, 2018

Any news? Seems awfully similar to this #243. Regression?

@SidShetye
Copy link
Author

Note that running just dotnet test "--logger:trx" causes it to generate unique filenames in a pattern like <username>_<machine>_YYYY-MM-DD_HH_MM_SS.trx but that's distinct from the reported problem.

@singhsarab singhsarab added the bug label May 28, 2018
@singhsarab
Copy link
Contributor

@SidShetye Thanks for the feedback. This does not seem to be a regression.

@pvlakshm What do you think the spec should be for this one?

@abhishkk
Copy link
Contributor

Merged: #1877

@StephenCleary
Copy link

Please reopen, since the fix for this has been reverted.

@vagisha-nidhi
Copy link
Contributor

vagisha-nidhi commented Aug 14, 2019

@SidShetye @StephenCleary We are revisiting the scenario and would appreciate your inputs on the spec. Here is the RFC I have posted. Let me know if there are any concerns.

@singhsarab
Copy link
Contributor

The fix for this has been released. https://www.nuget.org/packages/Microsoft.TestPlatform/16.3.0-preview-20190828-03

We advice folks to use LogFilePrefix argument instead.

skwasjer added a commit to skwasjer/IbanNet that referenced this issue Oct 15, 2019
skwasjer added a commit to skwasjer/IbanNet that referenced this issue Oct 25, 2019
Squashed commit of the following:

commit 9332f66
Merge: e327d13 9664ec0
Author: skwas <skwas@skwas.net>
Date:   Fri Oct 25 19:41:55 2019 +0200

    Merge branch 'master' into develop

commit e327d13
Author: skwas <skwas@skwas.net>
Date:   Fri Oct 25 19:34:45 2019 +0200

    Build with VS2019 image

commit ded1ddc
Author: skwas <skwas@skwas.net>
Date:   Fri Oct 25 19:29:58 2019 +0200

    Insert final newline

commit 99714e3
Author: skwas <skwas@skwas.net>
Date:   Fri Oct 25 19:14:50 2019 +0200

    Move localizable text to RESX

commit 4daec94
Author: skwas <skwas@skwas.net>
Date:   Fri Oct 25 18:57:10 2019 +0200

    Reorder target frameworks and rerun custom tool. This workaround ensures GetTypeInfo() is emitted.

    dotnet/project-system#1519

commit 5ee8134
Author: skwas <skwas@skwas.net>
Date:   Fri Oct 25 18:52:23 2019 +0200

    Move localizable text to RESX

commit 050ece6
Author: skwas <skwas@skwas.net>
Date:   Fri Oct 25 18:44:09 2019 +0200

    Update Changelog

commit 6cd686b
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 05:58:49 2019 +0200

    Use .snupkg and SourceLink

commit 2bae078
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 05:57:30 2019 +0200

    Add settings for props and targets files

commit 9664ec0
Merge: e6bee51 aa01d3f
Author: skwasjer <skwas@skwas.net>
Date:   Wed Oct 16 03:30:58 2019 +0200

    Merge pull request #10 from skwasjer/develop

    Add test coverage

commit aa01d3f
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 01:36:20 2019 +0200

    Fix upload script not finding test reports

commit 204017d
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 01:18:16 2019 +0200

    Fix: upload test report per target framework

    microsoft/vstest#1603

commit 1b25c1a
Author: skwas <skwas@skwas.net>
Date:   Sat Aug 10 00:56:30 2019 +0200

    Fix whitespace

commit 3c2bc0d
Author: skwas <skwas@skwas.net>
Date:   Sat Aug 10 00:56:13 2019 +0200

    Add test case that asserts correct verification of case (in)sensitive IBAN's

commit 9f71aca
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 00:46:34 2019 +0200

    fix: internal IBAN value can never be null. Add some extra coverage for equality checks.

commit 884119e
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 00:20:28 2019 +0200

    Add coverage

commit 51e99ba
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 00:10:30 2019 +0200

    Partial revert, the custom upload of test reports was needed because NUnit reports are not supported by AppVeyor.

    This partially reverts commit 099472f.

commit 3d6ab4b
Author: skwas <skwas@skwas.net>
Date:   Wed Oct 16 00:03:29 2019 +0200

    Add coverage for extensions

commit 3243a77
Author: skwas <skwas@skwas.net>
Date:   Tue Oct 15 23:32:00 2019 +0200

    Moved extension specific to get country code to validator since it's poluting string class with this extension method.

commit e6bee51
Merge: 046132a a3bf4fb
Author: skwasjer <skwas@skwas.net>
Date:   Tue Oct 15 23:21:44 2019 +0200

    Merge pull request #9 from skwasjer/develop

    CI/Coverage improvements

commit a3bf4fb
Merge: 92a4e88 046132a
Author: skwasjer <skwas@skwas.net>
Date:   Tue Oct 15 23:18:16 2019 +0200

    Merge branch 'master' into develop

commit 92a4e88
Author: skwas <skwas@skwas.net>
Date:   Tue Oct 15 23:00:10 2019 +0200

    fix: fail build when test fails during coverage
    fix: exclude generated/excluded code

commit 099472f
Author: skwas <skwas@skwas.net>
Date:   Tue Oct 15 22:49:17 2019 +0200

    Move DebugType=full to cmdline arg, so we can compile Release with portable PDB (to support SourceLink)

commit 8189ae1
Author: skwas <skwas@skwas.net>
Date:   Tue Oct 15 20:48:24 2019 +0200

    Bump test dependencies

commit 046132a
Merge: 6e07f35 9ba8014
Author: skwasjer <skwas@skwas.net>
Date:   Thu Jul 25 03:38:07 2019 +0200

    Merge pull request #5 from skwasjer/develop

    v3.1.1 - Maintenance release

commit 9ba8014
Author: skwas <skwas@skwas.net>
Date:   Thu Jul 25 01:21:15 2019 +0200

    Fix unit test reports not found
    microsoft/vstest#1951

commit 20ed577
Author: skwas <skwas@skwas.net>
Date:   Thu Jul 25 01:13:15 2019 +0200

    fix: use correct build hook

commit b9914c4
Author: skwas <skwas@skwas.net>
Date:   Thu Jul 25 01:04:16 2019 +0200

    fix: test-results.xml files not found due to invalid arg

commit dc89c1f
Author: skwas <skwas@skwas.net>
Date:   Thu Jul 25 00:53:45 2019 +0200

    fix build failure

commit 323af41
Author: skwas <skwas@skwas.net>
Date:   Thu Jul 25 00:49:20 2019 +0200

    fix: custom codecov script does not generate and upload unit test results to AppVeyor

commit 5dec462
Author: skwas <skwas@skwas.net>
Date:   Wed Jul 24 23:57:40 2019 +0200

    Update Changelog.md

commit 8593bae
Author: skwas <skwas@skwas.net>
Date:   Wed Jul 24 23:51:36 2019 +0200

    Revert breaking change, expose dictionary via internal interface. Breaking change will be postponed until v4.

commit 5364406
Author: skwas <skwas@skwas.net>
Date:   Wed Jul 24 23:34:07 2019 +0200

    Ensure supported countries cannot be modified directly.

commit b5b5147
Author: skwas <skwas@skwas.net>
Date:   Wed Jul 24 23:23:54 2019 +0200

    Made internal (so it won't get used yet) until decided what to do with it.

commit e6ea2b9
Author: skwas <skwas@skwas.net>
Date:   Wed Jul 24 23:15:15 2019 +0200

    Enable cache for choco packages, and add full debug symbols for coverage

commit f33dd15
Author: skwas <skwas@skwas.net>
Date:   Wed Jul 24 23:05:04 2019 +0200

    Enable codecov

commit f619f6e
Merge: 970850e 6e07f35
Author: skwas <skwas@skwas.net>
Date:   Wed Jul 24 22:47:54 2019 +0200

    Merge branch 'master' into develop

commit 970850e
Author: skwas <skwas@skwas.net>
Date:   Thu May 23 22:36:02 2019 +0200

    Field is not supported.

commit ddc095e
Author: skwas <skwas@skwas.net>
Date:   Thu May 23 20:33:54 2019 +0200

    Move getting country code from string to internal extension.

commit 4d52172
Author: skwas <skwas@skwas.net>
Date:   Thu May 23 20:17:21 2019 +0200

    Update Changelog.md

commit 397a50f
Author: skwas <skwas@skwas.net>
Date:   Thu May 23 20:16:12 2019 +0200

    (breaking) Expose supported countries through new interface.
    (breaking) Change type of SupportedCountries to dictionary

commit 7f532af
Author: skwas <skwas@skwas.net>
Date:   Sun May 12 03:40:47 2019 +0200

    Allow access to some properties via debugger

commit 4f8e24b
Author: skwas <skwas@skwas.net>
Date:   Sat May 11 02:33:34 2019 +0200

    [skip ci] Build/test shields only report for master branch

commit ae03d21
Author: skwas <skwas@skwas.net>
Date:   Sat May 11 02:24:55 2019 +0200

    Always use latest version of IbanNet for example app

# Conflicts - resolved using changes to be integrated:
#	Changelog.md
#	appveyor.yml
#	ci/upload-testresults.ps1
#	codecov.yml
#	src/IbanNet.DataAnnotations/IbanNet.DataAnnotations.csproj
#	src/IbanNet.FluentValidation/IbanNet.FluentValidation.csproj
#	src/IbanNet/IbanNet.csproj
#	src/IbanNet/IbanValidator.cs
#	test/IbanNet.Tests/IbanValidatorTests.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants