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

logging test failure on perlmutter #193

Closed
sbailey opened this issue Apr 7, 2023 · 3 comments
Closed

logging test failure on perlmutter #193

sbailey opened this issue Apr 7, 2023 · 3 comments

Comments

@sbailey
Copy link
Contributor

sbailey commented Apr 7, 2023

On Perlmutter, desiutil unit tests fail with the traceback below. Although this looks harmless, it is odd that the loglevel numbers appear to have changed (actually it is odd that is shows up at "2" on Cori, while logging.INFO=20 on both Cori and Perlmutter...). This could potentially mask other real failures if we get used to the idea that desiutil unit tests fail. This particular test will be moot after #190 is merged, but I don't have the cycles to track optional breaking changes at this point so I'm holding off on merging that. Is there a lightweight way we can work around this test failure, e.g. running the test but being agnostic to 2 vs. 20?

=================================== FAILURES ===================================
____________________________ TestSetup.test_version ____________________________

self = <desiutil.test.test_setup.TestSetup testMethod=test_version>

        def test_version(self):
            """Test python setup.py version.
            """
            path_index = int(sys.path[0] == '')
            sys.path.insert(path_index, os.path.abspath('./py'))
            package_dir = os.path.join(self.setup_dir, self.fake_name)
            os.mkdir(package_dir)
            os.mkdir(os.path.join(package_dir, self.fake_name))
            os.mkdir(os.path.join(package_dir, '.git'))
            setup = """#!/usr/bin/env python
    from setuptools import setup
    from desiutil.setup import DesiModule, DesiTest, DesiVersion, get_version
    CMDCLASS = {{'version': DesiVersion}}
    VERSION = get_version("{0.fake_name}")
    setup(name="{0.fake_name}",
        version=VERSION,
        packages=["{0.fake_name}"],
        cmdclass=CMDCLASS,
        zip_safe=False)
    """.format(self)
            with open(os.path.join(package_dir, 'setup.py'), 'w') as s:
                s.write(setup)
            init = """from ._version import __version__
    """
            with open(os.path.join(package_dir, self.fake_name,
                                   '__init__.py'), 'w') as i:
                i.write(init)
            os.chdir(package_dir)
            v_file = os.path.join(package_dir, self.fake_name, '_version.py')
            with patch('distutils.cmd.Command.announce') as mock_announce:
                with patch('distutils.log.info') as mock_info:
                    self.run_setup('setup.py', ['version'])
                    self.assertTrue(os.path.exists(v_file))
>                   self.assertListEqual(mock_announce.mock_calls,
                                         [call('Version is now 0.0.1.dev0.', level=2)])
E                                        AssertionError: Lists differ: [call('Version is now 0.0.1.dev0.', level=20)] != [call('Version is now 0.0.1.dev0.', level=2)]
E                                        
E                                        First differing element 0:
E                                        call('Version is now 0.0.1.dev0.', level=20)
E                                        call('Version is now 0.0.1.dev0.', level=2)
E                                        
E                                        - [call('Version is now 0.0.1.dev0.', level=20)]
E                                        ?                                            -
E                                        
E                                        + [call('Version is now 0.0.1.dev0.', level=2)]

py/desiutil/test/test_setup.py:97: AssertionError
@weaverba137
Copy link
Member

I have established that this is due to a change introduced in Python 3.10, and I know how to fix it.

@weaverba137
Copy link
Member

For the record, this is fixed in #190, which presumably will need to be merged to make desiutil unit tests work on perlmutter/Python 3.10.

@weaverba137
Copy link
Member

Fixed in #190.

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

No branches or pull requests

2 participants