Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bench #1816

Merged
merged 12 commits into from
Sep 16, 2024
4 changes: 2 additions & 2 deletions .teamcity/Templates/RegressionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ open class RegressionTest (platformOs: String) : Template() {
scriptContent = header +
"""
pixi run python utils/get_benchmark.py %MiniO_credential_token% "benchmark/"
pixi run python utils/get_benchmark.py %MiniO_credential_token% "hws_2024_7_0/"
pixi run python utils/get_benchmark.py %MiniO_credential_token% "hws_migration_test/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to checkout both models now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we separated the hws model that is used for migration test and the one used for integration test. Because the one for integration test is now updated and has version number and newest parameters, but we still need an "old" model for the migration test.

pixi run test-ribasim-regression
""".trimIndent()
}
Expand All @@ -73,4 +73,4 @@ open class RegressionTest (platformOs: String) : Template() {
}

object RegressionTestWindows : RegressionTest("Windows")
object RegressionTestLinux : RegressionTest("Linux")
object RegressionTestLinux : RegressionTest("Linux")
3 changes: 2 additions & 1 deletion core/integration_test/hws_integration_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@testset "Results values" begin
@test basin.node_id == basin_bench.node_id
@test all(q -> abs(q) < 0.01, basin.level - basin_bench.level)
@test all(q -> abs(q) < 0.02, basin.level - basin_bench.level)
end

timed = @timed Ribasim.run(toml_path)
Expand All @@ -27,6 +27,7 @@
performance_diff =
round((timed.time - benchmark_runtime) / benchmark_runtime * 100; digits = 2)
if performance_diff < 0.0
performance_diff = abs(performance_diff)
@info "Runtime is $(timed.time) and it is $performance_diff % faster than benchmark"
elseif performance_diff > 0.0 && performance_diff < 0.2
@info "Runtime is $(timed.time) and it is $performance_diff % slower than benchmark"
Expand Down
4 changes: 2 additions & 2 deletions python/ribasim/tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

@pytest.mark.regression
def test_hws_migration():
toml_path = root_folder / "models/hws_2024_7_0/hws.toml"
db_path = root_folder / "models/hws_2024_7_0/database.gpkg"
toml_path = root_folder / "models/hws_migration_test/hws.toml"
db_path = root_folder / "models/hws_migration_test/database.gpkg"

assert (
toml_path.exists()
Expand Down
2 changes: 1 addition & 1 deletion utils/get_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
minioServer: the access point to MinIO for Deltares
accessKey: the credentials username
secreyKey: input from the terminal, the credentials password
pathToFolder: input from the terminal, the path to the folder to download. E.g. "benchmark/", "hws_2024_7_0/"
pathToFolder: input from the terminal, the path to the folder to download. E.g. "benchmark/", "hws_2024_7_0/", "hws_migration"
"""

minioServer = "s3.deltares.nl"
Expand Down
Loading