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

[test]: add test case on package cgroup #1868

Conversation

SamYuan1990
Copy link
Collaborator

add test case on package cgroup
remove duplicate function
fix a cache set logic when error happen on code logic

Copy link
Contributor

github-actions bot commented Nov 29, 2024

🤖 SeineSailor

Here is a concise summary of the pull request changes:

Summary: This pull request enhances the cgroup package by adding test cases, refactoring functions, and improving error handling and efficiency. Key modifications include:

  • Added three new tests for the Cache struct
  • Refactored getContainerIDFromCache function for better error handling and efficiency
  • Replaced extractPodContainerIDfromPath with extractPodContainerIDfromPathWithCgroup for enhanced cgroup functionality
  • Fixed cache set logic when an error occurs

Impact: These changes focus on improving cGroup functionality and container management without altering exported function signatures, global data structures, or variables. However, the added test cases and cache set logic fix may affect the code's behavior.

Observations/Suggestions:

  • The changes are well-contained within the cgroup package, making it easier to review and maintain.
  • The added test cases will help ensure the reliability and stability of the cgroup package.
  • It would be beneficial to consider adding more test cases to cover additional scenarios and edge cases.
  • The refactored getContainerIDFromCache function and the replacement of extractPodContainerIDfromPath with extractPodContainerIDfromPathWithCgroup may require additional documentation to ensure clear understanding of the changes.

@SamYuan1990 SamYuan1990 marked this pull request as ready for review November 29, 2024 03:16
@SamYuan1990 SamYuan1990 enabled auto-merge (squash) November 29, 2024 03:18
@SamYuan1990 SamYuan1990 force-pushed the AddTestCaseOnPackagecgroup branch from 520586e to 55b5123 Compare December 5, 2024 10:06
Copy link
Collaborator

@sunya-ch sunya-ch left a comment

Choose a reason for hiding this comment

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

LGTM!

@SamYuan1990 SamYuan1990 merged commit 70145df into sustainable-computing-io:main Dec 5, 2024
22 checks passed
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.

2 participants