neo-go/pkg
Anna Shaleva 7fac3bcd6f neotest: don't collect coverage for contracts with empty DI
Users are allowed to provide any contract to neotest, including those
contracts that don't have DebugInfo filled in. Neotest should filter
them out, otherwise panic may occur on attempt to write coverage profile:
```
--- FAIL: TestDeploys (0.01s)
panic: runtime error: invalid memory address or nil pointer dereference
	panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xc6f5b5]

goroutine 1735 [running]:
testing.tRunner.func1.2({0xd7aa80, 0x1723f60})
	/usr/local/go/src/testing/testing.go:1631 +0x24a
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1634 +0x377
panic({0xd7aa80?, 0x1723f60?})
	/usr/local/go/src/runtime/panic.go:770 +0x132
github.com/nspcc-dev/neo-go/pkg/neotest.processCover()
	/home/anna/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.106.4-0.20241007094345-11151938b9bd/pkg/neotest/coverage.go:143 +0xd5
github.com/nspcc-dev/neo-go/pkg/neotest.writeCoverageReport({0x10c6260, 0xc00033a378})
	/home/anna/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.106.4-0.20241007094345-11151938b9bd/pkg/neotest/coverage.go:123 +0x4b
github.com/nspcc-dev/neo-go/pkg/neotest.reportCoverage({0x10db278, 0xc00021a000})
	/home/anna/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.106.4-0.20241007094345-11151938b9bd/pkg/neotest/coverage.go:118 +0x165
github.com/nspcc-dev/neo-go/pkg/neotest.(*Executor).trackCoverage.func1()
	/home/anna/go/pkg/mod/github.com/nspcc-dev/neo-go@v0.106.4-0.20241007094345-11151938b9bd/pkg/neotest/basic.go:182 +0x1b
testing.(*common).Cleanup.func1()
	/usr/local/go/src/testing/testing.go:1175 +0x10f
testing.(*common).runCleanup(0xc00021a000, 0x58d7c0?)
	/usr/local/go/src/testing/testing.go:1353 +0xdb
testing.(*common).runCleanup.func2()
	/usr/local/go/src/testing/testing.go:1337 +0x47
panic({0xd7aa80?, 0x1723f60?})
```

An example of such partially-filled contract is:
a8d5e001a2/tests/deploys_test.go (L13)
a8d5e001a2/contracts/contracts.go (L96)

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
2024-10-07 17:51:19 +03:00
..
compiler Merge pull request #3599 from Slava0135/fix-modmul 2024-10-07 12:43:45 +03:00
config services: add new service for fetching blocks from NeoFS 2024-09-11 08:50:31 +04:00
consensus *: fix linter exhaustive errors 2024-09-26 13:29:03 +03:00
core vm: fix unclaimedGas calculation 2024-10-04 16:55:12 +03:00
crypto *: improve for loop syntax 2024-08-30 21:45:18 +03:00
encoding *: improve for loop syntax 2024-08-30 21:45:18 +03:00
interop go.mod: update to Go 1.22+ 2024-08-30 17:00:11 +03:00
io *: improve for loop syntax 2024-08-30 21:45:18 +03:00
neorpc *: fix linter exhaustive errors 2024-09-26 13:29:03 +03:00
neotest neotest: don't collect coverage for contracts with empty DI 2024-10-07 17:51:19 +03:00
network *: fix linter exhaustive errors 2024-09-26 13:29:03 +03:00
rpcclient *: fix linter gofmt errors 2024-09-26 13:29:04 +03:00
services *: fix linter exhaustive errors 2024-09-26 13:29:03 +03:00
smartcontract *: fix linter exhaustive errors 2024-09-26 13:29:03 +03:00
util *: improve for loop syntax 2024-08-30 21:45:18 +03:00
vm Merge pull request #3599 from Slava0135/fix-modmul 2024-10-07 12:43:45 +03:00
wallet *: use slices.Index/slices.Contains where appropriate 2024-08-27 08:24:52 +03:00