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

testing API to extend ava functional tests to end-to-end context #8963

Open
dckc opened this issue Feb 22, 2024 · 1 comment
Open

testing API to extend ava functional tests to end-to-end context #8963

dckc opened this issue Feb 22, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request test

Comments

@dckc
Copy link
Member

dckc commented Feb 22, 2024

What is the Problem Being Solved?

We currently duplicate effort for functional tests:

  • once as an ava test
  • again for testing on a live chain

Description of the Design

The walletFactoryDriver used in bootstrap tests gives an API that is close to what a live chain client can do via RPC / LCD.

Based on some brainstorming in Agoric/dapp-agoric-basics#12 , it looks feasible to have a shared interface between mock / in-memory testing and live chain testing and switch between them based on an environment variable or some such.

The API seems to be something roughly like...

  return {
    agoricNames: vq.query.lookup('agoricNames'),
    installBundles,
    runCoreEval: info => runCoreEval(t, info, { agd, blockTool }),
    provisionSmartWallet: (address, amount) =>
      provisionSmartWallet(address, amount, { agd, blockTool, lcd }),
  };

https://github.com/Agoric/dapp-agoric-basics/blob/9e3d865b3cf3997683364a7b831c0ef11375a51c/contract/test/e2e-tools.js#L441-L447

Security Considerations

n/a

Scaling Considerations

n/a

Test Plan

re-use tests between in-memory/mock testing and live chain testing

Upgrade Considerations

@dckc
Copy link
Member Author

dckc commented Jun 10, 2024

another copy of some of these tools is going into...

mergify bot added a commit that referenced this issue Jun 13, 2024
closes: #XXXX
refs: #8896

## Description

- Creates `@agoric/multichain-testing` package outside of the yarn workspace
- Provides a containerized, multi-chain testing environment for local and CI testing using [cosmology-tech/starship](https://github.com/cosmology-tech/starship/tree/devnet-0.2.2)
    - The current `config.yaml` includes agoric, osmosis, cosmos, and hermes relayers between each. A chain registry (served over http), faucet, and block explorer are also provided).
- Provides an ava test setup for accessing a chain registry, creating wallets, and requesting faucet funds
- Ports utilities from `@agoric/synthetic-chain` and `dapp-agoric-basics` that help towards a smart wallet client that can execute offers.

### Security Considerations

### Scaling Considerations

Taking on some tech debt here wrt smart wallet utilities and being DRY, but we plan to address this in future. See #8963

### Documentation Considerations

README.md documentation for running the service is provided.

### Testing Considerations

The goal of this PR is to build greater confidence in our software via automated testing with fully-simulated chains.

### Upgrade Considerations
mergify bot added a commit that referenced this issue Nov 6, 2024
closes: #10168

## Description
Provide a new package, `client-utils`, as a home for utilities that are useful to clients of an Agoric chain. This doesn't currently use `@agoric/rpc` but over time some of it may be pushed down into that package. 

Related work…

- #9200 
This will be where those client factories are kept.

- #10369

This will solve most of what we need for functional testing. Some aspects are specific to the A3P synthetic chain (like account addresses and references to history) but most of what the tests are doing with the chain are operations that any client might do.

- #9109
- #8963

This will contribute to those goals.


### Security Considerations

Reduces authority needed to query chain (from child_process to fetch)

### Scaling Considerations
This is a big package, but it's not to be run on chain. Most client apps use some form of code shaking so they'll only take what they need.

### Documentation Considerations
Once this settles down it ought to be a part of docs.agoric.com

### Testing Considerations
The only test yet is a live one to make sure a query to Emerynet for Swingset params succeeds as expected, even under SES.

No package CI yet. Mostly it's refactoring of existing code so those uses serve as coverage. I do think this would benefit from some additional testing.

### Upgrade Considerations
Will never be on chain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request test
Projects
None yet
Development

No branches or pull requests

1 participant