This repository was archived by the owner on Oct 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Create utf unit tests for build_component.py.
#31
Open
XuefengHuang
wants to merge
22
commits into
SeattleTestbed:add-unittests
Choose a base branch
from
XuefengHuang:unittests
base: add-unittests
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Create utf unit tests for build_component.py.
#31
XuefengHuang
wants to merge
22
commits into
SeattleTestbed:add-unittests
from
XuefengHuang:unittests
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The unit test check if copy_to_target(file_expr, target) works fine.
The unit test checks if copy_tree_to_target(source, target, ignore=None) works fine.
The unit test checks if build_component.py can copy files to subdirectories of the build target dir.
The unit test checks if help_exit(errMsg, parser) works fine.
The unit test checks if replace_string(old_string, new_string, file_name_pattern="*") works fine.
The unit test checks if build_component.py works fine.
The unit test checks if process_mix function works fine.
Added a pattern of the file name arg to test if this function can reduce the number of files we look at.
tests/ut_common_copyfilessubdir.py
Outdated
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to refactor this to
- Build a dummy component specific to this unit test,
- which has a separate build config,
- and instead of re-reading the build config, compare the resulting file list after building with a hardcoded file list.
This avoids testing the correctness of a function (reading in the build config in this case) using the same function (i.e. the code below this comment, copied in from build_component.py)
I build a dummy component specific to this unit test which has a separate build config, and instead of re-reading the build config, compare the resulting file list after building with a hardcoded file list.
In the past, it only can delete one .DS_Store. If there are more than one .DS_Store, it cannot delete them all. Now I use for loop to fix it.
Using two spaces per indent level instead of tab.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I add some unit tests to check if these functions work fine and results are correct in
build_component.py. I add cloning and copying ofseattlelib_v2repo because I need extra files to testprocess_mix()function.I have tested them on Mac OS X system. There is my test result: