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

Test BZ 1242534 #2724

Merged
merged 1 commit into from Sep 3, 2015
Merged

Test BZ 1242534 #2724

merged 1 commit into from Sep 3, 2015

Conversation

Ichimonji10
Copy link
Contributor

Listing a content view filter's rules succeeds when the content view filter is
of type "rpm" or "package_group". It fails when the content view filter is of
type "erratum".

Test results without @skip_if_bug_open decorator:

$ nosetests tests/foreman/api/test_contentviewfilter.py:BZ1242534TestCase
E..
======================================================================
ERROR: @Test: Search for an erratum content view filter's rules.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ichimonji10/code/robottelo/robottelo/common/decorators.py", line 372, in wrapper_func
    return func(*args, **kwargs)
File "/home/ichimonji10/code/robottelo/tests/foreman/api/test_contentviewfilter.py", line 617, in test_search_erratum
    entities.ContentViewFilterRule(content_view_filter=cv_filter).search()
File "/home/ichimonji10/code/nailgun/nailgun/entity_mixins.py", line 1243, in search
    results = self.search_json(fields, query)['results']
File "/home/ichimonji10/code/nailgun/nailgun/entity_mixins.py", line 1096, in search_json
    response.raise_for_status()
File "/home/ichimonji10/.virtualenvs/robottelo2/lib/python2.7/site-packages/requests/models.py", line 851, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 500 Server Error: Internal Server Error

----------------------------------------------------------------------
Ran 3 tests in 10.545s

FAILED (errors=1)

Test results with decorator applied:

(robottelo2)[ichimonji10@beech:robottelo]$ nosetests tests/foreman/api/test_contentviewfilter.py:BZ1242534TestCase
S..
----------------------------------------------------------------------
Ran 3 tests in 6.881s

OK (SKIP=1)

See: https://bugzilla.redhat.com/show_bug.cgi?id=1242534#c5

@Ichimonji10
Copy link
Contributor Author

Depends on SatelliteQE/nailgun#193.

@oshtaier
Copy link
Contributor

oshtaier commented Sep 2, 2015

In my opinion, it will be better to use new content view per each filter (use setUp instead setUpClass)

@oshtaier
Copy link
Contributor

oshtaier commented Sep 2, 2015

Could we have better name for our new class? Something not related to BZ ID as when defect get to VERIFIED state, it will be not actual to have name like that anymore

@oshtaier
Copy link
Contributor

oshtaier commented Sep 2, 2015

ACK pending comments

@Ichimonji10
Copy link
Contributor Author

Could we have better name for our new class? Something not related to BZ ID as when defect get to VERIFIED state, it will be not actual to have name like that anymore

Any suggestions? The point of that test case is to test that one bug.

It seems these three test cases verify basic search functionality for content view filters. I would recommend something like ContentViewFilterSearchTestCase. We can expand that class further in future

That bug will not disappear from bugzilla when it changes to the "VERIFIED" state.

We are trying to get rid any references to BZ after defect is resolved. We have in plans to review code once a month to remove not actual @skip_if_bug_open statements at all.

In my opinion, it will be better to use new content view per each filter (use setUp instead setUpClass)

Why? Creating one content view in each test confers no benefit and makes the test longer.

It is more correct from QA point of view, but it is not critical for sure

@Ichimonji10
Copy link
Contributor Author

It seems these three test cases verify basic search functionality for content view filters. I would recommend something like ContentViewFilterSearchTestCase. We can expand that class further in future

That makes sense. I'll do that.

It is more correct from QA point of view, but it is not critical for sure

I see the benefit to making the test cases more independent. If there's an issue with making multiple content view filters that point to a single content view, then our tests will break! But that's not the case right now. And if there is, we can easily adjust the test suite. I'm trying to balance the desire for full test separation against the desire for speedy test runs.

@oshtaier
Copy link
Contributor

oshtaier commented Sep 2, 2015

Sure. Thanks

Listing a content view filter's rules succeeds when the content view filter is
of type "rpm" or "package_group". It fails when the content view filter is of
type "erratum".

Test results without `@skip_if_bug_open` decorator:

    $ nosetests tests/foreman/api/test_contentviewfilter.py:SearchTestCase
    E..
    ======================================================================
    ERROR: @test: Search for an erratum content view filter's rules.
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "/home/ichimonji10/code/robottelo/robottelo/common/decorators.py", line 372, in wrapper_func
        return func(*args, **kwargs)
    File "/home/ichimonji10/code/robottelo/tests/foreman/api/test_contentviewfilter.py", line 617, in test_search_erratum
        entities.ContentViewFilterRule(content_view_filter=cv_filter).search()
    File "/home/ichimonji10/code/nailgun/nailgun/entity_mixins.py", line 1243, in search
        results = self.search_json(fields, query)['results']
    File "/home/ichimonji10/code/nailgun/nailgun/entity_mixins.py", line 1096, in search_json
        response.raise_for_status()
    File "/home/ichimonji10/.virtualenvs/robottelo2/lib/python2.7/site-packages/requests/models.py", line 851, in raise_for_status
        raise HTTPError(http_error_msg, response=self)
    HTTPError: 500 Server Error: Internal Server Error

    ----------------------------------------------------------------------
    Ran 3 tests in 10.545s

    FAILED (errors=1)

Test results with decorator applied:

    $ nosetests tests/foreman/api/test_contentviewfilter.py:SearchTestCase
    S..
    ----------------------------------------------------------------------
    Ran 3 tests in 6.881s

    OK (SKIP=1)

See: https://bugzilla.redhat.com/show_bug.cgi?id=1242534#c5
@Ichimonji10
Copy link
Contributor Author

The tests still act as expected:

$ nosetests tests/foreman/api/test_contentviewfilter.py:SearchTestCase
S..
----------------------------------------------------------------------
Ran 3 tests in 9.609s

OK (SKIP=1)

@elyezer
Copy link
Contributor

elyezer commented Sep 2, 2015

ACK

1 similar comment
@oshtaier
Copy link
Contributor

oshtaier commented Sep 3, 2015

ACK

oshtaier added a commit that referenced this pull request Sep 3, 2015
@oshtaier oshtaier merged commit f7f5af0 into SatelliteQE:master Sep 3, 2015
@Ichimonji10 Ichimonji10 deleted the bz-1242534 branch September 3, 2015 13:37
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

3 participants