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

[bridge] refactor test utils #17288

Merged
merged 3 commits into from
Apr 25, 2024

Conversation

longbowlu
Copy link
Contributor

@longbowlu longbowlu commented Apr 23, 2024

Description

This PR:

  1. refactors e2e test utils by introducing BridgeTestClusterBuilder and BridgeTestCluster
  2. enables the ability to drop spawned BridgeNodes, and restart them (not in this PR, but this PR makes it easy to do)
  3. speeds up the setup by doing things in parallel. This probably cuts at least 20 seconds for each test.

Test plan

existing tests


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented Apr 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 6:34pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Apr 23, 2024 6:34pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Apr 23, 2024 6:34pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Apr 23, 2024 6:34pm

@longbowlu longbowlu changed the title stash [bridge] refactor test utils Apr 23, 2024
@longbowlu longbowlu marked this pull request as ready for review April 23, 2024 20:26
}
}

impl BridgeTestClusterBuilder {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Contributor

@dariorussi dariorussi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!
feel free to go in or address comments if you care.
Not a big deal either way

}

pub fn sui_client(&self) -> SuiClient {
self.test_cluster.fullnode_handle.sui_client.clone()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we could clone on the caller side and return a reference?

}

pub fn bridge_authority_key(&self, index: usize) -> BridgeAuthorityKeyPair {
self.test_cluster.bridge_authority_keys.as_ref().unwrap()[index].copy()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy on the client?

}

pub fn sui_rpc_url(&self) -> String {
self.test_cluster.fullnode_handle.rpc_url.clone()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clone on the client?

}

pub fn eth_rpc_url(&self) -> String {
self.eth_environment.rpc_url.clone()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clone on the client?

@longbowlu longbowlu merged commit fa91a50 into feature/native-bridge Apr 25, 2024
78 checks passed
@longbowlu longbowlu deleted the restart-bridge-node-in-mem branch April 25, 2024 20:39
patrickkuo pushed a commit that referenced this pull request May 2, 2024
## Description 

This PR:
1. refactors e2e test utils by introducing `BridgeTestClusterBuilder`
and `BridgeTestCluster`
2. enables the ability to drop spawned BridgeNodes, and restart them
(not in this PR, but this PR makes it easy to do)
3. speeds up the setup by doing things in parallel. This probably cuts
at least 20 seconds for each test.

## Test plan 

existing tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 8, 2024
## Description 

This PR:
1. refactors e2e test utils by introducing `BridgeTestClusterBuilder`
and `BridgeTestCluster`
2. enables the ability to drop spawned BridgeNodes, and restart them
(not in this PR, but this PR makes it easy to do)
3. speeds up the setup by doing things in parallel. This probably cuts
at least 20 seconds for each test.

## Test plan 

existing tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description 

This PR:
1. refactors e2e test utils by introducing `BridgeTestClusterBuilder`
and `BridgeTestCluster`
2. enables the ability to drop spawned BridgeNodes, and restart them
(not in this PR, but this PR makes it easy to do)
3. speeds up the setup by doing things in parallel. This probably cuts
at least 20 seconds for each test.

## Test plan 

existing tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description 

This PR:
1. refactors e2e test utils by introducing `BridgeTestClusterBuilder`
and `BridgeTestCluster`
2. enables the ability to drop spawned BridgeNodes, and restart them
(not in this PR, but this PR makes it easy to do)
3. speeds up the setup by doing things in parallel. This probably cuts
at least 20 seconds for each test.

## Test plan 

existing tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description 

This PR:
1. refactors e2e test utils by introducing `BridgeTestClusterBuilder`
and `BridgeTestCluster`
2. enables the ability to drop spawned BridgeNodes, and restart them
(not in this PR, but this PR makes it easy to do)
3. speeds up the setup by doing things in parallel. This probably cuts
at least 20 seconds for each test.

## Test plan 

existing tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
patrickkuo pushed a commit that referenced this pull request May 9, 2024
## Description 

This PR:
1. refactors e2e test utils by introducing `BridgeTestClusterBuilder`
and `BridgeTestCluster`
2. enables the ability to drop spawned BridgeNodes, and restart them
(not in this PR, but this PR makes it easy to do)
3. speeds up the setup by doing things in parallel. This probably cuts
at least 20 seconds for each test.

## Test plan 

existing tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
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.

3 participants