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

Feature/energymanagement unit tests #1015

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

corneliusclaussen
Copy link
Contributor

Describe your changes

This PR introduces new JSON based tests for EnergyManager.
Essentially input and expected output of the run_optimizer function can be specified in a single JSON file.
One unit test per file will programmatically be added to compare the output with the expected output and show a JSON diff if the test fails.

Several new test cases are added and the previous C++ based unit tests are converted to JSON.

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@corneliusclaussen corneliusclaussen force-pushed the feature/energymanagement-unit-tests branch 2 times, most recently from b0ab335 to 084c801 Compare January 21, 2025 11:30
@corneliusclaussen corneliusclaussen force-pushed the feature/energymanagement-unit-tests branch from 084c801 to e00f7d6 Compare January 22, 2025 09:58
Copy link
Contributor

Choose a reason for hiding this comment

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

should this file end with " copy.json" (including the space?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The JSONs will be entirely rewritten in PR1033 again, so leaving as is for now

Copy link
Contributor

Choose a reason for hiding this comment

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

should this file end with " copy.json" (including the space?)

return optimized_values;
}

} // namespace module
Copy link
Contributor

Choose a reason for hiding this comment

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

missing newline, in general the new json files are missing a newline at the end as well

@hikinggrass hikinggrass self-assigned this Jan 28, 2025
Essentially input and expected output of the run_optimizer function can be specified in a single JSON file.
One unit test per file will programmatically be added to compare the output with the expected output and show a JSON diff if the test fails.

Several new test cases are added and the previous C++ based unit tests are converted to JSON.

Signed-off-by: Cornelius Claussen <[email protected]>
Signed-off-by: Andreas Heinrich <[email protected]>
Signed-off-by: Piet Gömpel <[email protected]>
@corneliusclaussen corneliusclaussen force-pushed the feature/energymanagement-unit-tests branch from e00f7d6 to f8e39de Compare January 31, 2025 07:21
@corneliusclaussen corneliusclaussen merged commit 6a60ee5 into main Jan 31, 2025
11 checks passed
@corneliusclaussen corneliusclaussen deleted the feature/energymanagement-unit-tests branch January 31, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants