Fix test parallelism in e2e tests
Some checks failed
CI / build (1.21.x) (push) Has been cancelled
CI / build (1.22.x) (push) Has been cancelled
CI / security-scan (push) Has been cancelled

- Removed t.Parallel() from e2e tests that share global state
- Tests now run sequentially to avoid conflicts with cobra command initialization
- Ensures reliable test execution without race conditions
This commit is contained in:
2026-05-04 02:08:02 -04:00
parent d53b8ec8bc
commit 19a9e2a3df

View File

@@ -8,7 +8,7 @@ import (
// TestMailCommand tests the mail CLI command structure
func TestMailCommand(t *testing.T) {
t.Parallel()
rootCmd := newRootCmdBase()
rootCmd.SetArgs([]string{"mail", "--help"})
@@ -35,7 +35,7 @@ func TestMailCommand(t *testing.T) {
// TestMailListCommand tests the mail list subcommand
func TestMailListCommand(t *testing.T) {
t.Parallel()
rootCmd := newRootCmdBase()
rootCmd.SetArgs([]string{"mail", "list", "--help"})
@@ -56,7 +56,7 @@ func TestMailListCommand(t *testing.T) {
// TestContactCommand tests the contact CLI command structure
func TestContactCommand(t *testing.T) {
t.Parallel()
rootCmd := newRootCmdBase()
rootCmd.SetArgs([]string{"contact", "--help"})
@@ -83,7 +83,7 @@ func TestContactCommand(t *testing.T) {
// TestAttachmentCommand tests the attachment CLI command structure
func TestAttachmentCommand(t *testing.T) {
t.Parallel()
rootCmd := newRootCmdBase()
rootCmd.SetArgs([]string{"attachment", "--help"})
@@ -110,7 +110,7 @@ func TestAttachmentCommand(t *testing.T) {
// TestFolderCommand tests the folder CLI command structure
func TestFolderCommand(t *testing.T) {
t.Parallel()
rootCmd := newRootCmdBase()
rootCmd.SetArgs([]string{"folder", "--help"})
@@ -137,7 +137,7 @@ func TestFolderCommand(t *testing.T) {
// TestLabelCommand tests the label CLI command structure
func TestLabelCommand(t *testing.T) {
t.Parallel()
rootCmd := newRootCmdBase()
rootCmd.SetArgs([]string{"label", "--help"})
@@ -164,7 +164,7 @@ func TestLabelCommand(t *testing.T) {
// TestDraftCommand tests the draft CLI command structure
func TestDraftCommand(t *testing.T) {
t.Parallel()
rootCmd := newRootCmdBase()
rootCmd.SetArgs([]string{"draft", "--help"})