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 Test Codes #54

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Add Test Codes #54

wants to merge 7 commits into from

Conversation

RexWzh
Copy link

@RexWzh RexWzh commented Dec 19, 2024

Add Test Codes

Hi @lenianiva, could you review the test setup in this PR?

Changes Made

  1. The other PR's tests passed successfully. Some of the statements need fixing, check the LSP here as commented before.

  2. Added pytest framework, migrate unitests from server.py to test_server.py

You can run the test suite with:

pytest -s tests/

Next Steps

  • Add GitHub workflow for automated testing
  • Integrate Codecov to avoid potential bugs (optional)
  • Fix bugs appears in the action, checked by pytest tests -m error

For error cases, we could fix in a new PR to simplify the review process?

Please let me know if you'd like any further adjustments.

pyproject.toml Show resolved Hide resolved
@lenianiva
Copy link
Owner

lenianiva commented Dec 20, 2024

I'm a bit concerned about adding minif2f to the unit testing pipeline. Building mathlib takes a while. If it is just mathlib we could lake exe cache get but Pantograph has to work in a mathlib-independent way. How long does it take to build the library?

Can you set it up so that instead of using an example skeleton project with mathlib as a dependency, the minif2f tests directly run with project root pointing to Mathlib? This way we can leverage lake exe cache get and it would run much faster.

@RexWzh RexWzh marked this pull request as ready for review December 20, 2024 20:16
@RexWzh
Copy link
Author

RexWzh commented Dec 20, 2024

Can you set it up so that instead of using an example skeleton project with mathlib as a dependency, the minif2f tests directly run with project root pointing to Mathlib? This way we can leverage lake exe cache get and it would run much faster.

You might approve this PR to run the actions, or check it here https://github.com/Lean-zh/PyPantograph/pull/2/checks
image

@pytest.mark.advance
def test_load_theorem(minif2f_server: Server, minif2f_test: DataFrame, minif2f_valid: DataFrame):
"""Comprehensive test for loading multiple theorems.
use pytest -m "not advance" to skip this test.
Copy link
Author

Choose a reason for hiding this comment

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

use pytest -m "not advance" instead to skip some tests if it takes too long.

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.

2 participants