-
Notifications
You must be signed in to change notification settings - Fork 679
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
fix(test): test nearlib key path #2885
Conversation
@ailisp is error you are getting related to https://discordapp.com/channels/490367152054992913/557983089704566787/725088894466523258 ? |
I think yes 👍 |
@vgrichina pass after Bowen's fix. ptal |
@@ -16,19 +16,23 @@ git clone https://github.com/near/create-near-app.git | |||
# Make sure to use local nearcore for tests | |||
export NODE_ENV=local | |||
|
|||
SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |||
export HOME=$SRC_DIR/../testdir |
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.
it's a bit concerning we have to override HOME
. Why? Shouldn't it be possible to pass NEAR home dir explicitly to start_unittest.py (same as you can specify it explicitly with nearup)?
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.
both create-near-app and near-api-js (when NODE_ENV is local) assume validator_key.json is at process.env.HOME/.near/validator_key.json
so this has to be overrided. It's fine to override home even when run locally, because it only in the sub-shell, won't affect HOME after script exit
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 should fix in near-api-js and create-near-app side:
https://github.com/near/near-api-js/blob/master/test/config.js#L38
https://github.com/near/create-near-app/blob/master/blank_react_project/src/config.js#L44
But i think it's okay to override $HOME as it's only used in nearcore integration test, not worthy to not hard code in near-api-js/create-near-app
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.
@ailisp what is default path when I run local nearcore instance? Is it process.env.HOME/.near/validator_key.json
? Or did it change? I think it did change for nearup
, right?
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.
Yes nearup change it to be HOME/.near/localnet/validator_key.json
, however the test here isn't using, maybe i should replace it using nearup localnet.
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.
Created separate issue to track local dev env fixes:
near/devx#221
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.
see comments
|
||
# Run near-shell tests |
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.
@ailisp do you plan to enable these in follow up PR?
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.
This still fails of missing masterAccount param, will fix later
This Fix #2580, and also eliminate warnings appears in near-api-js about validator_key.json
Test Plan
test_nearlib.sh should work both locally and on CI