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

feat(pytest): directly create properties file and release tarball from fill #627

Merged

Conversation

danceratopz
Copy link
Member

@danceratopz danceratopz commented Jun 13, 2024

🗒️ Description

Adds some release-specific requirements directly to fill command:

  1. If --output=fixtures.tgz is specified, then additionally create the tarball. From the help:

    --output OUTPUT       Directory path to store the generated test fixtures. Can be
                        deleted. If the specified path ends in '.tar.gz', then the
                        specified tarball is additionally created (the fixtures are
                        still written to the specified path without '.tar.gz' suffix).
                        Default: './fixtures'.
    
  2. Always writes a fixtures build properties file fixtures.ini to the output directory. A build name may be specified via --build-name:

    --build-name BUILD_NAME
                        Specify a build name for the fixtures.ini file, e.g.,
                        'stable'
    
  3. Uses 1. and 2. in .github/actions/build-fixtures/action.yaml.

Example fixture build properties file (--build-name=eip7692):

; File describing fixture build properties

[fixtures]
timestamp = 2024-06-13T14:35:59.172865
build = eip7692
commit = 5a91d041d2081f36cc12bbe6f5b896651655fab5
command_line_args = fill --output=fixtures_eip7692.tar.gz tests/berlin/ -k not Paris and not hive --build-name=eip7692

[packages]
pytest = 7.4.4
pluggy = 1.5.0

[plugins]
cov = 4.1.0
xdist = 3.6.1
metadata = 3.1.1
html = 4.1.1

[tools]
t8n = evm version 1.14.1-unstable-d6e91e2e-20240507
solc = 0.8.24+commit.e11b9ed9.Linux.gpp

[environment]
python = 3.10.12
platform = Linux-5.15.0-112-generic-x86_64-with-glibc2.35

🔗 Related Issues

None

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@danceratopz danceratopz added scope:pytest Scope: Changes EEST's pytest plugins scope:ci Scope: Continuous Integration labels Jun 13, 2024
@danceratopz danceratopz changed the title feat: directly create properties file and release tarball feat(fill): directly create properties file and release tarball Jun 13, 2024
@danceratopz danceratopz changed the title feat(fill): directly create properties file and release tarball feat(pytest): directly create properties file and release tarball from fill Jun 13, 2024
@danceratopz
Copy link
Member Author

danceratopz commented Jun 13, 2024

Tested with this Github Actions Workflow: https://github.com/danceratopz/execution-spec-tests/actions/runs/9500351128/job/26183213458

Example artifact ("stable"): https://github.com/danceratopz/execution-spec-tests/actions/runs/9500351128/artifacts/1598139447
which has the fixtures.properties:

[fixtures]
timestamp = 2024-06-13T13:16:17.589569
build = stable
ref = refs/heads/feat/directly-create-release-tarball
commit = 097e5edc73b649c9eac82ec3dfbbe08ce31628e9
command_line_args = fill -n auto --evm-bin=evm --output=fixtures_stable.tar.gz --build-name stable

[packages]
pytest = 7.4.4
pluggy = 1.5.0

[plugins]
html = 4.1.1
metadata = 3.1.1
xdist = 3.6.1

[tools]
t8n = evm version 1.14.6-unstable-86150af2-20240612
solc = 0.8.21+commit.d9974bed.Linux.gpp

[environment]
python = 3.11.9
platform = Linux-6.5.0-1021-azure-x86_64-with-glibc2.35
ci = true

@danceratopz
Copy link
Member Author

Renamed the "properties" file from fixtures.properties to fixtures.ini: We're using the python standard library's configparser module to write this file which creates a file in the .ini file format (this output is not valid .properties format due to the sections, e.g., [fixtures]).

This file is mainly intended for internal EEST use (consume) but might be useful to other people. Ini format should be readable by most languages, but feel free to change it to JSON (@marioevz, @spencer-tb).

Copy link
Member

@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 great, thanks!

@marioevz marioevz merged commit 3226979 into ethereum:main Jun 18, 2024
5 checks passed
@marioevz marioevz deleted the feat/directly-create-release-tarball branch June 18, 2024 22:00
@pdobacz
Copy link
Collaborator

pdobacz commented Jun 20, 2024

@marioevz I've noticed that this might have changed the layout of the release artifact - inside the .tar.gz file one now has the intermediate dir with a suffix, i.e. fixtures_eip7692 dir, instead of just fixtures. Was this change intended?

Unless I've misconfigured sth on my end, you can take a look at such release here - fixtures_eip7692 inside. Compare with a previous one - fixtures inside.

@marioevz
Copy link
Member

@pdobacz I think you're right, let me dig into the changes and see how we can fix it, thanks for pointing this out!

pdobacz added a commit to ethereum/evmone that referenced this pull request Jun 20, 2024
spencer-tb pushed a commit that referenced this pull request Jun 26, 2024
…m fill (#627)

* feat(fill): enable release tarball creation directly from fill

* feat(fill): write a properties file to the output dir

* feat(ci): use fill's properties and tar.gz features in ci

* refactor(fw): use std lib's configparser for properties file

* tests(fw): add test for fill's property file

* feat(fill): write pytest-metadata props to fixtures.properties

* docs: update changelog

* docs: update fill --help output

* chore(fill): improve docstring readability

* chore(fill): improve docstring readability

* fix(fill): use .ini instead of .properties for build props file

* docs: update due to renaming .properties -> .ini

* chore: update whitelist

* fix(fill): add ci to environment section in fixtures.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:ci Scope: Continuous Integration scope:pytest Scope: Changes EEST's pytest plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants