Skip to content

regenesis-surgery: refactor tests#1689

Closed
tynes wants to merge 1 commit intoregenesis/0.5.0from
fix/tests-with-genesis-provider
Closed

regenesis-surgery: refactor tests#1689
tynes wants to merge 1 commit intoregenesis/0.5.0from
fix/tests-with-genesis-provider

Conversation

@tynes
Copy link
Contributor

@tynes tynes commented Nov 4, 2021

Description

Update the regenesis surgery tests to use the GenesisJsonProvider.
Remove hardhat to test with and use ts-mocha instead.

Update the regenesis surgery tests to use the `GenesisJsonProvider`.
Remove hardhat to test with and use `ts-mocha` instead.
@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2021

⚠️ No Changeset found

Latest commit: 4861dca

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tynes
Copy link
Contributor Author

tynes commented Nov 4, 2021

For some reason, not all of the tests run when running yarn test:surgery - it only runs the provider tests. Individual tests can be ran with ts-mocha --timeout 500000 test/<specific-file>. Perhaps it has something to do with the async nature of loading the test data.

accs = env.getAccountsByType(AccountType.UNISWAP_V3_OTHER)
})

// TODO: for some reason these tests fail
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps due to a config issue

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to account for the update to the WETH address

@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2021

Codecov Report

Merging #1689 (4861dca) into regenesis/0.5.0 (8f21774) will increase coverage by 8.27%.
The diff coverage is n/a.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           regenesis/0.5.0    #1689      +/-   ##
===================================================
+ Coverage            72.72%   81.00%   +8.27%     
===================================================
  Files                   69       47      -22     
  Lines                 2273     1437     -836     
  Branches               336      214     -122     
===================================================
- Hits                  1653     1164     -489     
+ Misses                 620      273     -347     
Flag Coverage Δ
batch-submitter ?
contracts 87.96% <ø> (ø)
core-utils 58.52% <ø> (ø)
data-transport-layer ?
message-relayer ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/batch-submitter/src/index.ts
packages/message-relayer/hardhat.config.ts
...itter/src/batch-submitter/state-batch-submitter.ts
...ckages/data-transport-layer/src/utils/constants.ts
...ckages/data-transport-layer/src/utils/contracts.ts
.../batch-submitter/src/transaction-chain-contract.ts
packages/data-transport-layer/src/utils/index.ts
...ices/l1-ingestion/handlers/state-batch-appended.ts
packages/message-relayer/src/relay-tx.ts
.../l1-ingestion/handlers/sequencer-batch-appended.ts
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f21774...4861dca. Read the comment docs.

@annieke
Copy link
Contributor

annieke commented Nov 4, 2021

is the current integration test failu re a flaky test? seems unrelated https://github.com/ethereum-optimism/optimism/runs/4100597218?check_suite_focus=true#step:11:172

console.log('Initializing pre GenesisJsonProvider...')
// Convert the genesis dump into a genesis file format
const genesis = { ...this.surgeryDataSources.genesis }
for (const account of this.surgeryDataSources.genesisDump) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be iterating over this.surgeryDataSources.dump instead, since the state dump is the one with the accounts?

throw new Error('Must initialize with genesis or state object')
}

this._isProvider = false
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit, isLiveProvider instead?

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 is part of the Provider interface

})

it('should have the same code as on mainnet', async () => {
if (!env.hasLiveProviders()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this test should be runnable w/o a live provider as long as you have a connection to ETH?


describe('V3 NFPM', () => {
it('should have the same code as on mainnet', async () => {
if (!env.hasLiveProviders()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above w/r/t being runnable


describe('V3 pools', () => {
before(async () => {
it('Pools', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of these tests should be runnable

accs = env.getAccountsByType(AccountType.UNISWAP_V3_OTHER)
})

// TODO: for some reason these tests fail
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to account for the update to the WETH address

@annieke annieke mentioned this pull request Nov 4, 2021
@tynes tynes closed this Nov 5, 2021
@maurelian maurelian deleted the fix/tests-with-genesis-provider branch December 6, 2022 20:57
theochap pushed a commit that referenced this pull request Dec 10, 2025
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.

4 participants