title: Scalatest Maven Plugin "no tests were executed"
body: <p>I'm trying to use <a href="http://www.scalatest.org/" rel="noreferrer">scalatest</a> and <a href="https://github.com/holdenk/spark-testing-base" rel="noreferrer">spark-testing-base</a> on Maven for integration testing Spark. The Spark job reads in a CSV file, validates the results, and inserts the data into a database. I'm trying to test the validation by putting in files of known format and seeing if and how they fail. This particular test just makes sure the validation passes. Unfortunately, scalatest can't find my tests.</p>
  
  <p>Relevant pom plugins:</p>
  
  <pre><code>        &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;skipTests&gt;true&lt;/skipTests&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;!-- enable scalatest --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.scalatest&lt;/groupId&gt;
              &lt;artifactId&gt;scalatest-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;reportsDirectory&gt;${project.build.directory}/surefire-reports&lt;/reportsDirectory&gt;
                  &lt;wildcardSuites&gt;com.cainc.data.etl.schema.proficiency&lt;/wildcardSuites&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;test&lt;/id&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;test&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>And here's the test class:</p>
  
  <pre><code>class ProficiencySchemaITest extends FlatSpec with Matchers with SharedSparkContext with BeforeAndAfter {
      private var schemaStrategy: SchemaStrategy = _
      private var dataReader: DataFrameReader = _
  
      before {
          val sqlContext = new SQLContext(sc)
          import sqlContext._
          import sqlContext.implicits._
  
          val dataInReader = sqlContext.read.format("com.databricks.spark.csv")
                                              .option("header", "true")
                                              .option("nullValue", "")
          schemaStrategy = SchemaStrategyChooser("dim_state_test_proficiency")
          dataReader = schemaStrategy.applySchema(dataInReader)
      }
  
      "Proficiency Validation" should "pass with the CSV file proficiency-valid.csv" in {
          val dataIn = dataReader.load("src/test/resources/proficiency-valid.csv")
  
          val valid: Try[DataFrame] = Try(schemaStrategy.validateCsv(dataIn))
          valid match {
              case Success(v) =&gt; ()
              case Failure(e) =&gt; fail("Validation failed on what should have been a clean file: ", e)
          }
      }
  }
  </code></pre>
  
  <p>When I run <code>mvn test</code>, it can't find any tests and outputs this message:</p>
  
  <pre><code>[INFO] --- scalatest-maven-plugin:1.0:test (test) @ load-csv-into-db ---
  [36mDiscovery starting.[0m
  [36mDiscovery completed in 54 milliseconds.[0m
  [36mRun starting. Expected test count is: 0[0m
  [32mDiscoverySuite:[0m
  [36mRun completed in 133 milliseconds.[0m
  [36mTotal number of tests run: 0[0m
  [36mSuites: completed 1, aborted 0[0m
  [36mTests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0[0m
  [33mNo tests were executed.[0m
  </code></pre>
  
  <p><strong>UPDATE</strong><br>
  By using:</p>
  
  <pre><code>&lt;suites&gt;com.cainc.data.etl.schema.proficiency.ProficiencySchemaITest&lt;/suites&gt;
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>&lt;wildcardSuites&gt;com.cainc.data.etl.schema.proficiency&lt;/wildcardSuites&gt;
  </code></pre>
  
  <p>I can get that one Test to run. Obviously, this is not ideal. It's possible wildcardSuites is broken; I'm going to open a ticket on GitHub and see what happens.</p>