refactor(storage): scope exports by owner
This commit is contained in:
@@ -138,9 +138,11 @@ public sealed class BackgroundWorkerTenantTests
|
||||
Mock.Of<IStartupReadiness>());
|
||||
|
||||
Assert.Equal(new BackgroundWorkerRunResult(true, 2, 2, 0), await worker.RunOnceAsync(default));
|
||||
var files = Directory.GetFiles(Path.Combine(root, "exports"), "*.json");
|
||||
var files = Directory.GetFiles(Path.Combine(root, "exports"), "*.json", SearchOption.AllDirectories);
|
||||
Assert.Equal(2, files.Length);
|
||||
Assert.DoesNotContain(files, path => path.Contains("user-1", StringComparison.Ordinal) || path.Contains("user-2", StringComparison.Ordinal));
|
||||
Assert.Equal(2, files.Select(path => Directory.GetParent(path)!.Name).Distinct(StringComparer.Ordinal).Count());
|
||||
Assert.All(files, path => Assert.Matches("^[0-9a-f]{64}$", Directory.GetParent(path)!.Name));
|
||||
var owners = new List<string?>();
|
||||
foreach (var path in files)
|
||||
{
|
||||
@@ -159,7 +161,7 @@ public sealed class BackgroundWorkerTenantTests
|
||||
}
|
||||
owners.Sort(StringComparer.Ordinal);
|
||||
Assert.Equal(new[] { "user-1", "user-2" }, owners);
|
||||
Assert.Empty(Directory.GetFiles(Path.Combine(root, "exports"), "*.tmp"));
|
||||
Assert.Empty(Directory.GetFiles(Path.Combine(root, "exports"), "*.tmp", SearchOption.AllDirectories));
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user