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

Simulation test for ViewChanger #1095

Merged
merged 13 commits into from
Feb 22, 2019

Conversation

skhoroshavin
Copy link
Member

No description provided.

Sergey Khoroshavin added 13 commits February 21, 2019 12:08
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
…ough

Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>
Signed-off-by: Sergey Khoroshavin <sergey.khoroshavin@dsr-corporation.com>

@st.composite
def pool_model_events(draw, node_count):
greek_names = ['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta']
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW we already have greek.py helper methods

Copy link
Member Author

Choose a reason for hiding this comment

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

I felt like we have something like this, and I tried to find it, but failed. Thanks for finally pointing where it is located!


settings.register_profile("big", buffer_size=128 * 1024, max_examples=1000)
settings.load_profile("big")

Copy link
Contributor

Choose a reason for hiding this comment

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

I would separate into separate modules

  • helper (events-models) classes
  • tests for helper classes
  • real property based tests (like this file)
    , so that it's clear what property tests we have, and what files need to executed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, although if at some point in future we get approval to add Hypothesis as test dependency then this can be reduced to just two separate modules:

  • simulation helper classes
  • tests for simulation helper classes

And real simulation tests can be put next to other tests related to tested part of production code


@staticmethod
def _sort_nodes(nodes: Tuple[str, str]):
if nodes[0] > nodes[1]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we intentionally compare two strings here? Why do we need to do this sort?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is intentional. If we have nodes A and B we don't want to store whether they have connectivity or not separately for A-B and B-A. This is solved nicely by sorting tuples before accessing underlying dictionary.

@ashcherbakov ashcherbakov merged commit c849e40 into hyperledger:master Feb 22, 2019
@skhoroshavin skhoroshavin deleted the refactor-vc3 branch February 22, 2019 13:31
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.

None yet

2 participants