Skip to content

Commit 18cd360

Browse files
committed
avoid duplicate test names by including the path below the draft directory
1 parent 5a38300 commit 18cd360

File tree

1 file changed

+7
-1
lines changed
  • json-schema-validator/src/test/kotlin/io/openapiprocessor/jsonschema/validator/support

1 file changed

+7
-1
lines changed

json-schema-validator/src/test/kotlin/io/openapiprocessor/jsonschema/validator/support/Draft.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,17 @@ fun draftSpec(
9696
return JsonInstance(JsonPointer.empty(), instance)
9797
}
9898

99+
fun createTestName(testPath: Path): String {
100+
val path = testPath.toAbsolutePath().toString()
101+
val draftPathIndex = path.indexOf(draftPath)
102+
return path.substring(draftPathIndex + draftPath.length + 1)
103+
}
104+
99105
Files.walk(root)
100106
.filter { path -> !Files.isDirectory(path) }
101107
.filter { path -> !excludes.contains(path.name) }
102108
.forEach { path ->
103-
path.name - {
109+
createTestName(path) - {
104110
val suites = loadSuites(path)
105111

106112
for (suite in suites) {

0 commit comments

Comments
 (0)