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
cmd/gitannex: Add layout modes for compatibility #7754
Conversation
306ccee
to
87a52e3
Compare
@ncw, PTAL! FYI: @yarikoptic |
f49d1b9
to
46e70f3
Compare
Wow, the for loop thing bit me again. Fixed in the latest push. https://go.dev/blog/loopvar-preview Edit: filed #7758 to start a discussion about upgrading to Go 1.22. |
I haven't had a chance to try yet, but I just want to say Thank you. I wonder if there could be e2e test run where first repo is initialized to use |
You're very welcome! I'm just working on this for fun, so it's a pleasant surprise that someone finds it useful!
In case you didn't spot it, the new You raise a good point, though. I think it's worth adding a migration test that runs
Looks like nearly |
@yarikoptic PTAL at the latest commit, which adds TestEndToEndMigration tests. |
f1e63ca
to
85c3cf0
Compare
that is great - thank you! I have only vague memory on how I decided that there is none -- I remember searching for
aren't e2e tests ran on CI? if so -- should get |
Ah! Great catch! I'll update this PR to install git-annex-remote-rclone on Linux and macOS. (Still punting on Windows.) |
@ncw PTAL :) Also, is there a way to tell which tests were skipped on CI? What do you think about changing CI to run The reason I ask is that I mistakenly believed these new tests were running on CI because I saw something like this in the log, but it turned out that they were certainly being skipped due to the missing
|
4120ee7
to
5742730
Compare
Hey @ncw, looks like CI is skipping the gitannex end-to-end tests because the
I have been assuming that the value of It looks like the tests construct "v.1.67.0-DEV" based on this logic: Lines 8 to 12 in 3051769
Meanwhile, the Makefile just entirely clobbers Line 53 in 3051769
The latest commit changes the Makefile to clobber the version tag for tests, too. Let's see if that does the trick :) |
Interesting, the tests seem to run on Linux now, but mac_amd64 now skips the tests for a different reason:
|
d57500d
to
0285c95
Compare
0285c95
to
c2d0ef0
Compare
Aha! I think what's happening is that CI is running something like As a workaround, I'll just log a warning rather than skipping e2e tests when the tags do not match. |
a5a9061
to
79236d8
Compare
@ncw This is ready for review, more or less! I'm still stumped by the GoTags not matching, but my workaround is to just run the e2e tests anyway. Another questionable change in this PR is that I changed |
This commit adds support for the same repo layouts supported by git-annex-remote-rclone. This should enable git-annex users with remotes of type "rclone" to switch to a "rclone-builtin" without needing to retransfer content. Issue rclone#7625
TestEndToEndRepoLayoutCompat exercises git-annex-remote-rclone-builtin and git-annex-remote-rclone on the same rclone remote to ensure they are compatible. It repeats the same test for all known layout modes. Issue rclone#7625
I'm hopeful that running these in parallel will not impact CI runtime very much, but that likely depends on the number of CPU cores and whether the tmp filesystem is backed by memory vs a physical disk. Issue rclone#7625
Now that e2e tests are running in parallel, undoing the chdir to the temp dir was causing flaky failures on cleanup. We don't need it anyway because the worrisome subcommands have their working directory controlled by `runInRepo()`. Issue rclone#7625
For each layout mode, these tests start with a git-annex-remote-rclone remote, migrate it to a git-annex-remote-rclone-builtin remote. They verify that a file copied pre-migration is still present and that `git annex testremote` passes. Issue rclone#7625
79236d8
to
8bb03c6
Compare
@ncw Sorry to nag, but PTAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look through that - all looking very nice.
Can you drop the commit adding -v
to make quicktest
and I'll merge what we've got - thank you :-)
Makefile
Outdated
@@ -87,13 +87,13 @@ test: rclone test_all | |||
|
|||
# Quick test | |||
quicktest: | |||
RCLONE_CONFIG="/notfound" go test $(BUILDTAGS) ./... | |||
RCLONE_CONFIG="/notfound" go test -v $(BUILDTAGS) ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not in favour of adding the -v
here. Rclone has a lot of tests and having to look through the -v
output in the CI is not fun! (279 lines vs 68057) So I'm not in favour of making it longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's totally fair! It's not too hard to temporarily add the -v
as needed. Done.
This enables gitannex end-to-end tests to run on CI. Otherwise, the version would not match and tests that check the rclone version would fail like so: ``` === RUN TestEndToEnd e2e_test.go:199: Skipping due to rclone version: expected version "v1.67.0-DEV", but got "v1.67.0-beta.7905.220bbe24d.merge" --- SKIP: TestEndToEnd (0.07s) ``` Issue rclone#7625
8bb03c6
to
d2196bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect - thank you :-)
Will merge now.
What is the purpose of this change?
This change adds support for the repo layouts defined by git-annex-remote-rclone. This should enable git-annex users with external remotes of type "rclone" to switch to "rclone-builtin" without needing to retransfer content. It also adds e2e compatibility tests in an attempt to verify this claim!
Was the change discussed in an issue or in the forum before?
Issue #7625
Checklist