Skip to content

Commit

Permalink
Minor fixes from analyzing test results (#23260)
Browse files Browse the repository at this point in the history
Newlines improve test result parsing.

Extra `t.Parallel()` calls removed in subtest since parent test and
package are already parallelized.
  • Loading branch information
getvictor authored Oct 25, 2024
1 parent 40f7cdf commit 7226083
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmd/fleetctl/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ func generateMDMAppleCommand() *cli.Command {
// before printing the CSR output message.
client, err := clientFromCLI(c)
if err != nil {
fmt.Fprintf(c.App.ErrWriter, "client from CLI: %s", err)
fmt.Fprintf(c.App.ErrWriter, "client from CLI: %s\n", err)
return ErrGeneric
}

csr, err := client.RequestAppleCSR()
if err != nil {
fmt.Fprintf(c.App.ErrWriter, "requesting APNs CSR: %s", err)
fmt.Fprintf(c.App.ErrWriter, "requesting APNs CSR: %s\n", err)
return ErrGeneric
}

if err := os.WriteFile(csrPath, csr, defaultFileMode); err != nil {
fmt.Fprintf(c.App.ErrWriter, "write CSR: %s", err)
fmt.Fprintf(c.App.ErrWriter, "write CSR: %s\n", err)
return ErrGeneric
}

appCfg, err := client.GetAppConfig()
if err != nil {
fmt.Fprintf(c.App.ErrWriter, "fetching app config: %s", err)
fmt.Fprintf(c.App.ErrWriter, "fetching app config: %s\n", err)
return ErrGeneric
}

Expand Down
3 changes: 0 additions & 3 deletions server/datastore/mysql/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ func TestWhereFilterHostsByTeams(t *testing.T) {
for _, tt := range testCases {
tt := tt
t.Run("", func(t *testing.T) {
t.Parallel()
ds := &Datastore{logger: log.NewNopLogger()}
sql := ds.whereFilterHostsByTeams(tt.filter, "hosts")
assert.Equal(t, tt.expected, sql)
Expand Down Expand Up @@ -631,7 +630,6 @@ func TestWhereOmitIDs(t *testing.T) {
for _, tt := range testCases {
tt := tt
t.Run("", func(t *testing.T) {
t.Parallel()
ds := &Datastore{logger: log.NewNopLogger()}
sql := ds.whereOmitIDs("id", tt.omits)
assert.Equal(t, tt.expected, sql)
Expand Down Expand Up @@ -856,7 +854,6 @@ func TestWhereFilterTeams(t *testing.T) {
for _, tt := range testCases {
tt := tt
t.Run("", func(t *testing.T) {
t.Parallel()
ds := &Datastore{logger: log.NewNopLogger()}
sql := ds.whereFilterTeams(tt.filter, "t")
assert.Equal(t, tt.expected, sql)
Expand Down

0 comments on commit 7226083

Please sign in to comment.