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

[GeoMechanicsApplication] Cleanup of the head extrapolation unit tests #12532

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

rfaasse
Copy link
Contributor

@rfaasse rfaasse commented Jul 12, 2024

📝 Description
Minor cleanup effort for the unit tests in test_head_extrapolation_workflow.cpp. I did the clean-up before, but didn't want to introduce more merge conflicts for the ci/gtests branch. Now that is done, this can be merged

@rfaasse rfaasse added the Refactor When code is moved or rewrote keeping the same behavior label Jul 12, 2024
@rfaasse rfaasse self-assigned this Jul 12, 2024
@rfaasse rfaasse requested review from markelov208 and avdg81 July 19, 2024 06:43
@rfaasse rfaasse marked this pull request as ready for review July 19, 2024 06:44
Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

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

Thanks for removing the duplication from this test code. It looks nice and clean to me. I have two very minor suggestions related to an #included header file and to rename two parameters to comply with the Kratos Style Guide.

@@ -10,112 +10,81 @@
// Main authors: Jonathan Nuttall
//

#include <string>
#include <iostream>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why we would need to include iostream here. I do see that we use std::filesystem. I've tried to replace iostream by the more appropriate filesystem and that seems to work.

Suggested change
#include <iostream>
#include <filesystem>

What are your thoughts about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, done!

&flow_stubs::emptyCancel);

const int status = execute.ExecuteFlowAnalysis(workingDirectory, projectFile, critical_head_info, "", call_back_functions);
int RunTestCase(int test_case_number)
Copy link
Contributor

@avdg81 avdg81 Jul 19, 2024

Choose a reason for hiding this comment

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

To follow the Kratos Style Guide, please rename the parameter as follows:

Suggested change
int RunTestCase(int test_case_number)
int RunTestCase(int TestCaseNumber)

This suggestion also applies to the parameter of function CompareResults.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

markelov208
markelov208 previously approved these changes Jul 19, 2024
Copy link
Contributor

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

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

Hi Richard, that is a very nice work. One non-blocking general comment.


KRATOS_EXPECT_TRUE(TestUtilities::CompareFiles(original, result))
return execute.ExecuteFlowAnalysis(workingDirectory.generic_string(), projectFile,
Copy link
Contributor

Choose a reason for hiding this comment

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

Tests work when return KratosExecute().ExecuteFlowAnalysis(...). What is your opinion on having line 35?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice suggestion, indeed makes it shorter and clearer in my opinion

@rfaasse rfaasse merged commit 2821810 into master Jul 19, 2024
9 of 11 checks passed
@rfaasse rfaasse deleted the geo/cleanup-unit-test branch July 19, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor When code is moved or rewrote keeping the same behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants