-
Notifications
You must be signed in to change notification settings - Fork 21
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
Generate model paths for end2end tests at build. #136
Conversation
When webnn_native gets built under .\third_party, the model paths are incorrectly specified as always being relative to webnn_root (ex. ."\node\"). This PR specifies the model directory using an absolute path so the E2E tests can run under third_party/webnn_native without failure.
_data_path = rebase_path(_models_folder_relative_path, webnn_root) | ||
_webnn_root_data_path = | ||
get_path_info("${webnn_root}" + "${_data_path}", "dir") | ||
_models_folder_absolute_path = rebase_path(_webnn_root_data_path) |
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.
Maybe the end_2_end can't be run if all binaries are packaged to run in other directory?
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.
@fujunwei, we should be able to run the end2end tests from any directory (eg. under .\third_party), so long as they don't assume to load files using relative paths (ex. node\folder).
This is how _models_folder_absolute_path
gets set, eg. C:\Users\bryan\src\webnn_native\node\models
or C:\Users\bryan\src\<some project>\third_party\webnn_native\node\modes
, depending on webnn_root.
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.
We will public webNN-native with node.js to npm, users get the package and install in their local system that is not the webnn_root(C:\Users\bryan\src), it will fail to run?
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.
@fujunwei, we can't run these tests with an unresolved install-time path (custom path vs DEPS). This change assumes DEPS path is used, like how BUILD.gn locates source-files. If the user wants to install their own custom node
package, they (still) need to use the same path (install under .\node
) or say, be given an option to override the DEPS path.
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.
@fujunwei PTAL. We cannot run end2end tests under .\third_party
without this fix.
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.
Let's merge it first, we can add the relative path option to run model test when we have the requirement. Thanks.
When webnn_native gets built under .\third_party, the model paths
are incorrectly specified as always being relative to webnn_root (ex. ."\node").
This PR specifies the model directory using an absolute path so the E2E tests can run under third_party/webnn_native without failure.
@huningxin @fujunwei