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

Run TS SDK tests against local testnets built from prod branches, split API and Rust node API client checks into separate job #8769

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

banool
Copy link
Contributor

@banool banool commented Jun 21, 2023

Description

Currently we run the TS SDK tests against a local testnet built from the same commit. So if you make a PR, it will run a local testnet built from the code in that PR and then run the tests against it. This helps check for compatibility between the SDK and main but that's actually not really necessary. Instead, what matters is confirming that the SDK is compatible with each of the production networks. As such, in this PR I make it that the SDK runs against local testnets built from the production networks (devnet, testnet, mainnet).

To ensure compatibility we run these tests on main and on PRs to check for changes to the SDK that could break compatibility with the production networks.

One nice benefit of this change is the SDK tests no longer have to wait for the whole image build phase, it can just run immediately.

I also switch up publish_ans_contract.ts to make the retries actually work in CI. They didn't previously because we weren't deleting the ANS directory properly, so now we use temp directories. The way I do it has to workaround the following issues that GitHub the company probably won't fix any time soon:

After removing the TS SDK tests, I spit the remaining stuff into two separate workflows too:

  1. I put the API + spec + generated TS code compatibility tests into their own workflow.
  2. I put the Rust SDK client tests into their own workflow. This workflow works the same as the TS SDK tests, in which we run the code against three different local testnets.

Note: With this new setup, it means that some of the tests as they are now don't work against testnet and mainnet because the fungible asset module is not deployed there yet. To fix this, I made the tests run conditionally depending on the NETWORK env var. I also improved the error messages by making the test suite check that the txns are successful.

This addresses #8740.

Test Plan

CI. I tested it with pull_request instead of pull_request_target and the relevant tests (the api compatibility tests) worked.

The Rust node API client tests are flaky because of this toolchain issue. It is not related to this PR, I have seen them pass.

I also ran the TS SDK tests locally and they worked.

@banool banool force-pushed the banool/sdk-tests-all-networks branch 5 times, most recently from 7b1e077 to 55224ee Compare June 21, 2023 11:00
@banool banool added CICD:build-images when this label is present github actions will start build+push rust images from the PR. CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR labels Jun 21, 2023
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@banool banool force-pushed the banool/sdk-tests-all-networks branch 3 times, most recently from 6d08de5 to 7450405 Compare June 21, 2023 11:44
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@banool banool force-pushed the banool/sdk-tests-all-networks branch 2 times, most recently from a34efaf to aad288d Compare June 21, 2023 12:08
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Contributor

@0xmaayan 0xmaayan left a comment

Choose a reason for hiding this comment

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

BEAUTIFUL!

@@ -15,13 +15,22 @@ const publisher = new AptosAccount(
const alice = new AptosAccount();
const bob = new AptosAccount();
let fungibleAssetMetadataAddress = "";

// Do not run these tests if the network is testnet / mainnet right now.
let maybe;
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

// CI, it is essential that TMPDIR is set to a directory that can actually be mounted.
// Learn more here: https://stackoverflow.com/a/76523941/3846032.
console.log("---creating temporary directory for ANS code---");
let tempDir = execSync("mktemp -d").toString("utf8").trim();
Copy link
Contributor

Choose a reason for hiding this comment

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

mktemp create a temp directory? how is it a "temp" directory? is it get self destroyed once the process is done?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite, it gets cleaned up by the OS at some point, where that exact point is vague and mysterious but will happen eventually. On Mac OS it's roughly 3 days or when you're running out of space.

@github-actions

This comment has been minimized.

@banool banool force-pushed the banool/sdk-tests-all-networks branch from b59fd61 to a768529 Compare June 21, 2023 16:10
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@gregnazario gregnazario enabled auto-merge (squash) June 21, 2023 16:27
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

✅ Forge suite land_blocking success on a7685294c0b0ddab509ee2f33886b65eaa00d584

performance benchmark : committed: 5425 txn/s, submitted: 5426 txn/s, expired: 1 txn/s, latency: 7251 ms, (p50: 5100 ms, p90: 15300 ms, p99: 27400 ms), latency samples: 2316558
Max round gap was 1 [limit 4] at version 868034. Max no progress secs was 3.952009 [limit 10] at version 868034.
Test Ok

@github-actions
Copy link
Contributor

✅ Forge suite compat success on testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> a7685294c0b0ddab509ee2f33886b65eaa00d584

Compatibility test results for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> a7685294c0b0ddab509ee2f33886b65eaa00d584 (PR)
1. Check liveness of validators at old version: testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b
compatibility::simple-validator-upgrade::liveness-check : committed: 8433 txn/s, latency: 4082 ms, (p50: 3700 ms, p90: 6700 ms, p99: 8800 ms), latency samples: 303620
2. Upgrading first Validator to new version: a7685294c0b0ddab509ee2f33886b65eaa00d584
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 4294 txn/s, latency: 7489 ms, (p50: 8800 ms, p90: 9900 ms, p99: 10200 ms), latency samples: 163180
3. Upgrading rest of first batch to new version: a7685294c0b0ddab509ee2f33886b65eaa00d584
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 4765 txn/s, latency: 6655 ms, (p50: 7100 ms, p90: 8700 ms, p99: 9100 ms), latency samples: 181100
4. upgrading second batch to new version: a7685294c0b0ddab509ee2f33886b65eaa00d584
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 6238 txn/s, latency: 5318 ms, (p50: 4900 ms, p90: 8500 ms, p99: 10300 ms), latency samples: 212120
5. check swarm health
Compatibility test for testnet_2d8b1b57553d869190f61df1aaf7f31a8fc19a7b ==> a7685294c0b0ddab509ee2f33886b65eaa00d584 passed
Test Ok

@github-actions
Copy link
Contributor

✅ Forge suite framework_upgrade success on aptos-node-v1.3.0_3fc3d42b6cfe27460004f9a0326451bcda840a60 ==> a7685294c0b0ddab509ee2f33886b65eaa00d584

Compatibility test results for aptos-node-v1.3.0_3fc3d42b6cfe27460004f9a0326451bcda840a60 ==> a7685294c0b0ddab509ee2f33886b65eaa00d584 (PR)
Upgrade the nodes to version: a7685294c0b0ddab509ee2f33886b65eaa00d584
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 4987 txn/s, latency: 6358 ms, (p50: 6300 ms, p90: 9200 ms, p99: 16300 ms), latency samples: 189540
5. check swarm health
Compatibility test for aptos-node-v1.3.0_3fc3d42b6cfe27460004f9a0326451bcda840a60 ==> a7685294c0b0ddab509ee2f33886b65eaa00d584 passed
Test Ok

@banool banool disabled auto-merge June 21, 2023 21:10
@banool
Copy link
Contributor Author

banool commented Jun 21, 2023

All other checks are green except for https://github.com/aptos-labs/aptos-core/actions/runs/5336576362/jobs/9671938125?pr=8769. This is a shadow of the past, just kept around by pull_request_target, it will be gone when I land this. Force landing now.

@banool banool merged commit 75f48f8 into main Jun 21, 2023
@banool banool deleted the banool/sdk-tests-all-networks branch June 21, 2023 21:11
gerben-stavenga pushed a commit that referenced this pull request Jun 23, 2023
banool added a commit that referenced this pull request Jul 7, 2023
xbtmatt pushed a commit to xbtmatt/aptos-core that referenced this pull request Jul 25, 2023
xbtmatt pushed a commit to xbtmatt/aptos-core that referenced this pull request Jul 25, 2023
gedigi pushed a commit that referenced this pull request Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:build-images when this label is present github actions will start build+push rust images from the PR. CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants