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

chore(tests): update ANT test to only deploy once, install husky, setup initial unit tests #17

Merged
merged 7 commits into from
Dec 11, 2023

Conversation

dtfiedler
Copy link
Collaborator

These tests take a while to set up, to so avoid deploying multiple ANTs, we deploy one and use it throughout each test.

These tests take a while to set up, to so avoid deploying multiple ANTs, we deploy one and use it throughout each test.
@dtfiedler dtfiedler requested a review from a team as a code owner December 11, 2023 15:27
@dtfiedler dtfiedler changed the title chore(tests): update ANT test to only deploy once chore(tests): update ANT test to only deploy once, install husky Dec 11, 2023
Comment on lines -120 to -127
it.each([
{
transactionId: 'NEWnqsybd98-DRk6F6wdbBSkTouUShmnIA-pW4N-Hzs', // too short
ttlSeconds: -MIN_TTL_LENGTH,
},
{
transactionId: 'bad record', // too short
ttlSeconds: MIN_TTL_LENGTH,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we will move these to unit tests

Comment on lines 202 to 216
it.each([
{
subDomain: '@',
transactionId: 'CTRLqsybd98-DRk6F6wdbBSkTouUShmnIA-pW4N-Hzs',
expect(state.records[subDomain]).toEqual({
transactionId: antContractOwnerAddress,
ttlSeconds: MIN_TTL_LENGTH,
},
{
subDomain: 'same_as_root',
transactionId: 'CTRLqsybd98-DRk6F6wdbBSkTouUShmnIA-pW4N-Hzs',
ttlSeconds: MIN_TTL_LENGTH,
},
{
subDomain: 'remove_this',
ttlSeconds: MIN_TTL_LENGTH * 2,
transactionId: 'CTRLajVdPOhf3fCFDbrRuZXVRhhgNOJjbmgp8kjl2Jc',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same with these

Comment on lines -31 to -35
global.arlocal = arlocal;
global.arweave = arweave;
global.wallets = wallets;
global.contractIds = contractIds;
global.warp = warp;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this does not work as you think it does @atticusofsparta

package.json Show resolved Hide resolved
Comment on lines -30 to -33
const ANT = await ANTDeployer(warp, {
address: defaultOwner[0],
wallet: defaultOwner[1],
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

deploying an ANT for every test increases total testing time, so we now only deploy once

@dtfiedler dtfiedler changed the title chore(tests): update ANT test to only deploy once, install husky chore(tests): update ANT test to only deploy once, install husky, add unit tests Dec 11, 2023
beforeEach(async () => {
const { wallet, address } = await getLocalWallet(arweave);
// deploy a separate contract for this test
const { contractTxId } = await deployANTContract({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

since we cannot guarantee order of execution - and the result of this test will impact our ability to run other calls on the existing ANT contract - we deploy a separate one. this adds overhead - but prevents inconsistent testing results.

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@dtfiedler dtfiedler changed the title chore(tests): update ANT test to only deploy once, install husky, add unit tests chore(tests): update ANT test to only deploy once, install husky, setup initial unit tests Dec 11, 2023
@dtfiedler dtfiedler merged commit 441cf11 into main Dec 11, 2023
5 checks passed
@dtfiedler dtfiedler deleted the PE-3569-ant-tests branch December 11, 2023 18:35
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