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

Refactor: allocation tests #520

Merged
merged 6 commits into from
Feb 1, 2023

Conversation

mymphe
Copy link
Contributor

@mymphe mymphe commented Jan 31, 2023

Changes:

  • update SR allocation tests broken as a result of recent refactoring and interface changes
  • refactor SR allocation tests:
    - combine multiple test cases into a single unit test to prevent standard output flooding
    - remove redundant test cases
  • combine multiple MinFirstAllocationStrategy 0.8.9 tests into a single unit test to prevent standard output flooding
  • combine multiple MinFirstAllocationStrategy 0.4.24 tests into a single unit test to prevent standard output flooding
  • uses the common test suite for both modern and legacy library consumers

Copy link
Member

@folkyatina folkyatina left a comment

Choose a reason for hiding this comment

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

Can we DRY this two test files somehow?
They differ only in two lines and there is a ton of code to check it twice.

@mymphe
Copy link
Contributor Author

mymphe commented Jan 31, 2023

Can we DRY this two test files somehow? They differ only in two lines and there is a ton of code to check it twice.

Good idea. Moved it to common tests

Copy link
Member

@krogla krogla left a comment

Choose a reason for hiding this comment

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

lgtm

@arwer13
Copy link
Contributor

arwer13 commented Jan 31, 2023

Fixed merge conflicts. Got one test failure:

  1) Contract: MinFirstAllocationStrategy
       Modern (Solidity 0.8.9)
         allocateToBestCandidate()
           multiple buckets
             should allocate to various number of buckets under different parameters:

      AssertionError: Allocations mismatch: [950,5076,7420,7335,7820,950,2046,4338,2172,7647,1456,4479] [5483,3226,7786,1839,1148,3877,5344,870,1979,3351,1618,107] 821. Expected: [1360,5076,7420,7335,7820,950,2046,4338,2172,7647,1456,4479] Actual [1361,5076,7420,7335,7820,950,2046,4338,2172,7647,1456,4479] expected 410 to equal 411: expected '411' to equal '410'
      + expected - actual

@mymphe could you have a look please?

@arwer13 arwer13 merged commit 8273d02 into feature/shapella-upgrade Feb 1, 2023
@arwer13 arwer13 deleted the refactor/allocation-tests branch February 1, 2023 08:05
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