record genre support in the integration test fixture

The Nextcloud genre exception was a comment; express it as a TestServer
capability instead, mirroring supportsTokenAuth.
This commit is contained in:
austinried
2026-10-04 00:30:06 +00:00
parent 26f58b7502
commit c857d5e910
2 changed files with 6 additions and 5 deletions
@@ -67,8 +67,7 @@ class SubsonicSourceIntegrationTest(
assertEquals(20, songs.size)
assertTrue(songs.all { song -> song.genre == null || song.genres.isEmpty() || song.genres.contains(song.genre) })
// Nextcloud Music does not populate the OpenSubsonic genres array.
if (server.name != "nextcloud") {
if (server.supportsGenres) {
assertTrue(songs.any { it.genres.isNotEmpty() })
}
}
@@ -9,6 +9,7 @@ data class TestServer(
val username: String,
val password: String,
val supportsTokenAuth: Boolean,
val supportsGenres: Boolean,
) {
override fun toString(): String = name
}
@@ -16,15 +17,16 @@ data class TestServer(
object TestServers {
val all =
listOf(
TestServer("navidrome", "http://localhost:4533/", "admin", "password", supportsTokenAuth = true),
TestServer("gonic", "http://localhost:4747/", "admin", "admin", supportsTokenAuth = true),
TestServer("lms", "http://localhost:5082/", "admin", "subtracks-lms", supportsTokenAuth = false),
TestServer("navidrome", "http://localhost:4533/", "admin", "password", supportsTokenAuth = true, supportsGenres = true),
TestServer("gonic", "http://localhost:4747/", "admin", "admin", supportsTokenAuth = true, supportsGenres = true),
TestServer("lms", "http://localhost:5082/", "admin", "subtracks-lms", supportsTokenAuth = false, supportsGenres = true),
TestServer(
"nextcloud",
"http://localhost:8090/index.php/apps/music/subsonic/",
"admin",
"subtracks-nextcloud",
supportsTokenAuth = false,
supportsGenres = false,
),
)