-
Notifications
You must be signed in to change notification settings - Fork 5
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
chore: add SKIP_EXTENSION_SETUP flag to avoid duplicate wallet setup #79
chore: add SKIP_EXTENSION_SETUP flag to avoid duplicate wallet setup #79
Conversation
@@ -7,7 +7,7 @@ | |||
"dev": "vite", | |||
"build": "tsc && vite build", | |||
"test": "vitest spec", | |||
"test:e2e": "EXTENSION=keplr synpress run --configFile=test/e2e/synpress.config.cjs", | |||
"test:e2e": "SKIP_EXTENSION_SETUP=true EXTENSION=keplr synpress run --configFile=test/e2e/synpress.config.cjs", |
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.
how does the account with the spike siege world rather ...
mnemonic get set up?
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.
Are you trying to set up this account locally, Dan?
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.
no; I'm trying to understand how test:e2e
works when skipping extension set-up.
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.
Normally, when we don't pass the SKIP_EXTENSION_SETUP
flag, it executes the setupWallet
method inside the before
hook present in this file of @agoric/synpress
.
When we pass SKIP_EXTENSION_SETUP
and set it to true
in test:e2e
, the setupWallet
function is not executed inside the before
hook.
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.
The implementation for setupWallet
is defined over here
It tends to use a hard-coded mnemonic orbit bench unit...
if we don't pass secretWords
to the setupWallet
.
I am going to eliminate this though. Instead of using a hard-coded value, we'll use the one passed via the environment variable. Right now, we accept the environment variable(SECRET_WORDS
) for mnemonic but don't use its value. HERE.
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'm a little swapped out on the details, but this looks pretty low risk in any case.
We can set up a meeting sometime and discuss this? :) |
In end-to-end test cases, the wallet is set up twice because
@agoric/synpress
has code in thebefore
hook that sets up the wallet before running tests. Check the code here.However, since there is a specific test for setting up the wallet in
dapp-offer-up
in this file, we can skip the setup done by@agoric/synpress
by setting theSKIP_EXTENSION_SETUP
environment variable to true. This avoids redundant wallet setups.