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

E2E tests: split transactions test and use more before all instead of beforeEach #2190

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

wilwade
Copy link
Collaborator

@wilwade wilwade commented Oct 20, 2024

Goal

The goal of this PR is to clean up some some small things about the e2e tests

Part of #2154

Discussion

  • Reduce the number of per test transactions by moving some beforeEach actions to the before all
  • Add some additional comments and logs for debugging errors
  • Split up the transaction.test.ts file for parallelization

Testing

make e2e-tests

@wilwade wilwade requested review from a team, shannonwells, mattheworris, enddynayn, aramikm, claireolmstead and JoeCap08055 and removed request for a team October 20, 2024 21:29
const providerId = await createMsaAndProvider(fundingSource, stakingKeys, 'stakingKeys', 10n * CENTS);
const stakingAmount = 1n * DOLLARS;
const providerId = await createMsaAndProvider(fundingSource, stakingKeys, 'stakingKeys', 1n * DOLLARS);
const stakingAmount = 2n * DOLLARS;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These amounts needed to be higher for the variance in the weights

// Stake the amount for each test
await assert.doesNotReject(
stakeToProvider(fundingSource, fundingSource, capacityProvider, numberOfTests * amountStaked)
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instead of staking enough for each call, we instead just stake in the before based on how many tests there are

@@ -757,113 +761,4 @@ describe('Capacity Transactions', function () {
});
});
});

describe('pay_with_capacity_batch_all', function () {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved to transactionsBatch.test.ts

@@ -0,0 +1,132 @@
import '@frequency-chain/api-augment';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved only

@@ -13,6 +13,7 @@ export const fundingSources = [
'capacity-rpcs',
'capacity-staking',
'capacity-transactions',
'capacity-transactions-batch',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Each test must have a unique funding key

Copy link
Collaborator

@saraswatpuneet saraswatpuneet left a comment

Choose a reason for hiding this comment

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

Read through changes was expecting these changes 💯

@wilwade wilwade merged commit 9fd47cf into main Oct 21, 2024
25 checks passed
@wilwade wilwade deleted the chore/e2e-tests-split-and-cleanup branch October 21, 2024 12:59
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