#99 fix fedmsg tests to include 'scenario' in fake result
Merged by jskladan. Opened by dcallagh.
taskotron/ dcallagh/resultsdb fix-pr93-tests  into  develop

Download 99.patch

Fixes a test failure introduced in PR#93:

____________________________________ TestFuncCreateFedmsg.test_get_prev_result_different_scenario _____________________________________
self = <testing.functest_create_fedmsg.TestFuncCreateFedmsg instance at 0x7fa56fd487a0>
    def test_get_prev_result_different_scenario(self):
        data = copy.deepcopy(self.ref_result_data)
        data['scenario'] = data['scenario'] + '.fake'
        self.helper_create_result(data=data)
        prev_result = apiv2.get_prev_result(self.ref_result_obj)
>       assert prev_result is None
E       assert <resultsdb.models.results.Result object at 0x7fa570038150> is None
testing/functest_create_fedmsg.py:217: AssertionError

Btw how would you feel about a PR to refactor these fedmsg tests to use more "real" objects instead of the fake ones?

I have also been wondering about the best way to cover the Stomp messaging plugin... In another project in the past, I have had some success with writing functional tests which send actual messages to a real qpidd process. I personally like that style of testing because it proves that all the pieces really work, with no fake stuff in the test code...

@dcallagh what do you mean by "more real" objects?

I would not mind at all. At the moment, I'd still probably prefer for it to be "two staged" so we can keep the mock-messaging-based-testing, and add the "real deal" on top of that. And when/if the stomp ends up not being needed, we could get rid of it.

@ralph what do you think?

Also, I'll spin up a ticket for the conversation to take place, and link it.

Commit d4960203 fixes this pull-request

Pull-Request has been merged by jskladan

Pull-Request has been merged by jskladan

https://pagure.io/taskotron/resultsdb/issue/100

Metadata