otiai10 / copy

Go copy directory recursively
https://pkg.go.dev/github.com/otiai10/copy
MIT License
713 stars 115 forks source link

test: Add testing for FileCopyMethod #165

Open eth-p opened 3 weeks ago

eth-p commented 3 weeks ago

This commit is stacked on top of #164. That must be reviewed and merged first.

Reason

To prevent regressions, we want good test coverage no matter the FileCopyMethod used. We also want to make sure other FileCopyMethods behave like CopyBytes when successful for consistency.

Instead of writing many tests to check the behaviour is the same, we re-use existing tests to check that other FileCopyMethods work like CopyBytes. The CI runs then runs these tests so the developer does not need different operating systems and the right filesystems installed.

Details

This series of commits changes the CI and testing so that:

Example

This was a run to ensure the copy-on-write (reflink) implementation works.

Previous runs helped me catch a couple edge cases:

That would not have been as easy without these changes.