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 package and pytest config files (mario + dan) #11

Conversation

danceratopz
Copy link
Owner

@danceratopz danceratopz commented May 12, 2023

This builds on the initial branch and work from @marioevz in marioevz:refactor-pytest-config-files.

# tox profile for framework
tox -e py3
# tox profile for fillers
tox -e fillers

# fill the tests; generate fixtures:
pytest
# run the framework tests:
pytest -c pytest-framework.ini

marioevz and others added 9 commits May 11, 2023 17:44
The top-level package 'test-filler' included the sub-packages defined in setup.cfg (evm_block_builder, evm_transition_tool, ethereum_test_forks, ethereum_test_tools and pytest_plugins), but didn't include any of the sub-packages contained within these (ethereum_test_tools.forks for example). As tox ran on an installed (incorrect) build of this package, any commands ran that triggered imports of these sub-packages failed, as they were simply not present. Now setuptools 'find_packages' automatically includes all sub-packages contained in these directories.
This fixes mypy errors for fillers that haven't yet been converted to pytest format. Note that the import of the decorators (test_from, etc) and the decorators.py module are flagged to be ignored by mypy using a '# type: ignore' line. The errors are caused because the types in the fill_test function signature have changed.

This code should be removed again before merging the pytest feature branch to main.
@danceratopz danceratopz changed the title [Draft] Refactor pytest config files dan [Draft] Refactor pytest config files (mario + dan) May 12, 2023
@danceratopz danceratopz changed the title [Draft] Refactor pytest config files (mario + dan) Refactor pytest config files (mario + dan) May 12, 2023
@danceratopz danceratopz changed the title Refactor pytest config files (mario + dan) Refactor package and pytest config files (mario + dan) May 12, 2023
@danceratopz danceratopz requested a review from marioevz May 12, 2023 14:21
Copy link
Collaborator

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

This is just absolutely perfect, it's amazing how everything just works 😀

Just a small thing I'd like to get your opinion on regarding the settings.json, but otherwise I think it's very very good and we should merge this.

.vscode/settings.json Show resolved Hide resolved
@danceratopz danceratopz merged commit 73bc923 into feature/use-pytest-to-collect-and-hydrate-test-fillers-v2 May 12, 2023
2 checks passed
@danceratopz danceratopz deleted the refactor-pytest-config-files-dan branch June 23, 2023 06:42
danceratopz added a commit that referenced this pull request Apr 23, 2024
* feat(all): add EOF fixture format and test spec

* feat(tests): add EOF example

* feat(fw): EOF library

tools/vm: EOF opcode changes

tools: CREATE3 helper

tox: EOF Keywords

post rebase changes: align EOF tests with main.

Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

post rebase: tox fixes.

Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

Fix existing EOF tests (#11)

Co-authored-by: Hugo <jhugodc@gmail.com>

* new(tests): prague: EOF V1 tests

tests/eof: move to prague

tests/eof: fixes

post rebase changes: align EOF tests with main. (tests)

Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

post rebase: tox fixes (tests).

Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

Fix existing EOF tests (tests) (#11)

Co-authored-by: Hugo <jhugodc@gmail.com>

* refactor(fw): EOF container code

* fix(fw): vm: re-order JUMPDEST, NOOP

* fix(fw): cli tests

* fix(tests): refactor fixes

* fix(fw): eof: fix raw bytes processing

* fix(tests): eof: change `test_code_validation.py` to use `EOFTestFiller`

* eof unit tests

* fix eof exceptions

* refactor(fw): compute_create3_address

* fix(tests): tox

* refactor(fw): eof_v1: use pydantic

* fix(fw): tpx

* fix(fw): RJUMPV custom dataportion parser

* fix(tests): eofv1: RJUMPI calls

* new(fw): RJUMPV unit test

* feat(fw): subscriptable opcodes

* fix(fw): Opcode add, mul

* fix(tests): test hardcoding bytecode of initcode

* fix(fw): fix

* fix(tests): eof: fix RJUMP*, CALLF data portions

* hack(fw): Add str as allowed EOF exception

* fix(tests): eof: fix test_execution_function.py

* changelog

* chore: add unknown words to dictionary

* fetch exceptions with evmone
lots of TODOs

* eof .py test example

* fix(fw): add unchecked_stack opcode property (CALLF)

* refactor(fw): eof: refactor and add section creation helpers

* fix: tox

* fix(tests): eof: refactor

* refactor(tests): replace Section(kind=, with Section.Code, Section.Data

* fix(fw): eof: consistent magic, version, and header terminator types.

* fix(fw): eof: proper magic

* rm(tests): eof: duplicate prague folder with redundant examples

* fix(fw): eof: data-container body order

* docs: add EOF

* fix(docs): word

* fix(tests): eof: file rename

---------

Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: Hugo <jhugodc@gmail.com>
Co-authored-by: danceratopz <danceratopz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants