Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(sync): restore failing tests #8

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EtienneM
Copy link
Member

@EtienneM EtienneM commented Feb 27, 2023

In the commit b0bb006, I removed the failing tests as I want to have a CI that passes on master. This PR is opened to work on restoring these failing tests.

@Soulou I don't really see how we could do that in the CI. Do you have an idea? An idea would be to setup the test files at the beginning of the execution of the tests. So setting the modification time or the hard link in Go. What do you think?

@EtienneM EtienneM self-assigned this Feb 27, 2023
@@ -34,6 +35,23 @@ func TestFsSyncer_Sync(t *testing.T) {
"it should copy a directory": {
fixtureSrc: "src/dir",
},
"it should copy a hard link": {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this test we want to test that the files a and b are hard links. But this test seems impossible to do on the CI as hard links are not supported in Git: https://stackoverflow.com/a/3731139/1351436

Comment on lines +64 to +73
"it should replace a file with the same content but not the same mtime": {
fixtureSrc: "src/file",
fixtureDst: "dst/cp-file",
expectedChanges: []string{"a"},
},
"it should replace a file with the same size but not the same mtime": {
fixtureSrc: "src/file",
fixtureDst: "dst/same-size",
expectedChanges: []string{"a"},
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are impossible using on the CI as a git clone does not keep the modification time of the files. We would love to have src/file and dst/cp-file with two different modification time. But after a git clone on the CI, both files have the same modification time. It's the time of the git clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant