Skip to content

Commit

Permalink
Hotfix: respect tags when saving Test Suites (#966)
Browse files Browse the repository at this point in the history
Follow up for #925. We now send tags in `TestSuiteDto`s, but don't use them in `findOne` before saving tests. This leads to errors after data is initially saved and `findOne` starts to return more than one entry.

Also specifies save-core version to `0.3.2` unitl saveourtool/save-cli#429 is implemented.
  • Loading branch information
petertrr authored Jul 26, 2022
1 parent 79112b5 commit 67fb402
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
kotlin = "1.7.10"
save-core = "0.4.0-SNAPSHOT"
save-core = "0.3.2"
ktor = "2.0.3"
okio = "3.2.0"
serialization = "1.3.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class TestSuitesService(
dateAdded = null,
testRootPath = FilenameUtils.separatorsToUnix(it.testRootPath),
testSuiteRepoUrl = it.testSuiteRepoUrl,
language = it.language
language = it.language,
tags = it.tags?.let(TestSuite::tagsFromList),
)
}
.map { testSuite ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@ class TestSuite(
this.language,
this.tagsAsList(),
)

companion object {
/**
* Concatenates [tags] using same format as [TestSuite.tagsAsList]
*
* @param tags list of tags
* @return representation of [tags] as a single string understood by [TestSuite.tagsAsList]
*/
fun tagsFromList(tags: List<String>) = tags.joinToString(separator = ",")
}
}

0 comments on commit 67fb402

Please sign in to comment.