If you have the following: -
package com.test import org.scalatest.FlatSpec import org.scalatest.Tag object SlowTest extends Tag("com.mycompany.tags.SlowTest") object DbTest extends Tag("com.mycompany.tags.DbTest") class TestSuite extends FlatSpec { "The Scala language" must "add correctly" taggedAs(SlowTest) in { val sum = 1 + 1 assert(sum === 2) } it must "subtract correctly" taggedAs(SlowTest, DbTest) in { val diff = 4 - 1 assert(diff === 3) } }
To exclude the DbTest tag, you must: -
test-only * -- -l com.mycompany.tags.DbTest
Please note that you will need to provide the full name of the tag. If it still does not work for you, could you share a piece of source code that does not work?
Chee seng
source share