Skip to content

Keep only important integration tests: step 1 #833

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

Merged
merged 16 commits into from
Nov 25, 2024

Conversation

mgovers
Copy link
Member

@mgovers mgovers commented Nov 15, 2024

  • move some integration tests from test_main_model*.cpp to validation cases
  • remove integration tests from test_main_model*.cpp that are already captured elsewhere

relates to #486

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
@mgovers mgovers added the improvement Improvement on internal implementation label Nov 15, 2024
Copy link
Contributor

@figueroa1395 figueroa1395 left a comment

Choose a reason for hiding this comment

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

This review is for the first commit only, but it looks like the rest of the commits do what is explained on the first, so I will review the rest by leaving individual comments.

Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
Copy link
Member

@TonyXiang8787 TonyXiang8787 left a comment

Choose a reason for hiding this comment

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

@mgovers my general idea is to remove all test_main_model, test_main_model_sc and test_main_model_se.

@mgovers
Copy link
Member Author

mgovers commented Nov 22, 2024

@mgovers my general idea is to remove all test_main_model, test_main_model_sc and test_main_model_se.

yes, i know. i'm rewriting some of them, but it's a time-consuming process. all TODOs are mainly there for my personal reference, and in addition, those were all added before our discussion last thursday. I just have not updated them yet because I've been focusing on actually doing the refactoring; starting with test_main_model.cpp.

Notice that there are some that i marked "we should keep this" or "we should whitebox test that". I will make API tests for those for now, but they should not be. they point at the deeper, underlying issue of the fact that the code is very hard to test in an isolated environment. A good example is the set of tests regarding the batch dispatch logic. they should not live in API model, nor in integration tests. They should be unit tests that only test the batch dispatch logic. However, with the current architecture, it is not possible to re-write the tests in such a way and definitely out of scope of this PR.

@mgovers mgovers marked this pull request as ready for review November 22, 2024 11:09
@mgovers mgovers changed the title Feature/keep only important integration tests Keep only important integration tests Nov 25, 2024
@figueroa1395
Copy link
Contributor

@mgovers my general idea is to remove all test_main_model, test_main_model_sc and test_main_model_se.

yes, i know. i'm rewriting some of them, but it's a time-consuming process. all TODOs are mainly there for my personal reference, and in addition, those were all added before our discussion last thursday. I just have not updated them yet because I've been focusing on actually doing the refactoring; starting with test_main_model.cpp.

Notice that there are some that i marked "we should keep this" or "we should whitebox test that". I will make API tests for those for now, but they should not be. they point at the deeper, underlying issue of the fact that the code is very hard to test in an isolated environment. A good example is the set of tests regarding the batch dispatch logic. they should not live in API model, nor in integration tests. They should be unit tests that only test the batch dispatch logic. However, with the current architecture, it is not possible to re-write the tests in such a way and definitely out of scope of this PR.

Out of scope, but do we also want to just move the mentioned tests to the API? Isn't that moving the problem around while using your time on it? If some are being moved to the API tests just for the sake of moving them out of integration rather than because they belong there, I would say that we just leave them be here. Just my opinion.

@mgovers
Copy link
Member Author

mgovers commented Nov 25, 2024

@mgovers my general idea is to remove all test_main_model, test_main_model_sc and test_main_model_se.

yes, i know. i'm rewriting some of them, but it's a time-consuming process. all TODOs are mainly there for my personal reference, and in addition, those were all added before our discussion last thursday. I just have not updated them yet because I've been focusing on actually doing the refactoring; starting with test_main_model.cpp.
Notice that there are some that i marked "we should keep this" or "we should whitebox test that". I will make API tests for those for now, but they should not be. they point at the deeper, underlying issue of the fact that the code is very hard to test in an isolated environment. A good example is the set of tests regarding the batch dispatch logic. they should not live in API model, nor in integration tests. They should be unit tests that only test the batch dispatch logic. However, with the current architecture, it is not possible to re-write the tests in such a way and definitely out of scope of this PR.

Out of scope, but do we also want to just move the mentioned tests to the API? Isn't that moving the problem around while using your time on it? If some are being moved to the API tests just for the sake of moving them out of integration rather than because they belong there, I would say that we just leave them be here. Just my opinion.

i think so as well, but compilation time is a real issue. it's probably a good idea to re-evaluate those when the rest of the (re)moving is finished

@figueroa1395 figueroa1395 added this pull request to the merge queue Nov 25, 2024
Merged via the queue into main with commit cf7cdf6 Nov 25, 2024
27 checks passed
@figueroa1395 figueroa1395 deleted the feature/only-important-integration-tests branch November 25, 2024 11:01
@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo changed the title Keep only important integration tests Keep only important integration tests: step 1 May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement on internal implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants