Job Board
Consulting

Running Specific Test Using sbt

You're writing tests for your spark scala etl pipeline right? Right? RIGHT?

Typically you will run your entire test suite with sbt as follows:

> sbt test

It's also really easy to run a single test using sbt, but the syntax is rather convoluted and can be hard to rember. To run a specific test you specify the test suite and the complete test name as follow:

> sbt 'testOnly *TestSuiteClass -- -t testName'

You can run all tests under a specific test class too:

> sbt 'testOnly *TestSuiteClass'

You can use the -z option as a wildcard to match multiple tests within the suite:

> sbt 'testOnly *TestSuiteClass -- -z tests'
Example Details

Created: 2023-08-05 11:11:00 AM

Last Updated: 2023-08-05 11:11:00 AM