[db] don't allow initial repos from fixtures to provide weight

The client was already auto-incrementing their weight anyway. But it leaked our internal weight handling into the library consumer which can cause issues like when me are making changes to how we handles repo weights as we are doing now.
This commit is contained in:
Torsten Grote committed 2024-02-20 09:42:40 -03:00
1 parent b993da8db8
commit 51a4bcec58
3 files changed
+5 -4

No files matched your search

@@ -30,7 +30,6 @@ internal class RepositoryDaoTest : DbTest() {
certificate = "abcdef", // not random, because format gets checked
version = Random.nextLong(),
enabled = Random.nextBoolean(),
weight = Random.nextInt(),
)
val repoId = repoDao.insert(repo)
@@ -41,7 +40,7 @@ internal class RepositoryDaoTest : DbTest() {
assertEquals(repo.certificate, actualRepo.certificate)
assertEquals(repo.version, actualRepo.version)
assertEquals(repo.enabled, actualRepo.enabled)
assertEquals(repo.weight, actualRepo.weight)
assertEquals(Int.MAX_VALUE - 2, actualRepo.weight) // ignoring provided weight
assertEquals(-1, actualRepo.timestamp)
assertEquals(3, actualRepo.mirrors.size)
assertEquals(emptyList(), actualRepo.userMirrors)