I think I am not understanding the idea of track file dependencies properly, I have 2 tests reading file from a library both from file and from an assembly resource (see source at github).
However when I change the json files manually I expect NCrunch to treat the 2 tests as impacted, but they are not. Have I misunderstood how this should be working?
The tracking of file dependencies for the purposes of impact detection is best effort, since there's quite a few constraints around what we can easily do in this area.
This feature is subject to a couple of critical conditions that I know about:
1. The files being accessed by your code must be included in your project and copied to your build output directory as resource files
2. This feature will not work under .NET Core
It's likely there are other constraints, as the system works using low level API hooks, of which the function can be somewhat environment specific. It's possible that there are file I/O routines that don't trigger the hooks.
Thanks. Maybe this could be reflected in documentation at https://www.ncrunch.net/documentation/V3/reference_project-configuration_track-file-dependencies in some way?
FWIW, when I did my tests I only managed to get a test impacted if it read a non resource file that was copied to bin output, and it was in a .Net Framework test project instead of dotnet core (although the file itself could be placed in a net standard library, I used the code at https://github.com/greenmooseSE/test-repo/tree/try-ncrunchTrackFiles )
I expect that the .resx files likely won't trigger the impact detection using this feature, as they get accessed by the runtime prior to the test beginning its execution.
Good catch on the documentation. I'll make sure this gets updated with our next release :)
Although... It is a real pity this very neat feature does not work with net core. Is there any plans of supporting it?
(my use case involves .NET core web api and generated API client code, which makes it kindof hard since that web api cannot easily be referenced by a .NET 4.6.2 test project)