stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.78k stars 187 forks source link

NullReferenceException When Try To Get the target branch #1303

Closed aperdomob closed 4 years ago

aperdomob commented 4 years ago

Describe the bug When executing into Jenkins CI, mutation command with -diff and -gdt development fail with a NullPointerException

Logs

[23:37:00 DBG] Initial build successful
[23:37:00 INF] Initializing test runners (VsTest)
[23:37:00 DBG] VsTest zip was copied to: /tmp/mfzdm5xn.wh0/.vstest/vstest.zip
[23:37:01 DBG] VsTest zip was unzipped to: /tmp/mfzdm5xn.wh0/.vstest
[23:37:01 DBG] Using vstest from deployed vstest package
[23:37:01 DBG] Using vstest.console: /tmp/mfzdm5xn.wh0/.vstest/tools/netcoreapp2.1/vstest.console.dll for OS LINUX
[23:37:04 INF] Test runners are ready
[23:37:04 DBG] Looking for branch matching develop
[23:37:04 ERR] An error occurred during the mutation test run 
System.NullReferenceException: Object reference not set to an instance of an object.
   at Stryker.Core.DashboardCompare.GitInfoProvider.GetTargetCommit()
   at Stryker.Core.DashboardCompare.GitInfoProvider.DetermineCommit()
   at Stryker.Core.DiffProviders.GitDiffProvider.ScanDiff()
   at Stryker.Core.MutantFilters.DiffMutantFilter..ctor(StrykerOptions options, IDiffProvider diffProvider, IBaselineProvider baselineProvider, IGitInfoProvider gitInfoProvider)
   at Stryker.Core.MutantFilters.MutantFilterFactory.DetermineEnabledMutantFilters(StrykerOptions options)
   at Stryker.Core.MutantFilters.MutantFilterFactory.Create(StrykerOptions options, IDiffProvider diffProvider, IBaselineProvider baselineProvider, IGitInfoProvider gitInfoProvider)
   at Stryker.Core.MutationTest.MutationTestProcess..ctor(MutationTestInput mutationTestInput, IReporter reporter, IMutationTestExecutor mutationTestExecutor, IMutantOrchestrator orchestrator, ICompilingProcess compilingProcess, IFileSystem fileSystem, StrykerOptions options, IMutantFilter mutantFilter, ICoverageAnalyser coverageAnalyser)
   at Stryker.Core.StrykerRunner.RunMutationTest(StrykerOptions options, IEnumerable`1 initialLogMessages)

Expected behavior Execute mutation test process without problems

Desktop (please complete the following information):

rouke-broersma commented 4 years ago

Mhm, can you confirm that there actually is a git repository available on the path where stryker is executed?

aperdomob commented 4 years ago

Yes, the git repository is available in the path

rouke-broersma commented 3 years ago

@aperdomob the fix has just been released