Remove partial quotes in csv files
Cause: github do not want to render fields with such kind of quotes
This commit is contained in:
@@ -48,7 +48,8 @@ private fun AutoMute.muteTest(testKey: String) {
|
||||
private class MutedTest(
|
||||
val key: String,
|
||||
@Suppress("unused") val issue: String?,
|
||||
val hasFailFile: Boolean
|
||||
val hasFailFile: Boolean,
|
||||
val isFlaky: Boolean
|
||||
) {
|
||||
val methodKey: String
|
||||
val classNameKey: String
|
||||
@@ -119,22 +120,29 @@ private fun loadMutedTests(file: File): List<MutedTest> {
|
||||
}
|
||||
|
||||
private val COLUMN_PARSE_REGEXP = Regex("\\s*(?:(?:\"((?:[^\"]|\"\")*)\")|([^,]*))\\s*")
|
||||
private val MUTE_LINE_PARSE_REGEXP = Regex("$COLUMN_PARSE_REGEXP,$COLUMN_PARSE_REGEXP,$COLUMN_PARSE_REGEXP")
|
||||
private val MUTE_LINE_PARSE_REGEXP = Regex("$COLUMN_PARSE_REGEXP,$COLUMN_PARSE_REGEXP,$COLUMN_PARSE_REGEXP,$COLUMN_PARSE_REGEXP")
|
||||
|
||||
private fun parseMutedTest(str: String): MutedTest {
|
||||
val matchResult = MUTE_LINE_PARSE_REGEXP.matchEntire(str) ?: throw ParseError("Can't parse the line: $str")
|
||||
val resultValues = matchResult.groups.filterNotNull()
|
||||
|
||||
val testKey = resultValues[1].value
|
||||
val issue = resultValues[2].value
|
||||
val stateStr = resultValues[3].value
|
||||
val statusStr = resultValues[4].value
|
||||
|
||||
val hasFailFile = when (stateStr) {
|
||||
"MUTE", "" -> false
|
||||
"FAIL" -> true
|
||||
else -> throw ParseError("Invalid state (`$stateStr`), MUTE, FAIL or empty are expected: $str")
|
||||
}
|
||||
val isFlaky = when (statusStr) {
|
||||
"FLAKY" -> true
|
||||
"" -> false
|
||||
else -> throw ParseError("Invalid status (`$statusStr`), FLAKY or empty are expected: $str")
|
||||
}
|
||||
|
||||
return MutedTest(testKey, issue, hasFailFile)
|
||||
return MutedTest(testKey, issue, hasFailFile, isFlaky)
|
||||
}
|
||||
|
||||
private class ParseError(message: String, override val cause: Throwable? = null) : IllegalArgumentException(message)
|
||||
|
||||
Reference in New Issue
Block a user