Test pairings and weights from last round to first in Toulouse2024

This commit is contained in:
Quentin Rendu
2024-05-23 15:22:47 +02:00
committed by Claude Brisson
parent bee1536752
commit 793180a116
2 changed files with 5235 additions and 4 deletions

View File

@@ -476,15 +476,24 @@ class PairingTests: TestBase() {
pairingsOG.add(games.toString()) pairingsOG.add(games.toString())
} }
for (round in tournament.getInt("rounds")!! downTo 1) {
TestAPI.delete("/api/tour/$id/pair/$round", Json.Array("all"))
}
var games: Json.Array var games: Json.Array
var firstGameID: Int var firstGameID: Int
var lastGameID: Int var lastGameID: Int
val playersList = mutableListOf<Long>() val playersList = mutableListOf<Long>()
for (round in tournament.getInt("rounds")!! downTo 1) {
TestAPI.delete("/api/tour/$id/pair/$round", Json.Array("all"))
BaseSolver.weightsLogger = PrintWriter(FileWriter(getOutputFile("weights.txt")))
//games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array(playersList.filter{it != byePlayerList[round-1]})).asArray()
games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array("all")).asArray()
logger.info("games for round $round: {}", games.toString().slice(0..50) + "...")
assertTrue(compare_weights(getOutputFile("weights.txt"), getTestFile("opengotha/Toulouse2024_weights_R$round.txt")), "Not matching opengotha weights for round $round")
assertTrue(compare_games(games, Json.parse(pairingsOG[round - 1])!!.asArray()),"pairings for round $round differ")
logger.info("Pairings for round $round match OpenGotha")
TestAPI.delete("/api/tour/$id/pair/$round", Json.Array("all"))
}
for (round in 1..6) { for (round in 1..6) {
BaseSolver.weightsLogger = PrintWriter(FileWriter(getOutputFile("weights.txt"))) BaseSolver.weightsLogger = PrintWriter(FileWriter(getOutputFile("weights.txt")))
//games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array(playersList.filter{it != byePlayerList[round-1]})).asArray() //games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array(playersList.filter{it != byePlayerList[round-1]})).asArray()

File diff suppressed because it is too large Load Diff