datalad / git-annex

A non-official clone of git-annex established for DataLad purposes. No PRs will be merged, but could be used to test perspective git-annex patches. Official git-annex repository: https://git.kitenet.net/index.cgi/git-annex.git/
14 stars 3 forks source link

Windows installer sometimes leads to "annex" not being found as "git" command #196

Open yarikoptic opened 5 months ago

yarikoptic commented 5 months ago

It is rare and not clear why -- one of the multiple runs could fail... happened only few times!

$> datalad foreach-dataset --o-s relpath -r -J10 git grep 'ERROR.*CommandError: ."git" "annex" "version". failed with exitcode 1 ' | sort
2023/06/cron-20230618/build-windows.yaml-1080-cfe87684-failed/1_test-datalad (master).txt:2023-06-18T03:48:58.7540420Z ERROR ..\datalad\support\tests\test_annexrepo.py - datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']
2023/06/cron-20230618/build-windows.yaml-1080-cfe87684-failed/test-datalad (master)/22_Run datalad tests.txt:2023-06-18T03:48:58.7540415Z ERROR ..\datalad\support\tests\test_annexrepo.py - datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']
2023/10/cron-20231010/build-windows.yaml-1209-1c03c8fd-failed/2_test-datalad (maint).txt:2023-10-10T03:44:53.6962414Z ERROR ..\datalad\support\tests\test_annexrepo.py - datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']
2023/10/cron-20231010/build-windows.yaml-1209-1c03c8fd-failed/test-datalad (maint)/22_Run datalad tests.txt:2023-10-10T03:44:53.6962288Z ERROR ..\datalad\support\tests\test_annexrepo.py - datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']
2024/02/cron-20240202/build-windows.yaml-1339-dcec14c7-failed/0_test-datalad (master).txt:2024-02-02T03:43:39.8837311Z ERROR ..\datalad\support\tests\test_annexrepo.py - datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']
2024/02/cron-20240202/build-windows.yaml-1339-dcec14c7-failed/test-datalad (master)/22_Run datalad tests.txt:2024-02-02T03:43:39.8837300Z ERROR ..\datalad\support\tests\test_annexrepo.py - datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']

and that leads to failed tests collection

details from a sample errored out run

============================= test session starts =============================
platform win32 -- Python 3.8.10, pytest-8.0.0, pluggy-1.4.0 -- C:\hostedtoolcache\windows\Python\3.8.10\x64\python.exe
cachedir: .pytest_cache
rootdir: D:\a\git-annex\git-annex\datalad
configfile: tox.ini
collecting ... collected 1132 items / 3 errors / 1 skipped

=================================== ERRORS ====================================
__________ ERROR collecting local/tests/test_add_archive_content.py ___________
C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\datalad\local\tests\test_add_archive_content.py:493: in <module>
    class TestAddArchiveOptions():
C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\datalad\local\tests\test_add_archive_content.py:523: in TestAddArchiveOptions
    '10.20220525' <= external_versions['cmd:annex'] < '10.20220706',  # approx when was fixed
E   TypeError: '<=' not supported between instances of 'str' and 'NoneType'
________________ ERROR collecting local/tests/test_addurls.py _________________
C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\datalad\local\tests\test_addurls.py:435: in <module>
    OLD_EXAMINEKEY = external_versions["cmd:annex"] < "8.202011[16](https://github.com/datalad/git-annex/actions/runs/7751027439/job/21138392102#step:22:17)"
E   TypeError: '<' not supported between instances of 'NoneType' and 'str'
______________ ERROR collecting support/tests/test_annexrepo.py _______________
C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\datalad\support\tests\test_annexrepo.py:140: in <module>
    _GIT_ANNEX_VERSIONS_INFO = AnnexRepo.check_repository_versions()
C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\datalad\support\annexrepo.py:529: in check_repository_versions
    out = GitWitlessRunner().run(
C:\hostedtoolcache\windows\Python\3.8.10\x64\Lib\site-packages\datalad\runner\runner.py:[24](https://github.com/datalad/git-annex/actions/runs/7751027439/job/21138392102#step:22:25)2: in run
    raise CommandError(
E   datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']
=========================== short test summary info ===========================
ERROR ..\datalad\local\tests\test_add_archive_content.py - TypeError: '<=' not supported between instances of 'str' and 'NoneType'
ERROR ..\datalad\local\tests\test_addurls.py - TypeError: '<' not supported between instances of 'NoneType' and 'str'
ERROR ..\datalad\support\tests\test_annexrepo.py - datalad.runner.exception.CommandError: CommandError: '"git" "annex" "version"' failed with exitcode 1 [err: 'git: 'annex' is not a git command. See 'git --help'.']
!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!