-
Notifications
You must be signed in to change notification settings - Fork 201
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 integration tests #3038
Open
darwintree
wants to merge
31
commits into
master
Choose a base branch
from
pytest
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pytest migration
ci: replace integration tests
test: add get_block_by_epoch_number_errors test
chore: change util to module, and reuse epoch errors
tests: add example for framework ussage
add rpc errors
add integration test doc and espace debug trace rpc tests
refactor: remove asyncore dependency in pytest branch
Test/debug trace tests
chore: enable new integration tests in script
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#2944
What is done
This pull request adds new integration written in
pytest
to simplify test , especially rpc test setup. The legacy python tests still exists.Code Organization
integration_tests/conflux/*
: test framework helper code refactored fromtests/conflux/*
(simply code import path)integratioin_tests/test_framework/*
test framework setup code refactored fromtests/integration_tests/test_framework/*
tests/integration_tests/test_framework/test_framework.py
was changed a lot in order to adapt thepytest
test process. The original test entrymain()
is removed and its code is break down and moved into__init__
andteardown
function. Theteardown
function will be called by pytest frameworkintegration_tests/tests/*
: new version integration tests. In*/conftest.py
, pytest fixtures are setup so they can be directly used by testsHow Parallel Testing Works
The
pytest-xdist
plugin enables tests running on different CPUs and in the tests we are using--dist loadscope
to specify tests are distributed in modules (whereas each.py
file). And in pytest fixtures, the fixture scope is set asscope="module"
. This means that tests within a module will be distributed to different CPUs and fixtures will be setup when the module tests starts and will be tear down after the module tests.How Tests can be Migrated or Used
Check
integration_tests/readme.md
.What all Tests be Migrated to the New One
I think no, at least not all, as there is not a must for the migration.
However, rpc tests can be migrated to the new test framework as there is a plan to add more rpc tests under the new test framework. And migration would make it easier to review and check if any edge case were missed
This change is