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

not able to run integration tests through sbt testng interface #10

Open
Harikiranvuyyuru opened this issue Mar 28, 2016 · 1 comment
Open

Comments

@Harikiranvuyyuru
Copy link

Harikiranvuyyuru commented Mar 28, 2016

I want to run the integration tests located at path src/it/java using sbt task : sbt it:test

I have provided the following settings in my build.sbt :

Defaults.itSettings

javaSource in IntegrationTest := baseDirectory.value / "src/it/java"

testNGSettings

testNGSuites := Seq("src/it/resources/testng.xml")

Integration tests are not executed when I run the sbt task: it:test

Is there a way to run integration tests located in src/it through this plugin?

@vuspenskiy
Copy link

It is because test is hardcoded in testNGSettings, try expanding testNGSettings to its source (https://github.com/sbt/sbt-testng/blob/094f749250b4b18c613e7d7ce801c4b8abc567e0/plugin/src/main/scala/de/johoop/testngplugin/TestNGPlugin.scala) and fix scopes:

  .settings(
    resolvers += Resolver.sbtPluginRepo("releases"), // why is that necessary, and why like that?
    testNGVersion := testNGV,
    testNGOutputDirectory := ((crossTarget).value / "testng").absolutePath,
    testNGParameters := Seq(),
    testNGSuites := Seq(((resourceDirectory in IntegrationTest).value / "testng.yaml").absolutePath),
    libraryDependencies ++= Seq(
      "org.testng" % "testng" % (testNGVersion).value % "test,it",
      "org.yaml" % "snakeyaml" % "1.17" % "test,it",
      "de.johoop" %% "sbt-testng-interface" % "3.0.3" % "test,it"),
    testFrameworks += TestNGFrameworkID,
    testOptions += Tests.Argument(
      TestNGFrameworkID, ("-d" +:
        (testNGOutputDirectory).value +: (testNGParameters).value) ++
        (testNGSuites).value :_*
    )
  )

sebady pushed a commit to sebady/sbt-testng that referenced this issue May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants