Skip to content

Commit

Permalink
Merge pull request #4 from linkedin/fix-skip-tests
Browse files Browse the repository at this point in the history
Fix problem that skipped tests are recognized as successful
  • Loading branch information
bbarkley committed Feb 10, 2016
2 parents c245858 + 5211b85 commit 1c670cb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
@@ -0,0 +1,17 @@
package com.linkedin.plugin;

import org.testng.ITestResult;
import org.testng.TestListenerAdapter;

/**
* Created by rli on 2/9/16.
*
* This is a workaround for a bug in sbt testng plugin that skipped tests won't fail the entire test suite.
*/
public class FailSkippedTestsListener extends TestListenerAdapter {

@Override
public void onTestSkipped(ITestResult testResult) {
testResult.setStatus(ITestResult.FAILURE);
}
}
1 change: 1 addition & 0 deletions plugin/src/main/scala/NGPlugin.scala
Expand Up @@ -39,6 +39,7 @@ object NGPlugin extends Plugin {
) ++
testNGSettings ++
Seq(
testNGParameters ++= Seq("-listener", "com.linkedin.plugin.FailSkippedTestsListener"),
libraryDependencies <++= (testNGVersion)(v => Seq(
"org.testng" % "testng" % v % "test->default",
// If changing this, be sure to change in Build.scala also.
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Expand Up @@ -40,7 +40,7 @@ object NGPluginBuild extends Build {
lazy val commonSettings: Seq[Setting[_]] = Project.defaultSettings ++ Seq(
organization := "com.linkedin.play-testng-plugin",
scalaVersion := "2.10.4",
version := "2.4.1",
version := "2.4.2",
resolvers ++= Seq(Repos.typeSafeReleases, Repos.scalazReleases)
)
}

0 comments on commit 1c670cb

Please sign in to comment.