Skip to content

Replace devnet CI with comprehensive localnet testing - #110

Merged
gregnazario merged 3 commits into
mainfrom
localnet-comprehensive-testing
May 20, 2026
Merged

Replace devnet CI with comprehensive localnet testing#110
gregnazario merged 3 commits into
mainfrom
localnet-comprehensive-testing

Conversation

@gregnazario

Copy link
Copy Markdown
Contributor

Summary

  • Delete the flaky devnet-examples.yaml workflow. Devnet CI was failing on faucet rate limits and shared-network instability.
  • Rename localnet-examples.yaml to Localnet Tests and have it run make integration_test, make examples, and make examples_cli against the already-spawned localnet, so each PR gets a deterministic run that also exercises the user-facing python -m examples.X entry path.
  • Un-stub three previously dead return'd integration tests: test_aptos_token, test_multisig, and test_large_package_publisher. The "needs an aptos-core checkout" reason for multisig is already satisfied by APTOS_CORE_PATH in CI.
  • In examples/large_package_publisher.py, derive a LARGE_PACKAGE_CLIENT_CONFIG (via dataclasses.replace) with max_gas_amount=1_000_000 so chunked publishing no longer runs out of gas under the shared 100k example cap.

Test plan

  • New Localnet Tests workflow passes on this PR (integration_test + examples + examples_cli)
  • test_aptos_token, test_multisig, and test_large_package_publisher all pass against the in-CI localnet
  • make fmt, make lint, and make test remain green locally

Devnet CI was flaky due to faucet rate limits and shared-network
instability. Move all example execution onto the already-spawned
localnet so each PR gets a deterministic, controlled-state run.

- Delete devnet-examples.yaml; rename localnet-examples.yaml to
  "Localnet Tests" and have it run integration_test, examples, and
  examples_cli against the in-CI localnet.
- Un-stub test_aptos_token, test_multisig, and test_large_package_publisher
  in examples/integration_test.py. The "needs aptos core checkout" reason
  for multisig is already satisfied by APTOS_CORE_PATH in CI.
- In examples/large_package_publisher.py, derive a LARGE_PACKAGE_CLIENT_CONFIG
  with max_gas_amount=1_000_000 so chunked publishing no longer runs out of
  gas under the example-shared 100k cap.
@gregnazario
gregnazario requested a review from a team as a code owner May 20, 2026 21:09
@codecov

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.23%. Comparing base (268d99b) to head (abd6851).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #110   +/-   ##
=======================================
  Coverage   79.23%   79.23%           
=======================================
  Files          56       56           
  Lines        5100     5100           
=======================================
  Hits         4041     4041           
  Misses       1059     1059           
Flag Coverage Δ *Carryforward flag
v1-sdk 66.30% <ø> (ø)
v2-sdk 96.97% <ø> (ø) Carriedforward from cf90e4f

*This pull request uses carry forward flags. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR shifts CI coverage from flaky shared devnet runs to deterministic localnet-based testing, and re-enables previously skipped integration tests to ensure key examples stay working in CI.

Changes:

  • Remove the devnet examples GitHub Actions workflow and expand the localnet workflow to run integration tests plus example entrypoints.
  • Un-skip three integration tests (aptos_token, multisig, large_package_publisher) now that localnet CI provides the required environment.
  • Increase the gas cap used by the large package publisher example by deriving a higher-gas ClientConfig.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
examples/large_package_publisher.py Uses a higher max_gas_amount config for chunked publishing to avoid out-of-gas failures.
examples/integration_test.py Re-enables previously stubbed integration tests so they run against localnet in CI.
.github/workflows/localnet-examples.yaml Renames the workflow and runs make integration_test, make examples, and make examples_cli against CI localnet.
.github/workflows/devnet-examples.yaml Deletes the devnet-based workflow to avoid flaky shared-network failures.
Comments suppressed due to low confidence (3)

examples/integration_test.py:81

  • Typo in test name: test_read_aggreagtor is misspelled (should be test_read_aggregator). Renaming it will make test output/searching more consistent with the imported module read_aggregator.

    async def test_read_aggreagtor(self):
        from . import read_aggregator

        await read_aggregator.main()

examples/large_package_publisher.py:43

  • This example requests 1_000_000_000 octas in a single faucet call. That conflicts with the comment in examples/common.py stating devnet faucet requests are capped at ~100_000_000 octas per request. Either the comment is outdated or this example won’t work on devnet with default envs; consider splitting funding into multiple capped requests or updating the shared documentation/config to match current faucet behavior.

    alice = Account.generate()
    await faucet_client.fund_account(alice.address(), 1_000_000_000)
    await aptos_sdk_cli.publish_package(

examples/large_package_publisher.py:60

  • These three faucet calls each request 1_000_000_000 octas. Per examples/common.py, devnet faucets may cap per-request funding at ~100_000_000 octas, so the example’s default devnet configuration may not match its funding strategy. Consider splitting into multiple smaller requests or parameterizing the funding amount/cap by network, and/or updating the shared comment/config if the cap assumption is no longer true.
    alice = Account.generate()
    req0 = faucet_client.fund_account(alice.address(), 1_000_000_000)
    req1 = faucet_client.fund_account(alice.address(), 1_000_000_000)
    req2 = faucet_client.fund_account(alice.address(), 1_000_000_000)
    await asyncio.gather(*[req0, req1, req2])

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CI exposed two distinct failures the silent `return` stubs were hiding:

1. examples/multisig.py: the aptos CLI's compiled-script filename in
   `bytecode_scripts/` no longer includes the `_0` index suffix that the
   older Move toolchain emitted. Glob for `set_and_transfer*.mv` so the
   example works against both old and new CLI versions.

2. examples/integration_test.py::test_large_package_publisher: the
   `large_packages` chunked-publishing helper Move package was relocated
   out of aptos-core (only the `large_package_example` consumer remains),
   so we can't publish the helper to localnet from the aptos-core checkout.
   Use self.skipTest with a clear reason instead of letting it error,
   pending either embedding the helper source here or aptos-core
   restoring it.
The examples_cli target invokes hello_blockchain, object_code_deployment,
and your_coin as standalone scripts, but all three require positional CLI
arguments (contract address or package directory) that the Makefile
doesn't supply -- so the target asserts on argv length and fails before
doing any work.

make integration_test already exercises hello_blockchain and your_coin
end-to-end via the test harness (publish contract, then call main with
the address). object_code_deployment is not covered there but doesn't
add unique CI signal worth the breakage cost.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread examples/multisig.py
Comment on lines +420 to +426
script_glob = (
f"{packages_dir}/upgrade/build/UpgradeAndGovern/bytecode_scripts/set_and_transfer*.mv"
)
script_matches = glob.glob(script_glob)
if not script_matches:
raise FileNotFoundError(f"No compiled script found matching {script_glob}")
with open(script_matches[0], "rb") as f:
Comment on lines +51 to +59
- name: Run integration tests on localnet
run: make integration_test
shell: bash
timeout-minutes: 20

- name: Run examples on localnet
run: make examples
shell: bash
timeout-minutes: 20
@gregnazario
gregnazario merged commit 533221a into main May 20, 2026
11 checks passed
@gregnazario
gregnazario deleted the localnet-comprehensive-testing branch May 20, 2026 22:53
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