Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/devstack/devstack_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func TestDevstackIntegration(t *testing.T) {
src := emails[0]
for _, email := range emails[1:] {
// Check that bob has alice's public files
targetDir := filepath.Join(opts.root, email, "datasites", "datasites", src, "public")
targetDir := filepath.Join(opts.root, email, "datasites", src, "public")
entries, err := os.ReadDir(targetDir)
if err != nil {
t.Fatalf("read target dir %s: %v", targetDir, err)
Expand Down
14 changes: 9 additions & 5 deletions cmd/devstack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,12 @@ func startClient(binPath, root, email, serverURL string, port int) (clientState,
if err := os.MkdirAll(configDir, 0o755); err != nil {
return clientState{}, err
}
dataDir := filepath.Join(emailDir, "datasites")
if err := os.MkdirAll(dataDir, 0o755); err != nil {
dataDir := emailDir
// Ensure encrypted and shadow roots exist under the workspace root.
if err := os.MkdirAll(filepath.Join(dataDir, "datasites"), 0o755); err != nil {
return clientState{}, err
}
if err := os.MkdirAll(filepath.Join(dataDir, "unencrypted"), 0o755); err != nil {
return clientState{}, err
}
logDir := filepath.Join(homeDir, ".syftbox", "logs")
Expand Down Expand Up @@ -822,7 +826,7 @@ func runSyncCheck(root string, emails []string) error {

for _, email := range emails[1:] {
// Each client syncs alice's public dir to their local datasites/alice@example.com/public/
targetDir := filepath.Join(root, email, "datasites", "datasites", src, "public")
targetDir := filepath.Join(root, email, "datasites", src, "public")
_ = os.MkdirAll(targetDir, 0o755) // best-effort
target := filepath.Join(targetDir, filename)
if err := waitForFile(target, content, 45*time.Second); err != nil {
Expand All @@ -836,8 +840,8 @@ func runSyncCheck(root string, emails []string) error {
}

func publicPath(root, email string) string {
// Workspace root is <root>/<email>/datasites; actual public dir lives under datasites/<user>/public
return filepath.Join(root, email, "datasites", "datasites", email, "public")
// Workspace root is <root>/<email>; actual public dir lives under datasites/<user>/public
return filepath.Join(root, email, "datasites", email, "public")
}

// triggerDownloadForAll asks the server to serve the probe for each user to ensure their daemon pulls it.
Expand Down
30 changes: 15 additions & 15 deletions cmd/devstack/performance_test_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ type MetricsCollector struct {

// TestReport contains test results
type TestReport struct {
Duration time.Duration
TotalOps int
SuccessOps int
ErrorOps int
P50Latency time.Duration
P90Latency time.Duration
P95Latency time.Duration
P99Latency time.Duration
AvgThroughput float64
Duration time.Duration
TotalOps int
SuccessOps int
ErrorOps int
P50Latency time.Duration
P90Latency time.Duration
P95Latency time.Duration
P99Latency time.Duration
AvgThroughput float64
PeakThroughput float64
ErrorRate float64
PeakMemoryMB uint64
AvgCPUPercent float64
ErrorRate float64
PeakMemoryMB uint64
AvgCPUPercent float64
}

// NewDevstackHarness creates a test harness with full devstack
Expand Down Expand Up @@ -209,7 +209,7 @@ func NewDevstackHarness(t *testing.T) *DevstackTestHarness {
email: emails[0],
state: clients[0],
dataDir: clients[0].DataPath,
publicDir: filepath.Join(opts.root, emails[0], "datasites", "datasites", emails[0], "public"),
publicDir: filepath.Join(opts.root, emails[0], "datasites", emails[0], "public"),
metrics: &ClientMetrics{},
}

Expand All @@ -218,7 +218,7 @@ func NewDevstackHarness(t *testing.T) *DevstackTestHarness {
email: emails[1],
state: clients[1],
dataDir: clients[1].DataPath,
publicDir: filepath.Join(opts.root, emails[1], "datasites", "datasites", emails[1], "public"),
publicDir: filepath.Join(opts.root, emails[1], "datasites", emails[1], "public"),
metrics: &ClientMetrics{},
}

Expand Down Expand Up @@ -307,7 +307,7 @@ func (c *ClientHelper) UploadFile(relPath string, content []byte) error {
func (c *ClientHelper) WaitForFile(senderEmail, relPath string, expectedMD5 string, timeout time.Duration) error {
c.t.Helper()

// File syncs to datasites/datasites/{sender}/public/{relPath}
// File syncs to datasites/{sender}/public/{relPath}
fullPath := filepath.Join(c.dataDir, "datasites", senderEmail, "public", relPath)

deadline := time.Now().Add(timeout)
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ sbdev-test-perf-sandbox *ARGS:
PERF_TEST_SANDBOX="$sandbox_path" go test -v -timeout 30m {{ ARGS }}
echo ""
echo "Test files preserved in: $sandbox_path"
echo "Files from alice: $sandbox_path/alice@example.com/datasites/datasites/alice@example.com/public/"
echo "Files synced to bob: $sandbox_path/bob@example.com/datasites/datasites/alice@example.com/public/"
echo "Files from alice: $sandbox_path/alice@example.com/datasites/alice@example.com/public/"
echo "Files synced to bob: $sandbox_path/bob@example.com/datasites/alice@example.com/public/"

[group('devstack')]
sbdev-list:
Expand Down