Bug 2272977

Summary: fedmsg fails to build with pytest 8: ValueError: You must set the ssldir and certname keyword arguments.
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: fedmsgAssignee: Fedora Infrastructure SIG <infra-sig>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: infra-sig, kevin, mhroncok, rbean, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2256331    

Description Tomáš Hrnčiar 2024-04-03 14:20:32 UTC
fedmsg fails to build with pytest 8.

=================================== FAILURES ===================================
_____________________ TestCryptoGPG.test_failed_validation _____________________

self = <fedmsg.tests.test_crypto_gpg.TestCryptoGPG testMethod=test_failed_validation>

    def test_failed_validation(self):
        message = dict(msg='awesome')
>       signed = fedmsg.crypto.sign(message, **self.config)

fedmsg/tests/test_crypto_gpg.py:89: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
fedmsg/crypto/__init__.py:207: in sign
    return _implementation.sign(message, **config)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

message = {'msg': 'awesome'}, ssldir = None, certname = None
config = {'crypto_backend': 'gpg', 'gpg_home': '/builddir/build/BUILD/fedmsg-1.1.7/fedmsg/tests/test_certs/gpg', 'gpg_signing_key': 'DA19B4EC'}
error = 'You must set the ssldir and certname keyword arguments.'

    def sign(message, ssldir=None, certname=None, **config):
        """Insert two new fields into the message dict and return it.
    
        Those fields are:
    
            - 'signature' - the computed RSA message digest of the JSON repr.
            - 'certificate' - the base64 X509 certificate of the sending host.
    
        Arg:
            message (dict): An unsigned message to sign.
            ssldir (str): The absolute path to the directory containing the SSL certificates to
                use.
            certname (str): The name of the key pair to sign the message with. This corresponds to
                the filenames within ``ssldir`` sans prefixes. The key pair must be named
                ``<certname>.key`` and ``<certname>.crt``
        Returns:
            dict: The signed message.
        """
        if ssldir is None or certname is None:
            error = "You must set the ssldir and certname keyword arguments."
>           raise ValueError(error)
E           ValueError: You must set the ssldir and certname keyword arguments.

fedmsg/crypto/x509_ng.py:73: ValueError

https://docs.pytest.org/en/stable/changelog.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07247560-fedmsg/

For all our attempts to build fedmsg with pytest 8, see:
https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/fedmsg/

Let us know here if you have any questions.

Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a
heads up before we merge new pytest into rawhide. For more info see a Fedora Change
proposal https://fedoraproject.org/wiki/Changes/Pytest_8

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.