Skip to content

Commit cced823

Browse files
committed
Resolved PR feedback
1 parent 2fb2f5d commit cced823

26 files changed

+104
-39
lines changed

cmd/modern/root/install/mssql-base.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,13 @@ func (c *MssqlBase) createContainer(imageName string, contextName string) {
314314
endpoint, _ := config.CurrentContext()
315315

316316
// Connect to the instance as `sa` so we can create a new user
317+
//
318+
// For Unit Testing we use the Docker Hello World container, which
319+
// starts much faster than the SQL Server container!
317320
if c.errorLogEntryToWaitFor == "Hello from Docker!" {
318-
c.sql = sql.New(true)
321+
c.sql = sql.New(sql.SqlOptions{UnitTesting: true})
319322
} else {
320-
c.sql = sql.New(false)
323+
c.sql = sql.New(sql.SqlOptions{})
321324
}
322325

323326
c.sql.Connect(
@@ -330,7 +333,7 @@ func (c *MssqlBase) createContainer(imageName string, contextName string) {
330333
Password: secret.Encode(saPassword, c.encryptPassword),
331334
},
332335
Name: "sa",
333-
}, false)
336+
}, sql.ConnectOptions{Interactive: false})
334337

335338
// Download and restore DB if asked
336339
defaultDbAlreadyCreated := false
@@ -492,7 +495,11 @@ EXEC(@sql)`
492495
return
493496
}
494497

495-
func (c *MssqlBase) downloadImage(imageName string, output *output.Output, controller *container.Controller) {
498+
func (c *MssqlBase) downloadImage(
499+
imageName string,
500+
output *output.Output,
501+
controller *container.Controller,
502+
) {
496503
output.Infof("Downloading %v", imageName)
497504
err := controller.EnsureImage(imageName)
498505
if err != nil || c.unitTesting {

cmd/modern/root/open/ads.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (c *Ads) launchAds(host string, port int, username string) {
9696
}
9797

9898
tool := tools.NewTool("ads")
99-
if !tool.IsInstalled() {
99+
if tool.IsInstalled() {
100100
output.Fatalf(tool.HowToInstall())
101101
} else {
102102
_, err := tool.Run(args)

cmd/modern/root/open_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
package root
25

36
import (

cmd/modern/root/query.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ func (c *Query) DefineCommand(...cmdparser.CommandOptions) {
5656
func (c *Query) run() {
5757
endpoint, user := config.CurrentContext()
5858

59-
s := sql.New(false)
59+
s := sql.New(sql.SqlOptions{})
6060
if c.text == "" {
61-
s.Connect(endpoint, user, true)
61+
s.Connect(endpoint, user, sql.ConnectOptions{Interactive: true})
6262
} else {
63-
s.Connect(endpoint, user, false)
63+
s.Connect(endpoint, user, sql.ConnectOptions{Interactive: false})
6464
}
6565

6666
s.Query(c.text)

internal/cmdparser/test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
package cmdparser
25

36
import (

internal/credman/credman_linux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
package credman

internal/credman/credman_windows.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
// Package credman provides functions for interacting with the Windows Credential
25
// Manager API, which allows to read, write, and delete saved credentials on
36
// the local machine.

internal/credman/credman_windows_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
package credman
25

36
import (

internal/credman/types_windows.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
package credman
25

36
import (

internal/http/http_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
14
package http
25

36
import (

0 commit comments

Comments
 (0)