Making End-to-End Tests Idempotent #142
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Type:
Refactoring, Tests
PR Description:
This PR refactors the end-to-end tests to make them idempotent. This means that the tests can be run multiple times without resetting the test environment. The changes include updating the collection IDs to be dynamic and not hardcoded, and checking for non-zero balances instead of a specific balance in the genesis account.
PR Main Files Walkthrough:
files:
ownership-chain/e2e-tests/tests/test-create-collection.ts
: The hardcoded collection IDs have been replaced with dynamic IDs. The collection ID is now obtained from the result of the createCollection method. This change makes the tests idempotent.ownership-chain/e2e-tests/tests/test-evolution.ts
: The hardcoded collection ID has been removed from the global variable. This change is part of the effort to make the tests idempotent.ownership-chain/e2e-tests/tests/test-web3api.ts
: The check for the genesis account balance has been updated. Instead of checking for a specific balance, the test now checks if the balance is greater than zero. This change makes the test more flexible and idempotent.