Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] service dialog regex validation #10038

Merged

Conversation

dgaikwad
Copy link
Contributor

@dgaikwad dgaikwad commented Apr 6, 2020

Purpose or Intent

Adding test to check is validation regex text filter working or not

PRT Run

{{pytest: cfme/tests/services/test_dialog_regex_validation_in_catalog.py::test_dialog_regex_validation_button cfme/tests/services/test_dialog_regex_validation_in_catalog.py::test_dialog_element_regex_validation --long-running -v}}

@dgaikwad dgaikwad changed the title [WIPTEST] service dialog regex validation [RFR] service dialog regex validation Apr 6, 2020
@dajoRH dajoRH removed the WIP-testing label Apr 6, 2020
Copy link
Contributor

@john-dupuy john-dupuy left a comment

Choose a reason for hiding this comment

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

Since the only thing you are changing between and the two element_data's is the validation field, I think we could clean this up a bit. Consider the following example:

@pytest.fixture
def my_fixture(request):
    element_data = {"a": 1, "b": 2, "c": request.param["c"]}
    yield element_data


@pytest.mark.parametrize("my_fixture", [{"c": "blah-blah-blah"}, {"c": "hehehehe"}], indirect=True)
def test_blah(my_fixture):
    print(my_fixture)

Which, when run yields:

test_groups.py::test_blah[my_fixture0] PASSED                            [ 50%]{'a': 1, 'b': 2, 'c': 'blah-blah-blah'}

test_groups.py::test_blah[my_fixture1] PASSED                            [100%]{'a': 1, 'b': 2, 'c': 'hehehehe'}

I think we can do something similar here that will avoid the lengthy parametrization on each test case.

@john-dupuy john-dupuy changed the title [RFR] service dialog regex validation [WIPTEST] service dialog regex validation Apr 6, 2020
@dgaikwad dgaikwad force-pushed the test_dialog_regex_validation_button branch from db450e2 to 43bc561 Compare April 8, 2020 05:31
@dajoRH
Copy link
Contributor

dajoRH commented Apr 8, 2020

I detected some fixture changes in commit 43bc561

The local fixture dialog_cat_item is used in the following files:

  • cfme/tests/services/test_dialog_regex_validation_in_catalog.py
    • test_dialog_element_regex_validation
    • test_dialog_regex_validation_button

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@dgaikwad dgaikwad changed the title [WIPTEST] service dialog regex validation [RFR] service dialog regex validation Apr 8, 2020
@dgaikwad
Copy link
Contributor Author

dgaikwad commented Apr 8, 2020

@john-dupuy All changes are done, please review PR

@dajoRH dajoRH removed the WIP-testing label Apr 8, 2020
Copy link
Contributor

@john-dupuy john-dupuy left a comment

Choose a reason for hiding this comment

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

Awesome 👍

@john-dupuy john-dupuy changed the title [RFR] service dialog regex validation [1LP][RFR] service dialog regex validation Apr 8, 2020
@mshriver mshriver self-assigned this Apr 9, 2020
@john-dupuy john-dupuy added the test-cleanup Test removal, collection changes, re-organization label Apr 9, 2020
@mshriver mshriver merged commit 9a2f554 into ManageIQ:master Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lint-ok test-cleanup Test removal, collection changes, re-organization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants