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

Can't specify bitness when running dotnet test with nunit #1296

Closed
livarcocc opened this issue Nov 14, 2017 · 8 comments · Fixed by #3100
Closed

Can't specify bitness when running dotnet test with nunit #1296

livarcocc opened this issue Nov 14, 2017 · 8 comments · Fixed by #3100

Comments

@livarcocc
Copy link

From @damageboy on September 17, 2017 12:47

Steps to reproduce

Run dotnet test on a assembly with nunit:

dotnet test -- TargetPlatform=x64

Expected behavior

Be able to specify bitness (x64 / x86)

Actual behavior

Always runs on x86 in Windows by default

Environment data

dotnet --info output:

C:\projects\junk.git\tests\Junk.Tests>dotnet --info
.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

Copied from original issue: dotnet/cli#7673

@livarcocc
Copy link
Author

From @dasMulli on September 17, 2017 15:27

When you type where dotnet in the console, which path to dotnet.exe do you get? If you use the 32bit version in Program Files (x86), then you can't run 64 bit tests and vice versa.

@livarcocc
Copy link
Author

There is no --TargetPlatform option for dotnet test. Am I missing something? Did you mean /p:TargetPlatform=x64?

@livarcocc
Copy link
Author

From @wli3 on September 18, 2017 17:52

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace testvstest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            Assert.AreEqual("X86", System.Runtime.InteropServices.RuntimeInformation.OSArchitecture.ToString());
        }
    }
}

is the count as a repo of this issue?

image

@livarcocc
Copy link
Author

From @damageboy on September 19, 2017 13:50

I'm not sure I'm understanding this whole thing properly, but I guess the real question is: Are there common configuration switches / parameters shared by all unit test adapters in the dotnet-cli world?

Or is this something that has to get dealt with by every adapter separately?

The vstest documentation seems to specifically specify that the way to do this is:

dotnet test -s test.runsettings -- RunConfiguration.Platform=x64

As I mentioned before, the real question remains if dotnet-cli has a standard way of doing this, or is this a per-adapter issue...

@livarcocc
Copy link
Author

From @wli3 on September 19, 2017 20:9

dotnet cli does not have a standard way today. Things after -- is pass-through to vstest.

@livarcocc
Copy link
Author

Moving this to the vstest repo, where they can answer your questions better than we can.

@smadala
Copy link
Contributor

smadala commented Nov 15, 2017

Similar to #1128.

As I mentioned before, the real question remains if dotnet-cli has a standard way of doing this, or is this a per-adapter issue...

dotnet test -- RunConfiguration.TargetPlatform=x64 (Created PR for doc update) is common way to specify the platform for all adapters. As specified in #1128 (comment) For .NET core tests there is no guarantee from vstest to run tests in x64/x86 dotnet. It depends on $env:PATH.

@pvlakshm
Copy link
Contributor

Please see #1128 comment. I believe you will need to set up a direct path to the relevant version of dotnet.exe.

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

Successfully merging a pull request may close this issue.

3 participants