Vyacheslav Kovalevsky
Vyacheslav Kovalevsky
It seems to work, but I found out that when running [this test](https://github.com/nspcc-dev/neofs-contract/blob/3072d7baa88a050882e3070269c6ca8d439ba686/tests/container_test.go), coverage profile for [ListContainerSizes](https://github.com/nspcc-dev/neofs-contract/blob/3072d7baa88a050882e3070269c6ca8d439ba686/contracts/container/contract.go#L628) will be empty, even though it was clearly run inside the test. Need...
Before I fix anything, we need to agree on some details: 1. Collect coverage explicitly (context) or implicitly (when compiling), I picked second option because I though people wouldn't bother...
> > Collect coverage explicitly (context) or implicitly (when compiling) > > Some explicit controls are needed, but I'd default them to "enabled". Most of the time we need it...
> It seems to work, but I found out that when running [this test](https://github.com/nspcc-dev/neofs-contract/blob/3072d7baa88a050882e3070269c6ca8d439ba686/tests/container_test.go), coverage profile for [ListContainerSizes](https://github.com/nspcc-dev/neofs-contract/blob/3072d7baa88a050882e3070269c6ca8d439ba686/contracts/container/contract.go#L628) will be empty, even though it was clearly run inside the test....
> > 1. Extend `Contract` with debug info. > > 2. Make coverage state per-Executor, not per-package, initialize in `NewExecutor`, provide `Executor.DisableCoverage()` and `Executor.EnableCoverage()`. > > 3. Set tracked contracts...
Also, these changes improved performance, because coverage is reported only once per contract deployed (before, it was per Invoke call). So I think using `t.Cleanup()` is fine.
Some thoughts on parallel execution: We need mutex for: 1. `isCoverageEnabled` 2. `reportCoverage` 3. `rawCoverage` when adding new scripts in `Deploy*` But also we need mutex for `coverageHook`, because `rawCoverage`...
>Just provide it to AddSystemFee, nothing prevents you from improving this API (but please, make it in a separate commit since it's a separate logical change) So we are making...
For some reason collecting coverage doesn't work for `_deploy` even if I add hook into `AddNetworkFee` which is called by `NewDeployTxBy`.
rebased to include #3551