Skip to content

Conversation

@mjcheetham
Copy link
Member

@mjcheetham mjcheetham commented Jul 28, 2025

We've not been running the functional tests against a new version of Microsoft Git in a while.. today we're still pointing at v2.35.3.vfs.0.0 which was released in 2022!

The GVFS.Installers project (that creates the NuGet packages that the Functional Tests consume) is set to download the Git installer and portable archives from the ci/Dependencies feed in the GVFS Azure DevOps organisation. The package version is set centrally for the build here, in the Version.props file.

The build that publishes new versions of that package are woefully out of date and no longer run. The last run was June 20, 2022. This was around the time official microsoft/git builds were moved to GitHub workflows.

Here we instead source the Microsoft Git installers from GitHub releases in the build workflow. Updating the version of Git used in FTs can be updated by modifying the build.yaml workflow (or setting the variable at queue-time if doing a workflow_dispatch trigger).

Whilst we're at it, and since we now have ARM64-natively compiled versions of Git and Windows on ARM hosted runners, let's also run the functional tests on ARM64.

The functional tests have also been failing with the newer version of Microsoft Git since microsoft/git@5efe366 was introduced. Let's ignore these messages in the FTs.

Note: this is based upon this PR

@mjcheetham mjcheetham requested review from dscho and tyrielv July 28, 2025 17:04
@mjcheetham mjcheetham force-pushed the gh-msgit branch 4 times, most recently from a93cfa6 to 668408a Compare July 28, 2025 17:35
@mjcheetham mjcheetham requested a review from mpysson July 28, 2025 18:21
@dscho
Copy link
Member

dscho commented Jul 28, 2025

I believe that the tests fail because of microsoft/git@5efe366, as @tyrielv had pointed out to us in private communication earlier.

So we'll need to adjust something in the tests to accommodate for the change of behavior.

I guess the easiest would be to patch

ProcessResult actualResult = GitHelpers.InvokeGitAgainstGVFSRepo(gvfsRepoRoot, command, environmentVariables);
to strip out the newly-added lines from actualOutput.

@mjcheetham
Copy link
Member Author

I believe that the tests fail because of microsoft/git@5efe366, as @tyrielv had pointed out to us in private communication earlier.

So we'll need to adjust something in the tests to accommodate for the change of behavior.

I guess the easiest would be to patch

ProcessResult actualResult = GitHelpers.InvokeGitAgainstGVFSRepo(gvfsRepoRoot, command, environmentVariables);

to strip out the newly-added lines from actualOutput.

That's what e6e4504 is (trying) to do.. but I'm debugging why it's not working at the moment.

@mjcheetham
Copy link
Member Author

but I'm debugging why it's not working at the moment.

Of course status prints to standard output, and the existing filtering logic works on standard error. Should work now - we're filtering both.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

I am only a bit concerned that the Functional Tests still fail:

  • GVFS.FunctionalTests.Tests.EnlistmentPerFixture.GitCorruptObjectTests.GitRequestsReplacementForTruncatedObject():

    Failed at 10:54:50 PM taking 00:00:01.4814157
      Expected: 0
      But was:  128
    
  • GVFS.FunctionalTests.Tests.EnlistmentPerFixture.WindowsUpdatePlaceholderTests.LockToPreventUpdateAndDelete():

    Test GVFS.FunctionalTests.Tests.EnlistmentPerFixture.WindowsUpdatePlaceholderTests.LockToPreventUpdateAndDelete()
    Failed at 10:57:05 PM taking 00:00:01.4125659
      Expected substring 'Untracked files:
      (use "git add <file>..." to include in what will be committed)
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test_delete.txt
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test_delete2.txt
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test_delete3.txt' not found in 'HEAD detached at 5d7a7d4db1734fb468a4094469ec58d26301b59d
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
    	modified:   Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test.txt
    	modified:   Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test2.txt
    	modified:   Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test3.txt
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test_delete.txt
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test_delete2.txt
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test_delete3.txt
    no changes added to commit (use "git add" and/or "git commit -a")'
      Expected: True
      But was:  False
    
  • GVFS.FunctionalTests.Tests.EnlistmentPerFixture.WindowsUpdatePlaceholderTests.LockMoreThanMaxReportedFileNames():

    Test GVFS.FunctionalTests.Tests.EnlistmentPerFixture.WindowsUpdatePlaceholderTests.LockMoreThanMaxReportedFileNames()
    Failed at 10:57:05 PM taking 00:00:00.2646733
      Expected substring 'HEAD is now at fec239ea12de1eda6ae5329d4f345784d5b61ff9' not found in 'error: Your local changes to the following files would be overwritten by checkout:
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test.txt
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test2.txt
    	Test_EPF_UpdatePlaceholderTests/LockToPreventUpdateAndDelete/test3.txt
    Please commit your changes or stash them before you switch branches.
    Aborting'
      Expected: True
      But was:  False
    

dscho added a commit to microsoft/git that referenced this pull request Aug 13, 2025
As of 9e59b38, Git will loudly complain about corrupt objects.

That is fine, as long as the idea isn't to re-download locally-corrupted
objects. But that's exactly what we want to do in VFS for Git. This is
even tested for in the functional tests of VFS for Git, which has been
identified as a regression in
microsoft/VFSForGit#1853.
dscho added a commit to microsoft/git that referenced this pull request Aug 13, 2025
As of 9e59b38, Git will loudly complain about corrupt objects.

That is fine, as long as the idea isn't to re-download locally-corrupted
objects. But that's exactly what we want to do in VFS for Git. This is
even tested for in the functional tests of VFS for Git, which has been
identified as a regression in
microsoft/VFSForGit#1853.
dscho added a commit to microsoft/git that referenced this pull request Aug 13, 2025
As of 9e59b38, Git will loudly complain about corrupt objects.

That is fine, as long as the idea isn't to re-download locally-corrupted
objects. But that's exactly what we want to do in VFS for Git. This is
even tested for in the functional tests of VFS for Git, which has been
identified as a regression in
microsoft/VFSForGit#1853.
dscho added a commit to microsoft/git that referenced this pull request Aug 13, 2025
As of 9e59b38, Git will loudly complain about corrupt objects.

That is fine, as long as the idea isn't to re-download locally-corrupted
objects. But that's exactly what we want to do in VFS for Git. This is
even tested for in the functional tests of VFS for Git, which has been
identified as a regression in
microsoft/VFSForGit#1853.
dscho added a commit to microsoft/git that referenced this pull request Aug 13, 2025
As of 9e59b38, Git will loudly complain about corrupt objects.

That is fine, as long as the idea isn't to re-download locally-corrupted
objects. But that's exactly what we want to do in VFS for Git. This is
even tested for in the functional tests of VFS for Git, which has been
identified as a regression in
microsoft/VFSForGit#1853.
@mjcheetham mjcheetham force-pushed the gh-msgit branch 2 times, most recently from 09ac6be to e3c33ca Compare August 14, 2025 10:57
Stop creating and uploading (for the functional tests) NuGet packages
for the GVFS.Installers project. We no longer maintain the packages:

* GitForWindows.GVFS.Installer
* GitForWindows.GVFS.Portable

Signed-off-by: Matthew John Cheetham <[email protected]>
@mjcheetham mjcheetham force-pushed the gh-msgit branch 5 times, most recently from e85cafc to 3b663b4 Compare August 14, 2025 12:24
mjcheetham and others added 8 commits August 14, 2025 13:38
Download the Microsoft Git installers from GitHub releases via the `gh`
CLI tool. The installers (both portable and Inno Setup based) are
included in the Installers_${{ matrix.configuration }} build artifact
that is consumed by the functional test jobs.

Signed-off-by: Matthew John Cheetham <[email protected]>
Install the correct version of Microsoft Git in the functional tests for
the OS architecture, and print more OS/CPU information for good measure.

Signed-off-by: Matthew John Cheetham <[email protected]>
Let's use the ARM64 Windows images (currently in public preview) on
GitHub hosted runners to run the functional tests on ARM.

VFS for Git is still only built for x86_64, but we do now include a
natively compiled Git for ARM64 - so let's exercise that!

Signed-off-by: Matthew John Cheetham <[email protected]>
In preparing to accounting for the "You are in a partially-hydrated
checkout with %d% of tracked files present" message that was added in
Microsoft Git v2.XX.Y, let's refactor the existing output filtering
(which is so far only done for `stderr`) into its own method.

Signed-off-by: Matthew John Cheetham <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
There are tests that find multi-line needles in the Git output's
haystack. So far, those tests work on `stdout` only. We are about to
filter `stdout` using the new `FilterMessages()` method, therefore that
method must stop its current practice where it splits by newlines and
then joins using `Environment.Newline` (even if that is different from
what the input had before).

Signed-off-by: Johannes Schindelin <[email protected]>
Currently, we only filter `stderr`, but we're about to do that with
`stdout`, too, where we do not want to skip empty lines.

Signed-off-by: Johannes Schindelin <[email protected]>
Let the functional tests account for the "You are in a
partially-hydrated checkout with %d% of tracked files present" message
that was added in Microsoft Git v2.45.2.vfs.0.2.

Do this by filtering out those messages in the same way we do for the
old 'A new version of VFS for Git is available.' upgrader messages, and
the 'Waiting for %s' lock waiting message.

Note that the 'hydration' state message is printed to standard output
and not standard error as the other messages, since this is the output
from the `status` command. We filter both stdout and stderr.

Signed-off-by: Matthew John Cheetham <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
When running the functional tests locally, it is quite possible that the
`core.fsmonitor` setting is enabled globally. Let's avoid chalking that
up as a test failure.

Signed-off-by: Johannes Schindelin <[email protected]>
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@mjcheetham mjcheetham merged commit f2bc533 into microsoft:master Aug 14, 2025
8 checks passed
@mjcheetham mjcheetham deleted the gh-msgit branch August 14, 2025 14:01
@mjcheetham mjcheetham mentioned this pull request Aug 18, 2025
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

Successfully merging this pull request may close these issues.

3 participants