#51018 Issue 51017 - Implement dynamic ds/bz pytest markers
Closed 3 years ago by spichugi. Opened 4 years ago by mhonek.
mhonek/389-ds-base auto-add-custom-pytest-markers  into  master

file modified
+13
@@ -8,9 +8,21 @@ 

  from lib389.paths import Paths

  from enum import Enum

  

+ 

  pkgs = ['389-ds-base', 'nss', 'nspr', 'openldap', 'cyrus-sasl']

  p = Paths()

  

+ 

+ def pytest_configure(config):

+     """Auto add custom markers we use to reference upstream/bugzilla tickets."""

+     prefix = '@pytest.mark.'

+     cmd = ['grep', '-rh', f'^{prefix}\\(ds\\|bz\\)[0-9]\\+']

+     p = subprocess.run(cmd, check=True, stdout=subprocess.PIPE)

+     markers = {x[len(prefix):] for x in p.stdout.decode().splitlines()}

+     for m in markers:

+         config.addinivalue_line('markers', m)

+ 

+ 

  class FIPSState(Enum):

      ENABLED = 'enabled'

      DISABLED = 'disabled'
@@ -22,6 +34,7 @@ 

      def __str__(self):

          return self.value

  

+ 

  def get_rpm_version(pkg):

      try:

          result = subprocess.check_output(['rpm', '-q', '--queryformat',

Bug Description:
Our unique markers for tickets cause a lot pytest warnings
PytestUnknownMarkWarning.

Fix Description:
On each run, go through all test files and the correctly prefixed markers for
the runtime being.

Fixes: https://pagure.io/389-ds-base/issue/51017

Author: Matus Honek mhonek@redhat.com

Review by: ???

You have a secondary ack from me too!

rebased onto 6a7a154

3 years ago

Pull-Request has been merged by mhonek

3 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4071

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata