-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for MSTestRunner (#1328)
- Loading branch information
Evaristo Gutiérrez
authored
Mar 17, 2020
1 parent
958e5b4
commit 52ed3fe
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Configure MSBuild | ||
|
||
Basic configuration of [MSTestRunner](https://plugins.jenkins.io/mstestrunner/) plugin. | ||
|
||
## Sample configuration | ||
|
||
```yaml | ||
tool: | ||
msTestInstallation: | ||
installations: | ||
- defaultArgs: "/category:SmokeTests" | ||
home: "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\MSTest.exe" | ||
name: "MSTest test" | ||
omitNoIsolation: true | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
integrations/src/test/java/io/jenkins/plugins/casc/MSTestRunnerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.jenkins.plugins.casc; | ||
|
||
import hudson.ExtensionList; | ||
import io.jenkins.plugins.casc.misc.ConfiguredWithReadme; | ||
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithReadmeRule; | ||
import org.jenkinsci.plugins.MsTestInstallation; | ||
import org.jenkinsci.plugins.MsTestInstallation.DescriptorImpl; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
public class MSTestRunnerTest { | ||
@Rule | ||
public JenkinsConfiguredWithReadmeRule j = new JenkinsConfiguredWithReadmeRule(); | ||
|
||
@Test | ||
@ConfiguredWithReadme("mstestrunner/README.md") | ||
public void configure_mstestrunner() { | ||
final DescriptorImpl msTestRunnerDescriptor = ExtensionList.lookupSingleton(DescriptorImpl.class); | ||
assertNotNull(msTestRunnerDescriptor); | ||
assertEquals(1, msTestRunnerDescriptor.getInstallations().length); | ||
|
||
final MsTestInstallation msTestRunnerInstallation = msTestRunnerDescriptor.getInstallations()[0]; | ||
assertEquals("MSTest test", msTestRunnerInstallation.getName()); | ||
assertEquals("C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\MSTest.exe", msTestRunnerInstallation.getHome()); | ||
assertEquals("/category:SmokeTests", msTestRunnerInstallation.getDefaultArgs()); | ||
assertTrue(msTestRunnerInstallation.getOmitNoIsolation()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters