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

Add a GitHub Action to lint and test Python code #13

Closed
wants to merge 12 commits into from

Conversation

cclauss
Copy link

@cclauss cclauss commented Apr 15, 2023

The code in this repo is vendored into V8 and contains the only Python Syntax Errors in the V8 codebase that ruff is able to find. So let's put some automated testing in place.

Fixes #8 (This was broken in #4.)
Fixes #10 (This should have been merged when it was proposed.)
Fixes #11 (The solution in #10 was better.)
Similar to #7 (This should have been merged when it was proposed.)

Test results: https://github.com/cclauss/test262-harness-py/actions

  1. Lint with https://beta.ruff.rs/docs
  2. Test with https://docs.pytest.org

Fix Python Syntax Errors:
Use python-modernize to remove Python 3 syntax errors without breaking compatibility with legacy Python 2.

python-modernize --fix print  --write src/test262.py src/_packager.py
python-modernize --fix except --write src/test262.py

pytest initially failed because of #8 so...


% pytest --ignore=test/test_common.py --ignore=test/test_parseTestRecord.py

============================= test session starts ==============================
platform linux -- Python 3.10.6, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/runner/work/test262-harness-py/test262-harness-py
collected 37 items

test/test_monkeyYaml.py ............................                     [ 75%]
test/test_test262.py .........                                           [100%]

=============================== warnings summary ===============================
[ ... ]
======================= 37 passed, 24 warnings in 0.09s ========================

My bet would be that the remaining failing tests in test/test_common.py and test/test_parseTestRecord.py could be fixed by completely or partially reverting #4

@erights @jugglinmike @richardlau @gsnedders @mi-ac Your reviews, please.

@cclauss cclauss changed the title Add a GitHub Action to lint Python code Add a GitHub Action to lint and test Python code Apr 15, 2023
@cclauss cclauss closed this Feb 10, 2024
@cclauss cclauss deleted the master-1 branch February 10, 2024 10:06
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.

Doesn't run? (stripHeader undefined?)
1 participant