Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9717b8d

Browse files
committed
Install WSL system on CI for hook tests
This makes three of the four hook-related tests pass instead offailing, and changes the way the fourth fails.GitPython uses bash.exe to run hooks that are (or appear to be)shell scripts. On many Windows systems, this is the bash.exe in thesystem32 directory, which delegates to bash in a WSL system if atleast one such system is installed (for the current user), andgives an error otherwise. It may be a bug that GitPython ends upusing this bash.exe when WSL is installed but no WSL systems exist,since that is actually a fairly common situation. One place thathappened was on the GitHub Actions runners used for Windows jobs.Those runners have WSL available, and are capable of running WSL 1systems (not currently WSL 2 systems), but no WSL systems wereactually installed.This commit fixes that cause of failure, for all four tests ithappened in, by setting up a Debian WSL system on the test runner.(This increases the amount of time it takes Windows jobs to run,but that might be possible to improve on.) Three of those fourtests now pass, while the other fails for another reason.The newly passing tests are:- test/test_index.py::TestIndex::test_commit_msg_hook_fail- test/test_index.py::TestIndex::test_pre_commit_hook_fail- test/test_index.py::TestIndex::test_pre_commit_hook_successThe test that still fails, but differently, is:- test/test_index.py::TestIndex::test_commit_msg_hook_successI had previously found that test to fail on a local WSL 2 system,and attempted to add a suitable xfail marking in881456b (#1679).But the condition I wrote there *appears* to have a bug related tothe different orders in which subproces.Popen and shutil.which findexecutables, causing it not always to detect when the WSL-relatedbash.exe is the one the Popen call in git.index.fun.run_commit_hookwill use.
1 parent2784e40 commit9717b8d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎.github/workflows/pythonpackage.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ jobs:
3535
python-version:${{ matrix.python-version }}
3636
allow-prereleases:${{ matrix.experimental }}
3737

38+
-name:Set up WSL
39+
if:startsWith(matrix.os, 'windows')
40+
uses:Vampire/setup-wsl@v2.0.2
41+
with:
42+
distribution:Debian
43+
3844
-name:Prepare this repo for tests
3945
run:|
4046
./init-tests-after-clone.sh

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp