mirror of
https://github.com/rclone/rclone
synced 2025-04-04 22:25:31 +02:00
cmd/gitannex: Repeat TestEndToEnd for all layout modes
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 #7625
This commit is contained in:
parent
9a2b85d71c
commit
4ab235c06c
@ -220,23 +220,31 @@ func skipE2eTestIfNecessary(t *testing.T) {
|
|||||||
func TestEndToEnd(t *testing.T) {
|
func TestEndToEnd(t *testing.T) {
|
||||||
skipE2eTestIfNecessary(t)
|
skipE2eTestIfNecessary(t)
|
||||||
|
|
||||||
// Create a temp directory and chdir there, just in case.
|
for _, mode := range allLayoutModes() {
|
||||||
originalWd, err := os.Getwd()
|
mode := mode
|
||||||
require.NoError(t, err)
|
t.Run(string(mode), func(t *testing.T) {
|
||||||
tempDir := t.TempDir()
|
t.Parallel()
|
||||||
require.NoError(t, os.Chdir(tempDir))
|
|
||||||
defer func() { require.NoError(t, os.Chdir(originalWd)) }()
|
|
||||||
|
|
||||||
testingContext := makeE2eTestingContext(t)
|
// Create a temp directory and chdir there, just in case.
|
||||||
testingContext.installRcloneGitannexSymlink(t)
|
originalWd, err := os.Getwd()
|
||||||
testingContext.installRcloneConfig(t)
|
require.NoError(t, err)
|
||||||
testingContext.createGitRepo(t)
|
tempDir := t.TempDir()
|
||||||
|
require.NoError(t, os.Chdir(tempDir))
|
||||||
|
t.Cleanup(func() { require.NoError(t, os.Chdir(originalWd)) })
|
||||||
|
|
||||||
testingContext.runInRepo(t, "git", "annex", "initremote", "MyTestRemote",
|
testingContext := makeE2eTestingContext(t)
|
||||||
"type=external", "externaltype=rclone-builtin", "encryption=none",
|
testingContext.installRcloneGitannexSymlink(t)
|
||||||
"rcloneremotename=MyRcloneRemote", "rcloneprefix="+testingContext.ephemeralRepoDir)
|
testingContext.installRcloneConfig(t)
|
||||||
|
testingContext.createGitRepo(t)
|
||||||
|
|
||||||
testingContext.runInRepo(t, "git", "annex", "testremote", "MyTestRemote")
|
testingContext.runInRepo(t, "git", "annex", "initremote", "MyTestRemote",
|
||||||
|
"type=external", "externaltype=rclone-builtin", "encryption=none",
|
||||||
|
"rcloneremotename=MyRcloneRemote", "rcloneprefix="+testingContext.ephemeralRepoDir,
|
||||||
|
"rclonelayout="+string(mode))
|
||||||
|
|
||||||
|
testingContext.runInRepo(t, "git", "annex", "testremote", "MyTestRemote")
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For each layout mode, ensure that we're compatible with data written by
|
// For each layout mode, ensure that we're compatible with data written by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user