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

NullReferenceException on Jenkins CI environment when using Match with snapshotName #199

Open
schinnerld opened this issue Oct 15, 2024 · 0 comments

Comments

@schinnerld
Copy link

Describe the bug
NullReferenceException on Jenkins Agent when using Match overload with snapshotName. This does not occur on W10 development workstation. A workaround found ist to use the Match overload with snapshotFullName.

System.NullReferenceException: Object reference not set to an instance of an object.
at Snapshooter.Extensions.StringExtension.RemoveFilename(String filenameFullPath)
at Snapshooter.Extensions.StringExtension.GetDirectoryName(String filenameFullPath)
at Snapshooter.MSTest.MSTestSnapshotFullNameReader.ReadSnapshotFullName()
at Snapshooter.SnapshotFullNameResolver.ResolveSnapshotFullName(String snapshotName, String snapshotNameExtension)
at Snapshooter.Snapshooter.ResolveSnapshotFullName(String snapshotName, SnapshotNameExtension snapshotNameExtension)
at Snapshooter.MSTest.Snapshot.FullName(String snapshotName)
at Snapshooter.MSTest.Snapshot.Match(Object currentResult, String snapshotName, Func2 matchOptions) at Snapshooter.MSTest.Snapshot.Match[T](T currentResult, String snapshotName, Func2 matchOptions)
at ABCTests.XYZApprovalTest()

To Reproduce
Steps to reproduce the behavior:

Expected behavior
No exception is thrown.

Desktop:
Windows Server 2022 10.0.20348
VMWare 7.1
Jenkins Windows Agent 3261.v9c670a_4748a_9
SnapShooter.MSTest 0.14.1

Additional context
Strong guess that stackFrame.GetFileName() returns null in MSTestSnapShotFullNameReader ln 39.

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

1 participant