#89 test_*_fork tests fail
Opened 7 months ago by carlwgeorge. Modified 2 months ago

I tried to run the unittests, and discovered that several tests currently fail.

(.py3.11) [carl@red:~/development/centpkg:develop]$ python3 -m unittest discover
..........................................................EE.E
======================================================================
ERROR: test_centpkg_fork (tests.test_utils.TestGetRepoName.test_centpkg_fork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/carl/development/centpkg/tests/test_utils.py", line 14, in test_centpkg_fork
    assert utils.get_repo_name('someuser/centos_rpms_binutils') == 'rpms/binutils'
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 260, in get_repo_name
    repo_name = get_canonical_repo_name(dist_git_config, name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 196, in get_canonical_repo_name
    cli_name = config_get_safely(dist_git_config, '__default', 'cli_name')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 176, in config_get_safely
    return config.get(section, option)
           ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

======================================================================
ERROR: test_gitlab_fork (tests.test_utils.TestGetRepoName.test_gitlab_fork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/carl/development/centpkg/tests/test_utils.py", line 11, in test_gitlab_fork
    assert utils.get_repo_name('someuser/time') == 'rpms/time'
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 260, in get_repo_name
    repo_name = get_canonical_repo_name(dist_git_config, name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 196, in get_canonical_repo_name
    cli_name = config_get_safely(dist_git_config, '__default', 'cli_name')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 176, in config_get_safely
    return config.get(section, option)
           ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

======================================================================
ERROR: test_ssh_fork (tests.test_utils.TestGetRepoName.test_ssh_fork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/carl/development/centpkg/tests/test_utils.py", line 17, in test_ssh_fork
    assert utils.get_repo_name('git@gitlab.com:nickc2/binutils') == 'rpms/binutils'
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 260, in get_repo_name
    repo_name = get_canonical_repo_name(dist_git_config, name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 196, in get_canonical_repo_name
    cli_name = config_get_safely(dist_git_config, '__default', 'cli_name')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/carl/development/centpkg/tests/../src/centpkg/utils.py", line 176, in config_get_safely
    return config.get(section, option)
           ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

----------------------------------------------------------------------
Ran 62 tests in 0.003s

FAILED (errors=3)

After digging through the code a bit, I believe that commit 5a7f92e is where the problem was introduced. With the parent of that commit checked out, the tests pass. With that commit checked out, the tests fail.


Metadata Update from @tdawson:
- Issue tagged with: Bug

7 months ago

This was fixed with patch 0001-Mark-fork-tests-as-expected-failures.patch
That patch has been incoporated into centpkg 0.8.2.
I will close this issue when centpkg 0.8.2 makes it through testing.

Login to comment on this ticket.

Metadata