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

test: compressed bundle size is less than 1MB #56

Merged
merged 2 commits into from
Jan 25, 2024
Merged

Conversation

0xpatrickdev
Copy link
Member

@0xpatrickdev 0xpatrickdev commented Jan 24, 2024

closes #36

✔ build-proposal › proposal builder generates compressed bundles less than 1MB (1.9s)
  ℹ agoric run stdout: agoric: run: Deploy script will run with Node.js ESM
    bundle-source --to /Users/0xpatrick/repos/dapp-offer-up/contract/bundles /Users/0xpatrick/repos/dapp-offer-up/contract/src/offer-up.contract.js offer-up
    creating start-offer-up-permit.json
    creating start-offer-up.js
    You can now run a governance submission command like:
      agd tx gov submit-proposal swingset-core-eval start-offer-up-permit.json start-offer-up.js \
        --title="Enable <something>" --description="Evaluate start-offer-up.js" --deposit=1000000ubld \
        --gas=auto --gas-adjustment=1.2
    Remember to install bundles before submitting the proposal:
      agd tx swingset install-bundle @/Users/0xpatrick/.agoric/cache/b1-88b354fd27623534134d369f89d20bbb7ed82420bba99669eba34a8b1847345ff43418e0c8cf4dac1ed4e8102eca534f5ba7c4e695239f01f074ad84f62cfa74.json
      agd tx swingset install-bundle @/Users/0xpatrick/.agoric/cache/b1-5a4ee4b4f5106eca1ba71fd7f8cf97875f162c2439ca1077375e2adf4a5fe29c4f5b811b1bbc4040e5f45ca617e141f7dc64374660d8945eb8783c7bb8edc22f.json

  ℹ {
      bundleId: 'b1-88b354fd27623534134d369f89d20bbb7ed82420bba99669eba34a8b1847345ff43418e0c8cf4dac1ed4e8102eca534f5ba7c4e695239f01f074ad84f62cfa74',
      compressedSize: '0.3141002655029297 MB',
    }
  ℹ {
      bundleId: 'b1-5a4ee4b4f5106eca1ba71fd7f8cf97875f162c2439ca1077375e2adf4a5fe29c4f5b811b1bbc4040e5f45ca617e141f7dc64374660d8945eb8783c7bb8edc22f',
      compressedSize: '0.1577749252319336 MB',
    }

Questions

  1. I was going to put this in contract/test/test-bundle-source.js, but got confused as that seems to only produces one bundle. Should this test be added there or is this separate file fine?

  2. I'm not sure this will work in CI - ../bundles/bundle-offer-up.js is present in my local but not sure it will be at this point in CI. seems to be fine: https://github.com/Agoric/dapp-offer-up/actions/runs/7647247910/job/20837765045?pr=56#step:7:26

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.

good to have this

I don't understand the motivation to add a dependency on execa, though

contract/test/test-build-proposal.js Outdated Show resolved Hide resolved
@0xpatrickdev 0xpatrickdev force-pushed the test/bundle-size branch 2 times, most recently from 0e925c2 to 4566b43 Compare January 25, 2024 03:14
@0xpatrickdev 0xpatrickdev merged commit 5062aec into main Jan 25, 2024
1 check passed
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.

Test that compressed contract bundles are less than 1MB
2 participants