feat(2304): update checksum and timestamp file paths to include task …
Description
This PR addresses #2304 where checksum and timestamp files were not being created in the correct directory when tasks were executed in a subdirectory. The changes ensure that these files are stored within a directory structure that mirrors the task's execution directory, relative to the temporary directory. Additionally a test has been added to verify the correct behaviour.
Motivation
Previously, the checksum and timestamp files were always created in a flat checksum or timestamp directory within the temporary directory, regardless of the task's execution directory. This could lead to conflicts and incorrect up-to-date checks when multiple tasks with the same name were executed in different subdirectories.
The motivation behind this change is to ensure that the fingerprinting mechanism correctly tracks task dependencies and execution state, even when tasks are executed in different directories. This is crucial for maintaining the reliability and correctness of the task execution process.
What was changed
internal/fingerprint/sources_checksum.go: TheIsUpToDatefunction was modified to create the checksum directory within a subdirectory that mirrors the task's execution directory (t.Dir). ThechecksumFilePathfunction was also updated accordingly.internal/fingerprint/sources_timestamp.go: ThetimestampFilePathfunction was updated to create the timestamp directory within a subdirectory that mirrors the task's execution directory (t.Dir).internal/fingerprint/sources_timestamp_test.go: A new test filesources_timestamp_test.gowas added to verify the correct creation of timestamp files in the appropriate subdirectories.internal/fingerprint/timestamp_checker_test.go: A new test filetimestamp_checker_test.gowas added to improve testing the functionality of timestamp checker.task_test.go: The checksum path generation in theTestStatusChecksumwas adapted to the changed directory structure.
Tests
- New unit tests were added in
internal/fingerprint/sources_timestamp_test.goto specifically verify the correct creation of timestamp files in the appropriate subdirectories. - New unit tests were added in
internal/fingerprint/timestamp_checker_test.goto improve testing the functionality of timestamp checker. - Changed path to checksum files in existing test in
task_test.go