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) assertEquals(20, songs.size)
assertTrue(songs.all { song -> song.genre == null || song.genres.isEmpty() || song.genres.contains(song.genre) }) 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.supportsGenres) {
if (server.name != "nextcloud") {
assertTrue(songs.any { it.genres.isNotEmpty() }) assertTrue(songs.any { it.genres.isNotEmpty() })
} }
} }
@@ -9,6 +9,7 @@ data class TestServer(
val username: String, val username: String,
val password: String, val password: String,
val supportsTokenAuth: Boolean, val supportsTokenAuth: Boolean,
val supportsGenres: Boolean,
) { ) {
override fun toString(): String = name override fun toString(): String = name
} }
@@ -16,15 +17,16 @@ data class TestServer(
object TestServers { object TestServers {
val all = val all =
listOf( listOf(
TestServer("navidrome", "http://localhost:4533/", "admin", "password", supportsTokenAuth = true), TestServer("navidrome", "http://localhost:4533/", "admin", "password", supportsTokenAuth = true, supportsGenres = true),
TestServer("gonic", "http://localhost:4747/", "admin", "admin", supportsTokenAuth = true), TestServer("gonic", "http://localhost:4747/", "admin", "admin", supportsTokenAuth = true, supportsGenres = true),
TestServer("lms", "http://localhost:5082/", "admin", "subtracks-lms", supportsTokenAuth = false), TestServer("lms", "http://localhost:5082/", "admin", "subtracks-lms", supportsTokenAuth = false, supportsGenres = true),
TestServer( TestServer(
"nextcloud", "nextcloud",
"http://localhost:8090/index.php/apps/music/subsonic/", "http://localhost:8090/index.php/apps/music/subsonic/",
"admin", "admin",
"subtracks-nextcloud", "subtracks-nextcloud",
supportsTokenAuth = false, supportsTokenAuth = false,
supportsGenres = false,
), ),
) )