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

feat(integration-test): use dapp-offer-up as target for getting-start… #8829

Merged
merged 15 commits into from
Mar 13, 2024

Conversation

LuqiPan
Copy link
Contributor

@LuqiPan LuqiPan commented Jan 26, 2024

…ed test

closes: #8381

Description

This PR uses dapp-offer-up in our CI job and (intends to) fix the tests associated with it

Testing Considerations

Gonna make integration tests pass again

@LuqiPan LuqiPan added the force:integration Force integration tests to run on PR label Jan 26, 2024
@0xpatrickdev 0xpatrickdev mentioned this pull request Jan 29, 2024
@LuqiPan LuqiPan force-pushed the 8381-integration-test-with-dapp-offer-up branch 2 times, most recently from 4e586f5 to e9623c8 Compare February 7, 2024 20:12
@LuqiPan LuqiPan force-pushed the 8381-integration-test-with-dapp-offer-up branch 2 times, most recently from b739682 to e72b3b1 Compare February 14, 2024 00:32
@LuqiPan LuqiPan force-pushed the 8381-integration-test-with-dapp-offer-up branch 2 times, most recently from aa2f3e7 to 2b940b8 Compare March 12, 2024 01:37
@LuqiPan LuqiPan marked this pull request as ready for review March 12, 2024 02:24
);
clearInterval(ival);

// Test that the Node.js `-r esm`-dependent plugin works.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remark

I don't know what these ESM plugin tests are about so I removed them

Copy link
Member

Choose a reason for hiding this comment

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

I think we can forget about resm-plugin

detached: true,
});
// yarn start:ui
const uiStartP = yarn(['start:ui']);
finalizers.push(() => pkill(uiStartP.childProcess, 'SIGINT'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

question

I don't know if I need to add finalizers for other yarn commands above?

@LuqiPan LuqiPan requested a review from turadg March 12, 2024 03:54
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

Code LGTM.

I don't know the dapp-offer-up well enough to approve that this covers it so I'll leave Approve to @dckc

);
clearInterval(ival);

// Test that the Node.js `-r esm`-dependent plugin works.
Copy link
Member

Choose a reason for hiding this comment

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

I think we can forget about resm-plugin

clearTimeout(to);
};
// TODO: use abci_info endpoint to get block height
// sleep for 180 seconds for now
Copy link
Member

Choose a reason for hiding this comment

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

this comment will be stale if someone changes the constant.

Suggested change
// sleep for 180 seconds for now
// sleep to let contract start

("for now" is implied by the TODO)

t.is(done, 0, `deploy ${deployCmd.join(' ')} successful before timeout`);
clearTimeout(to);
};
// TODO: use abci_info endpoint to get block height
Copy link
Member

Choose a reason for hiding this comment

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

consider an XXX comment since this is tech debt, but not necessarily something we plan to fix. (unless you do)
https://github.com/Agoric/agoric-sdk/wiki/Coding-Style#code-comments

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.

should start with yarn create ... rather than agoric init ...

...initOptions,
'dapp-foo',
]),
await myMain(['init', ...initOptions, 'dapp-foo']),
Copy link
Member

Choose a reason for hiding this comment

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

As of last Christmas, getting started no longer uses the agoric CLI.

This step should probably be yarn create @agoric/dapp --dapp-template dapp-offer-up dapp-foo

@@ -57,7 +57,7 @@ jobs:
# Prerequisites
- uses: ./.github/actions/restore-node
with:
node-version: 16.x
node-version: 18.18
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the getting started test still clones agoric-sdk. That's no longer part of the workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we still need to clone agoric-sdk, because with yarn create @agoric/dapp ... we're implicitly testing the behavior of init subcommand of agoric-cli package: https://github.com/Agoric/agoric-sdk/blob/master/packages/agoric-cli/src/main.js#L124-L140

Copy link
Member

Choose a reason for hiding this comment

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

Manual testing has confirmed that we don't need to clone agoric-sdk. yarn create @agoric/dapp gets code to run agoric init from npm, not from an agoric-sdk clone. I sure hope we can do likewise in ci.

This ci job says something about a local registry. That's perhaps the way yarn create @agoric/dapp ... gets access to the code under test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This ci job says something about a local registry. That's perhaps the way yarn create @agoric/dapp ... gets access to the code under test.

Yeah I think we start a local NPM registry before running getting-started tests and we publish via a CI specific tag here.

...actually I'm not so sure anymore, just pushed a debug commit to weed out what's using local code and what's using npmjs.com

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK I just confirmed that yarn create @agoric/dapp ... will always pull from npmjs.com and I was not able to find a way to make it pull from local registry with my very limited yarn knowledge. I also confirmed that agoric init ... will use the local registry and code.

Here's what I propose:

  1. in agoric-sdk repo, we use agoric init ... to initialize dapp-offer-up (this PR)
    1. this way, we ensure integration tests in agoric-sdk repo are testing the behavior of agoric init ... at git HEAD, for example, if I change DEFAULT_DAPP_TEMPLATE to something erroneous, integration tests will fail right away
    2. merging this PR would also unblock @turadg's PRs to deprecate support for node 16, add support for node 20, and migrate from yarn classic to yarn modern
  2. in dapp-offer-up repo, we use yarn create @agoric/dapp ... to initialize dapp-offer-up followed by integration tests
    1. this way, we ensure integration tests in dapp-offer-up repo are testing the behavior of agoric init ... that's published on npmjs.com
    2. this work is not scheduled, and IMO is not high priority

@dckc sounds like a plan?

Copy link
Member

Choose a reason for hiding this comment

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

yes. sounds good.

t.is(
await myMain(['init', ...initOptions, 'dapp-foo']),
await yarn(['create', '@agoric/dapp', 'dapp-foo']),
Copy link
Member

Choose a reason for hiding this comment

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

docs include --dapp-template dapp-offer-up options. Maybe those are no longer necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's no longer necessary because #8630 is merged in and released as part of upgrade-14

@LuqiPan LuqiPan force-pushed the 8381-integration-test-with-dapp-offer-up branch 3 times, most recently from e48e0b5 to d1d4d6d Compare March 12, 2024 19:32
@LuqiPan LuqiPan force-pushed the 8381-integration-test-with-dapp-offer-up branch from d1d4d6d to 794d8fe Compare March 12, 2024 21:14
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.

onward

@LuqiPan LuqiPan added the automerge:rebase Automatically rebase updates, then merge label Mar 13, 2024
@mergify mergify bot merged commit 7ba058a into master Mar 13, 2024
74 checks passed
@mergify mergify bot deleted the 8381-integration-test-with-dapp-offer-up branch March 13, 2024 00:31
@LuqiPan
Copy link
Contributor Author

LuqiPan commented Mar 13, 2024

Just realized that I meant to choose automerge:squash but somehow ended up choosing automerge:rebase... Oh well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getting-started CI test should actually track Getting Started docs
3 participants