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

Add Path Validation and Environment Loading to TreeNode Class #6064

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qisijia367
Copy link

This pull request introduces path validation and environment loading functionality to the TreeNode class. The changes ensure that the path provided during initialization is valid and that environment variables can be correctly loaded into the node's environment.

This pull request introduces path validation and environment loading functionality to the TreeNode class. The changes ensure that the path provided during initialization is valid and that environment variables can be correctly loaded into the node's environment.

Signed-off-by: qisijia <[email protected]>
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 31.91489% with 32 lines in your changes missing coverage. Please review.

Project coverage is 54.47%. Comparing base (6b55d5a) to head (273de37).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
avocado/core/tree.py 31.91% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6064      +/-   ##
==========================================
+ Coverage   54.46%   54.47%   +0.01%     
==========================================
  Files         202      202              
  Lines       21883    21928      +45     
==========================================
+ Hits        11919    11946      +27     
- Misses       9964     9982      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@richtja richtja left a comment

Choose a reason for hiding this comment

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

Hi @qisijia367, thank you very much for these changes, contributions are always welcome. Unfortunately, your patch changes TreeNode behaviour because it doesn't count with corner case where the path is only the root path / which is valid.

Can you please update your patch to respect the root path? Also, can you please add test which will tests the behaviour of TreeNodeEnvOnly with path ending with /?Thank you.

This pull request addresses issues related to invalid paths and the root path name in the `TreeNodeEnvOnly` class. Specifically, it ensures that `ValueError` is raised for all invalid paths and fixes the issue where the root path name was incorrectly set to an empty string, and relevant test cases have been added in selftests/unit/tree.py and tested successfully.

Signed-off-by: qisijia <[email protected]>
@qisijia367
Copy link
Author

Hi @richtja,Thank you for your suggestions, I have optimized the code again and added some test cases in selftests/unit/tree.py. Please check if they meet the requirements.
截图_选择区域_20241107170739

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review Requested
Development

Successfully merging this pull request may close these issues.

2 participants