Visual Studio를 설치하지 않고 mstest.exe를 사용할 수 있습니까?
mstest.exe를 사용하여 빌드 서버에서 단위 테스트를 실행하고 싶지만 빌드 서버에 Visual Studio를 설치하고 싶지 않습니다. Visual Studio없이 MSTest 만 설치할 수 있습니까?
Visual Studio없이 mstest.exe를 실행할 수 있습니다.
아래 Visual Studio ISO 용 에이전트 중 하나를 다운로드 하고 서버에 테스트 에이전트 를 설치 합니다.
비주얼 스튜디오 2017 (127메가바이트 디스크 공간, 적은 다운로드보다)
스튜디오 2015 비주얼 (128 메가 바이트 설정은 2GB의 디스크 공간 필요)
비주얼 스튜디오 2012 (224메가바이트)
비주얼 스튜디오 2013 (287메가바이트)
비주얼 스튜디오 2010 (5백15메가바이트)
그러면 명령 줄에서 mstest.exe를 실행하는 데 필요한 모든 것이 설치되며 Visual Studio보다 훨씬 가볍습니다. ~ 500mb 다운로드 및 약 ~ 300mb로 정확히 기억하면 테스트 에이전트 만 설치합니다.
최신 정보
VS 2017 이전 버전의 경우 여기를 참조하십시오.
https://www.visualstudio.com/vs/older-downloads/
이 대답은 특히 Visual Studio 2017과 관련이 있으며 대답은 yes 입니다. 그러나 Microsoft (여전히)는 관련 실행 파일 ( MSBuild.exe
및 MSTest.exe
) 을 찾기위한 공식 API를 제공하지 않으므로 이러한 파일을 찾기 위해 레지스트리 키를 읽거나 다양한 디렉토리를 조사해야합니다 . 경고를 받았습니다.
- 단위 테스트 프로젝트 만 빌드 해야하는 경우
MSTest.TestFramework
해당 프로젝트에 패키지 를 설치 하고 참조를 제거Microsoft.VisualStudio.QualityTools.UnitTestFramework
합니다. 이제 Visual Studio 2017 빌드 도구 를 설치 하고 호출msbuild.exe
하여 빌드를 수행하기 만하면됩니다. - 테스트도 실행 해야한다면 상황이 더 까다로워집니다.
- 가장 간단한 해결책은 VS2017 Community Edition (msbuild와 mstest를 모두 포함)을 설치하는 것입니다. 그러나 이것의 합법성을 확신 할 수 없으며 변호사가 아니므로주의하십시오!
- (디스크 공간의 측면에서 훨씬 가볍고,) 법적으로 안전한 솔루션은 설치하는 것입니다 비주얼 스튜디오 2017 테스트 에이전트를 하고 다음 비주얼 스튜디오 2017에 대한 빌드 도구 ( 정확한 순서가 중요하다 1 ); 이것은 당신을 줄 것이다
MSTest.exe
하고vstest.console.exe
있는 당신은 그에게 호출 할 수 있습니다. 이러한 실행 파일이MSBuild.exe
빌드 도구에서 와 동일한 디렉토리 구조에 존재하지 않기 때문에 실제로 이러한 실행 파일이 어디에 있는지 파악하는 것은 힘든 일 입니다.
마지막으로, 매우 중요한 것은 MSTest.TestFramework
Visual Studio IDE 내에서 테스트를 사용 하고 여전히 검색하고 실행할 수 있어야하는 MSTest.TestAdapter
경우 단위 테스트 프로젝트 에도 설치 해야 합니다.
1 : VS2017은 병렬 설치를 지원하지만 가장 최근 설치 만 기록하는 단일 레지스트리 키를 사용합니다. 따라서 Test Agent를 마지막으로 설치하면 키가 해당 설치 디렉터리를 가리 키지 만 Test Agent에는이 포함 MSBuild.exe
되어 있지 않으므로이 레지스트리 키를 사용하여 실행 파일의 경로를 알아내는 코드는 실패합니다. Microsoft가 테스트 에이전트를 빌드 도구의 선택적 부분으로 만들지 못한 이유는 (모든 EXE가 동일한 디렉터리 계층 구조에 있도록) 누구나 추측 할 수 있습니다.
나는 당신이 아마 할 수 있다고 생각하지만 확실히 지원되지 않습니다.
Visual Studio를 설치하지 않고도 MSTest가 작동한다고 주장하는 사람이 작성한이 블로그 기사를 찾았습니다.
@crocpulsar, 빌드 서버에 Visual Studio를 설치해야 하지만 추가 라이선스를 구매할 필요는 없습니다 .
VS를 설치하지 않고 작동하도록 빌드 및 MSTest를 얻는 데에는 너무 많은 의존성이 있으며 가장 확실하게 지원되지 않습니다.
빌드를 시작하는 사람이 라이센스를 가지고있는 한 빌드 서버에는 라이센스가 필요하지 않습니다. 이것은 2005 년의 암울한 날 이후로 그랬습니다. 에디션 패리티가있는 한 괜찮습니다.
팀의 모든 구성원이 Ultimate를 가지고 있다면 빌드 서버에 자유롭게 설치할 수 있습니다. 하지만 팀원 중 한 명이 프리미엄을 가지고 있다면 이상적으로는 빌드 서버에 프리미엄을 설치해야합니다. 이를 통해 코드 커버리지, 테스트 영향 분석 및 아키텍처 유효성 검사와 같은 많은 다른 비트도 가능합니다.
다음은 VS 2012를 설치하지 않고 MsTest를 실행하도록 빌드 서버를 가져 오는 단계입니다.
- c : \ dev에 'Mstest'디렉터리 폴더를 생성했습니다.
- C : \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE에서 'Mstest'디렉터리로 'Mstest.exe'및 'Mstest.exe.config'복사
- Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll을 'Mstest'디렉터리에 복사합니다.
- 'Mstest'폴더에 'assemblies'디렉터리 생성
- 모든 v11 Microsoft.VisualStudio.QualityTools. *. dll을 C : \ Windows \ assembly에서 'Mstest / assemblies'디렉터리로 추출했습니다.
- 모든 'v11'Microsoft.VisualStudio.QualityTools를 복사합니다. .dll 및 Microsoft.VisualStudio.TestTools. C : \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL에서 'Mstest / assemblies'로 .dll
- 모든 v11 Microsoft.VisualStudio.QualityTools를 복사합니다. .dll 및 Microsoft.VisualStudio.TestTools. C : \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ PrivateAssemblies에서 'Mstest / assemblies'로 .dll
- 'Mstest.exe.config'의 'privatePath'속성에 'assemblies'를 추가합니다.
- 'HKEY_LOCAL_MACHINE / SOFTWARE / Wow6432Node / Microsoft / VisualStudio / 11.0 / Enterprise / QualityTools를 내보내고 허드슨 박스에 적용합니다.
- QTAgent32.exe 및 QTAgent32.exe.config를 C : \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE에서 'MsTest'디렉터리로 복사합니다.
- 'QTAgent32.exe.config'의 'privatePath'속성에 'assemblies'를 추가합니다.
- Copy 'msdia110.dll' from 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\Debugger' to 'MsTest/assemblies'
Register 'msdia110.dll' with c:/windows/syswow64/regsvr32.exe /i '../mstest/assemblies/msdia110.dll'(This threw an error, but for some reason it still worked. I ran it a couple times and tried different regsvr32.exe versions before I checked, but it's there in the registry)
Add environment variable 'MSTEST_HOME' and set it to 'c:\dev\mstest\' or to your path. I used the environment variable in my build script.
Debugging MsTest execution error:
Add to 'MsTest.exe.config'
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="EqtListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\MsTest.log" />
</listeners>
</trace>
<switches>
<add name="EqtTraceLevel" value="Verbose" />
</switches>
</system.diagnostics>
I just got this working on my servers without installing the Visual Studio 2017 IDE. My requirement was
- Build projects
- Build test projects
- Run tests using VSTest (I believe it is a similar process for MSTest)
I had to do a combination of a few things stated in other answers and then also another one here.
VS2017:
- BuildTools - This can be found on the Microsoft downloads page, and then scroll down to "Tools for Visual Studio 2017" -> "Build Tools for Visual Studio 2017"
- TestAgent - This can be found on the Microsoft downloads page, and then scroll down to "Tools for Visual Studio 2017" -> "Agents for Visual Studio 2017"
- Nuget Package to include the visual studio unit testing dll - This can be found here
Step 3 was to fix the following issue:
"Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework""
Which then caused:
"error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) "
I did not have to add any references to the project. However, the path to the vstest.console.exe is contained in the TestAgent folder (for me it was "C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow")
MSTest was announced for .NET Core users. The announcement has usage example with the dotnet
tool. I haven't figured myself how to get the standalone mstest
executable.
If you need to run mstest.exe webtest tool then you can install Visual Studio Enterprise trial and make sure to run it at least once (just start it) under account under which test will be running with nothing additional needs to be done. So if your test run under System account then you need to use something like below
PS C:\agent> psexec -s cmd.exe
C:\Windows\system32>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\mstest.exe"
Microsoft (R) Test Execution Command Line Tool Version 15.0.27520.0
Copyright (c) Microsoft Corporation. All rights reserved.
Please specify tests to run, or specify the /publish switch to publish results.
For switch syntax, type "MSTest /help"
참고URL : https://stackoverflow.com/questions/3402899/can-i-use-mstest-exe-without-installing-visual-studio
'IT story' 카테고리의 다른 글
개발자 콘솔의 베타 / 알파 테스트에 대한 설명이 필요합니다. (0) | 2020.08.13 |
---|---|
Oracle SQL Developer에서 'trinidad & tobago'로 변수 대체를 방지하는 방법 (0) | 2020.08.13 |
집계 프레임 워크 용 Mongodb Explain (0) | 2020.08.13 |
숫자가 10의 배수인지 아니면 특정 범위 내에 있는지 확인 (0) | 2020.08.13 |
java.lang.NoClassDefFoundError : org / hamcrest / SelfDescribing (0) | 2020.08.13 |