@@ -39,7 +39,8 @@ class HttpProtocolTestGenerator(
3939 private val serdeContext : HttpProtocolUnitTestGenerator .SerdeContext ,
4040 private val imports : List <String > = listOf(),
4141 // list of test IDs to ignore/skip
42- private val testsToIgnore : Set <String > = setOf()
42+ private val testsToIgnore : Set <String > = setOf(),
43+ private val tagsToIgnore : Set <String > = setOf(),
4344) {
4445 private val LOGGER = Logger .getLogger(javaClass.name)
4546
@@ -94,7 +95,7 @@ class HttpProtocolTestGenerator(
9495 .getOrNull()
9596 ?.getTestCasesFor(AppliesTo .CLIENT )
9697 .orEmpty()
97- val requestTestCases = filterProtocolTestCases(tempTestCases)
98+ val requestTestCases = filterProtocolTestCases(filterProtocolTestCasesByTags( tempTestCases) )
9899 if (requestTestCases.isNotEmpty()) {
99100 val testClassName = " ${operation.toUpperCamelCase()} RequestTest"
100101 val testFilename = " ./${ctx.settings.testModuleName} /$testClassName .swift"
@@ -133,7 +134,7 @@ class HttpProtocolTestGenerator(
133134 .getOrNull()
134135 ?.getTestCasesFor(AppliesTo .CLIENT )
135136 .orEmpty()
136- val responseTestCases = filterProtocolTestCases(tempResponseTests)
137+ val responseTestCases = filterProtocolTestCases(filterProtocolTestCasesByTags( tempResponseTests) )
137138 if (responseTestCases.isNotEmpty()) {
138139 val testClassName = " ${operation.id.name.capitalize()} ResponseTest"
139140 val testFilename = " ./${ctx.settings.testModuleName} /$testClassName .swift"
@@ -173,7 +174,7 @@ class HttpProtocolTestGenerator(
173174 .getOrNull()
174175 ?.getTestCasesFor(AppliesTo .CLIENT )
175176 .orEmpty()
176- val testCases = filterProtocolTestCases(tempTestCases)
177+ val testCases = filterProtocolTestCases(filterProtocolTestCasesByTags( tempTestCases) )
177178 numTestCases + = testCases.count()
178179 if (testCases.isNotEmpty()) {
179180 // multiple error (tests) may be associated with a single operation,
@@ -213,6 +214,11 @@ class HttpProtocolTestGenerator(
213214 private fun <T : HttpMessageTestCase > filterProtocolTestCases (testCases : List <T >): List <T > = testCases.filter {
214215 it.protocol == ctx.protocol && it.id !in testsToIgnore
215216 }
217+
218+ private fun <T : HttpMessageTestCase > filterProtocolTestCasesByTags (testCases : List <T >): List <T > =
219+ testCases.filter { testCase ->
220+ testCase.protocol == ctx.protocol && tagsToIgnore.none { tag -> testCase.hasTag(tag) }
221+ }
216222}
217223
218224private fun serverOnly (shape : Shape ): Boolean = shape.hasTag(" server-only" )
0 commit comments