Skip to content

Commit

Permalink
run all tests in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
stapelberg committed Feb 16, 2025
1 parent 11cc465 commit 19d22e9
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integration/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
)

func TestErrors(t *testing.T) {
t.Parallel()

tmp := t.TempDir()

dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -51,6 +53,8 @@ func TestErrors(t *testing.T) {
}

func TestNoSuchModule(t *testing.T) {
t.Parallel()

tmp := t.TempDir()

dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -81,6 +85,8 @@ func TestNoSuchModule(t *testing.T) {
}

func TestNoReadPermission(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down
20 changes: 20 additions & 0 deletions integration/interop/interop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func TestTridgeRsyncVersion(t *testing.T) {
}

func TestModuleListing(t *testing.T) {
t.Parallel()

rsyncBin := rsynctest.TridgeOrGTFO(t, "TODO: add reason")

tmp := t.TempDir()
Expand Down Expand Up @@ -89,6 +91,8 @@ func TestModuleListing(t *testing.T) {
}

func TestInterop(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -302,6 +306,8 @@ func sourceFullySyncedTo(t *testing.T, dest string) error {
}

func TestInteropSubdir(t *testing.T) {
t.Parallel()

_, source, dest := createSourceFiles(t)

// start a server to sync from
Expand Down Expand Up @@ -329,6 +335,8 @@ func TestInteropSubdir(t *testing.T) {
}

func TestInteropSubdirExclude(t *testing.T) {
t.Parallel()

_, source, dest := createSourceFiles(t)

// start a server to sync from
Expand Down Expand Up @@ -367,6 +375,8 @@ func TestInteropSubdirExclude(t *testing.T) {
}

func TestInteropSubdirExcludeMultipleNested(t *testing.T) {
t.Parallel()

_, source, dest := createSourceFiles(t)

nested := filepath.Join(source, "nested")
Expand Down Expand Up @@ -420,6 +430,8 @@ func TestInteropSubdirExcludeMultipleNested(t *testing.T) {
}

func TestInteropRemoteCommand(t *testing.T) {
t.Parallel()

_, source, dest := createSourceFiles(t)

sourcesArgs := []string{
Expand Down Expand Up @@ -452,6 +464,8 @@ func TestInteropRemoteCommand(t *testing.T) {
}

func TestInteropRemoteDaemon(t *testing.T) {
t.Parallel()

rsyncBin := rsynctest.TridgeOrGTFO(t, "TODO: reason")

tmp, source, dest := createSourceFiles(t)
Expand Down Expand Up @@ -520,6 +534,8 @@ func TestInteropRemoteDaemon(t *testing.T) {
}

func TestInteropRemoteDaemonAnonSSH(t *testing.T) {
t.Parallel()

rsyncBin := rsynctest.TridgeOrGTFO(t, "TODO: reason")

tmp, source, dest := createSourceFiles(t)
Expand Down Expand Up @@ -566,6 +582,8 @@ func TestInteropRemoteDaemonAnonSSH(t *testing.T) {
}

func TestInteropRemoteDaemonAuthorizedSSHFail(t *testing.T) {
t.Parallel()

rsyncBin := rsynctest.TridgeOrGTFO(t, "TODO: reason")

tmp, source, dest := createSourceFiles(t)
Expand Down Expand Up @@ -618,6 +636,8 @@ func TestInteropRemoteDaemonAuthorizedSSHFail(t *testing.T) {
}

func TestInteropRemoteDaemonAuthorizedSSHPass(t *testing.T) {
t.Parallel()

rsyncBin := rsynctest.TridgeOrGTFO(t, "TODO: reason")

tmp, source, dest := createSourceFiles(t)
Expand Down
2 changes: 2 additions & 0 deletions integration/ipacl/ipacl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ acl = [
},
} {
t.Run(tt.remoteAddr, func(t *testing.T) {
t.Parallel()

ln, err := net.Listen("tcp", "localhost:0")
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 2 additions & 0 deletions integration/receiver/receiver_daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
)

func TestDaemonReceiverSync(t *testing.T) {
t.Parallel()

rsyncBin := rsynctest.TridgeOrGTFO(t, "TODO: reason")

tmp := t.TempDir()
Expand Down
2 changes: 2 additions & 0 deletions integration/receiver/receiver_listing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ func init() {
}

func TestReceiverListing(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")

Expand Down
12 changes: 12 additions & 0 deletions integration/receiver/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func setUid(t *testing.T, fn string) (uid, gid int, verify bool) {
}

func TestReceiver(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -207,6 +209,8 @@ func TestReceiver(t *testing.T) {
}

func TestReceiverSync(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -253,6 +257,8 @@ func TestReceiverSync(t *testing.T) {
}

func TestReceiverSyncDelete(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -298,6 +304,8 @@ func TestReceiverSyncDelete(t *testing.T) {
}

func TestReceiverSSH(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -354,6 +362,8 @@ func TestReceiverSSH(t *testing.T) {
}

func TestReceiverCommand(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -409,6 +419,8 @@ func TestReceiverCommand(t *testing.T) {
// TestReceiverSymlinkTraversal passes by default but is useful to simulate
// a symlink race TOCTOU attack by modifying rsyncd/rsyncd.go.
func TestReceiverSymlinkTraversal(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
if err := os.WriteFile(filepath.Join(tmp, "passwd"), []byte("secret"), 0644); err != nil {
t.Fatal(err)
Expand Down
6 changes: 6 additions & 0 deletions integration/sender/sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func setUid(t *testing.T, fn string) (uid, gid int, verify bool) {
}

func TestSender(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -207,6 +209,8 @@ func TestSender(t *testing.T) {
// like TestSender, but without a trailing slash, i.e. do not copy directory
// contents, but the directory itself.
func TestSenderNoSlash(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down Expand Up @@ -349,6 +353,8 @@ func TestSenderNoSlash(t *testing.T) {

// like TestSender, but both source and dest are local directories
func TestSenderBothLocal(t *testing.T) {
t.Parallel()

tmp := t.TempDir()
source := filepath.Join(tmp, "source")
dest := filepath.Join(tmp, "dest")
Expand Down
2 changes: 2 additions & 0 deletions integration/sync/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
)

func TestSyncExtended(t *testing.T) {
t.Parallel()

rsyncBin := rsynctest.TridgeOrGTFO(t, "TODO: reason")

tmp := t.TempDir()
Expand Down

0 comments on commit 19d22e9

Please sign in to comment.