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

Generate model paths for end2end tests at build. #136

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

bbernhar
Copy link
Contributor

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

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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

@fujunwei fujunwei merged commit 5c4637c into webmachinelearning:main Sep 30, 2021
@bbernhar bbernhar deleted the fix_test_paths branch December 7, 2021 22:56
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.

None yet

2 participants