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

chore: add SKIP_EXTENSION_SETUP flag to avoid duplicate wallet setup #79

Merged
merged 1 commit into from
May 10, 2024

Conversation

rabi-siddique
Copy link
Contributor

@rabi-siddique rabi-siddique commented Apr 29, 2024

In end-to-end test cases, the wallet is set up twice because @agoric/synpress has code in the before 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 the SKIP_EXTENSION_SETUP environment variable to true. This avoids redundant wallet setups.

@rabi-siddique rabi-siddique requested a review from dckc April 29, 2024 07:19
@@ -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",
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@rabi-siddique rabi-siddique requested a review from dckc May 10, 2024 09:24
Copy link
Member

@dckc dckc left a 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.

@rabi-siddique rabi-siddique merged commit 9b3cc90 into Agoric:main May 10, 2024
2 checks passed
@rabi-siddique
Copy link
Contributor Author

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? :)

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.

2 participants