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 pytest - step 2 #554

Merged
merged 16 commits into from
Mar 6, 2024
Merged

Conversation

lekcyjna123
Copy link
Contributor

Next step of adding pytest.

  • a basic configuration for pytest is added
  • a new dependecy to requirements is added

@lekcyjna123 lekcyjna123 added the infrastructure CI, testing, etc. label Jan 1, 2024
@lekcyjna123 lekcyjna123 marked this pull request as draft January 11, 2024 16:59
@lekcyjna123
Copy link
Contributor Author

lekcyjna123 commented Jan 11, 2024

TODO: Update scripts

@lekcyjna123 lekcyjna123 marked this pull request as ready for review February 12, 2024 17:03
@lekcyjna123 lekcyjna123 marked this pull request as draft February 12, 2024 17:12
@lekcyjna123
Copy link
Contributor Author

lekcyjna123 commented Feb 12, 2024

There is still one more race to fix :( This time on result.xml.

@lekcyjna123 lekcyjna123 marked this pull request as ready for review February 12, 2024 18:14
@lekcyjna123 lekcyjna123 requested a review from xThaid February 12, 2024 18:14
@lekcyjna123 lekcyjna123 requested review from tilk, piotro888 and xThaid and removed request for xThaid March 5, 2024 14:37
@@ -0,0 +1,127 @@
from .memory import *
Copy link
Member

Choose a reason for hiding this comment

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

Why the file rename?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be found during discovery procedure. Every file with tests should have either test_ or _test by default. test.py is not correct name in default configuration.
https://doc.pytest.org/en/latest/explanation/goodpractices.html#conventions-for-python-test-discovery

Copy link
Member

Choose a reason for hiding this comment

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

I think that we should separate 'regression' as [external tests that may be run with verilator], apart from [the riscv-tests suite].

In this file MMIO and rv32uc-rvc are both very riscv-test specific, but it also contains regression_body_with_cocotb, verilate_model that seem like they are generic for all verilator regeression test concept.
It was also a problem with previous solution, so maybe it is a good time to separate and generalize it now? Or am I missing something and those would not be useful in more generic context?

Also I think that in test/regression/conftest.py, test collecting functions should be named more to reflect that they are configuring riscv-tests suite and not regression tests in general.

Copy link
Contributor Author

@lekcyjna123 lekcyjna123 Mar 6, 2024

Choose a reason for hiding this comment

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

It is a good point, but I would prefer to do that in separate PR (the one in which multithreading will be added to riscof tests), because regression_body_with_cocotb have some hardcoded values specific for riscv-tests.

Copy link
Member

@piotro888 piotro888 Mar 6, 2024

Choose a reason for hiding this comment

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

Seems fine to me, but please don't forget to also clarify the usage of 'regression' term in all places in that PR :)

Copy link
Member

@piotro888 piotro888 left a comment

Choose a reason for hiding this comment

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

LGTM, only some typos and description suggestions.

test/conftest.py Outdated Show resolved Hide resolved
test/conftest.py Outdated Show resolved Hide resolved
test/regression/conftest.py Outdated Show resolved Hide resolved
@tilk tilk merged commit 01d54f4 into kuznia-rdzeni:master Mar 6, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure CI, testing, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants