Skip to content

Commit

Permalink
Add integration test for MSTestRunner (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evaristo Gutiérrez authored Mar 17, 2020
1 parent 958e5b4 commit 52ed3fe
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions demos/mstestrunner/README.md
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
```
7 changes: 7 additions & 0 deletions integrations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,13 @@
<version>1.29</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>mstestrunner</artifactId>
<version>1.3.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ jdk:
installations:
- home: "/jdk"
name: "default"
msTestInstallation:
installations:
- defaultArgs: "/category:SmokeTests"
home: "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\MSTest.exe"
name: "MSTest test"
omitNoIsolation: true

0 comments on commit 52ed3fe

Please sign in to comment.