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

The last person will never get a feedback from the current round #315

Open
anapaulagomes opened this issue Jul 15, 2019 · 1 comment
Open
Labels
bug Something isn't working

Comments

@anapaulagomes
Copy link
Contributor

https://github.com/Thermondo/stanley/blob/ebfdf01e97d465594dfd07e49e4c7fc276c57c56/stanley/helpers.py#L61-L63

All members but the sender will be able to receive feedback.

@anapaulagomes anapaulagomes added the bug Something isn't working label Jul 15, 2019
@anapaulagomes anapaulagomes mentioned this issue Aug 30, 2019
4 tasks
@anapaulagomes
Copy link
Contributor Author

I wrote this test to reproduce this behavior:

def test_feedback_round(slack_api_call_mock, slack_post_message_mock):
    sender_receiver_pattern = re.compile(r'\@\w+')
    senders = []
    receivers = []

    def ask_feedback():
        request_feedback()
        call_args = str(slack_post_message_mock.call_args)
        sender, receiver = re.findall(sender_receiver_pattern, call_args)

        assert sender != receiver

        senders.append(sender)
        receivers.append(receiver)

    # since we have 4 members, each one should give/receive feedback 
    # 3 times (12 in a full round)
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()
    ask_feedback()

    assert len(senders) == 12
    assert len(receivers) == 12

    for sender in set(senders):
        assert senders.count(sender) == 3

    for receiver in set(receivers):
        assert receivers.count(receiver) == 3

For correctness, this test should be run many times in a row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant