Test pairings and weights from last round to first in Toulouse2024
This commit is contained in:

committed by
Claude Brisson

parent
bee1536752
commit
793180a116
@@ -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()
|
||||||
|
5222
api-webapp/src/test/resources/opengotha/Toulouse2024_weights_R6.txt
Normal file
5222
api-webapp/src/test/resources/opengotha/Toulouse2024_weights_R6.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user