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

[1LP][RFR] Add customer scenario marker/filter, move tier and requirement markers #9225

Merged
merged 1 commit into from
Aug 30, 2019

Conversation

mshriver
Copy link
Member

@mshriver mshriver commented Aug 20, 2019

  1. Change how the tier and requirement markers are registered
  2. Remove unused node annotation logic
  3. Update pytest-polarion-collect and other polarion packages
  4. Add a marker/filter for customerscenario meta in polarion

Changes to test_advanced_search are to repair its metadata collection and to prevent exceptions from pytest-polarion-collect during collection.

@@ -66,6 +66,7 @@ docstrings:
# default for manual mark is 'notautomated'
# @pytest.mark.manual('manualonly') to set 'manualonly'
linkedWorkItems: "@pytest.mark.requirements"
customerscenario: "@pytest.mark.requirements.customer_stories"
Copy link
Member Author

Choose a reason for hiding this comment

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

Not possible to set meta with these markers, evaluating if its worth supporting this. Could also be set via BZ marker if by resolving items attached to the BZ.

@dajoRH dajoRH added the lint-ok label Aug 20, 2019
@mshriver mshriver changed the title Move tier and requirement markers out of fixtures [WIPTEST] Move tier and requirement markers out of fixtures Aug 20, 2019
@mshriver mshriver changed the title [WIPTEST] Move tier and requirement markers out of fixtures [WIPTEST] Add meta filter, move tier and requirement markers Aug 21, 2019
@mshriver mshriver force-pushed the polarion-custscenario branch 2 times, most recently from 85b6dc4 to 8ef68e5 Compare August 21, 2019 15:53
@izapolsk
Copy link
Contributor

it's really great PR !. I love it

@mshriver
Copy link
Member Author

I've abstracted the meta-filter itself into pytest-polarion-collect:
https://gitlab.com/mkourim/pytest-polarion-collect/merge_requests/5

@mshriver mshriver force-pushed the polarion-custscenario branch 2 times, most recently from 33b2fd0 to fdd2fb6 Compare August 26, 2019 17:40
@mshriver mshriver changed the title [WIPTEST] Add meta filter, move tier and requirement markers [RFR] Add meta filter, move tier and requirement markers Aug 26, 2019
@mshriver mshriver changed the title [RFR] Add meta filter, move tier and requirement markers [RFR] Add customer scenario marker/filter, move tier and requirement markers Aug 26, 2019
assignee_id='ndhandre',
)

day2 = pytest.mark.requirement(
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought day 2 scenarios are different from customer scenarios . If yes then we need to change the description

Copy link
Member Author

Choose a reason for hiding this comment

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

So, they are not mutually exclusive.

customerscenario meta is for polarion boolean flag, and may apply to test cases that are not necessarily linked to customer stories/day2 initiatives. It is the lowest level marker (meta) that indicates a test case is linked to a customer use case. It could be applied automatically by the BZ meta marker if the marked BZ is linked to a customer support case.

This requirement marker is used to group/link test cases that are a direct result of the customer stories initiative, or are related specifically to day2 operations type testing.

I chose to change this requirement marker to day2 to more clearly separate the names, and because its shorter. I left the first argument, the requirement title, the same, because that keeps the existing polarion requirement linked. I'll leave it to the requirement owner, @digitronik, if he also wants to change the requirement title.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sshveta would you like to see more documentation in the marker module for customerscenario?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mshriver : yes please , day 2 is not very evident by name that it is for customer stories .
@digitronik : What do you think ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mshriver as per our discussion is it possible to put same name means customer_stories.
one will be requirement and other will be simple meta marker.

  1. @pytest.mark.customerscenario: sets customerscenario flag (polarion), indicates a test originating from a customer Bugzilla related to specific FA.

  2. @requirement.customer_stories: Customer operations, actual integration tests means sharing multiple FA. It not bound to only customer bugzilla but customer stories collected from

  • Bugzilla
  • Mail threads
  • Support people threads
  • FA owner thoughts (how specific FA used in combination with other FAs)

@sshveta we will add customerscenario meta over customer stories tests. but customer_stories requirement marker will not applicable for every customer Bugzilla automation test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it back

@mshriver mshriver changed the title [RFR] Add customer scenario marker/filter, move tier and requirement markers [WIPTEST] Add customer scenario marker/filter, move tier and requirement markers Aug 26, 2019
@mshriver mshriver force-pushed the polarion-custscenario branch 2 times, most recently from 9b96714 to 4bc1fb9 Compare August 27, 2019 20:19
@@ -246,7 +246,7 @@ def get_miq_server_id(self):

def get_pids_memory(self):
result = self.ssh_client.run_command(
'smem -c \'pid rss pss uss vss swap name command\' | sed 1d')
"/usr/bin/python2.7 /usr/bin/smem -c 'pid rss pss uss vss swap name command' | sed 1d")
Copy link
Member Author

Choose a reason for hiding this comment

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

This is otherwise unrelated, and I can move the commit to a different branch if preferred. Found this running cfme-performance test repository, smem is not python 3 compatible, this is being run on the appliance, not locally.

view = _navigation(param, appliance)
assert view.search.is_advanced_search_possible, (f"Advanced search not displayed "
Copy link
Member Author

Choose a reason for hiding this comment

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

@psimovec I found when updating the polarion tooling packages, that this pattern of decorating to inject the tests was not including metadata.

Even modifying the inject_tests methods to explicitly include the __doc__ for the methodized test function, the meta parsing tools were not processing it correctly. There will need to be updates to these tools to support a test structure like this.

In the mean time I collapsed these two tests, as a separate test just to assert that the advanced search button is there is redundant to a test that is actually asserting that advanced search is opened when clicked.

I left methodize/inject_tests in place, but removed the decorators and put the boilerplate in place so that meta would be applied.

@mshriver mshriver changed the title [WIPTEST] Add customer scenario marker/filter, move tier and requirement markers [RFR] Add customer scenario marker/filter, move tier and requirement markers Aug 28, 2019
@mshriver mshriver requested a review from sshveta August 28, 2019 15:47
Copy link
Contributor

@sshveta sshveta left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -19,6 +19,7 @@

pytestmark = [
test_requirements.v2v,
pytest.mark.customer_scenario,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

SearchParam('ansible_tower_job_templates', 'All', 'ansible_tower_explorer_job_templates',
'Job Template (Ansible Tower) : Name',
('sidebar.job_templates', 'All Ansible Tower Job Templates')),

Copy link
Contributor

Choose a reason for hiding this comment

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

This empty line can be removed

Add customer-scenario filter and marker
register the markers
default customerscenario
update pytest-polarion-collect and other polarion packages

Remove test injection from test_advanced_search, for meta

The polarion meta was not correctly parsed, and with updates to pytest-polarion-collect and polarion_docstrings, the unmerged docstrings are causing exceptions and failures during collection.

Go to boilerplate for this test module, until the meta processing is resolved.

Update smem to run with python2 explicitly
@mshriver mshriver changed the title [RFR] Add customer scenario marker/filter, move tier and requirement markers [1LP][RFR] Add customer scenario marker/filter, move tier and requirement markers Aug 29, 2019
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.

One minor comment about an old TODO, nice PR! 👍

keep.append(item)

items[:] = keep
# TODO(rpfannsc) add a reason after pytest #1372 is fixed
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this TODO be removed? I see that the issue referenced is resolved pytest-dev/pytest#1372

@jawatts jawatts merged commit 7f5dacd into ManageIQ:master Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants