Thanks to visit codestin.com
Credit goes to github.com

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 pkg/commands/compute/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ func TestBuildJavaScript(t *testing.T) {
}
}

var stdout bytes.Buffer
var stdout threadsafe.Buffer
opts := testutil.NewRunOpts(testcase.args, &stdout)
err = app.Run(opts)
t.Log(stdout.String())
Expand Down
20 changes: 10 additions & 10 deletions pkg/commands/compute/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,12 +792,12 @@ func TestDeploy(t *testing.T) {
},
wantOutput: []string{
"Hostname or IP address: [developer.fastly.com]",
"Port: [80]",
"Port: [443]",
"Hostname or IP address: [httpbin.org]",
"Port: [80]",
"Port: [443]",
"Creating service",
"Creating backend 'foo_backend' (host: developer.fastly.com, port: 80)",
"Creating backend 'bar_backend' (host: httpbin.org, port: 80)",
"Creating backend 'foo_backend' (host: developer.fastly.com, port: 443)",
"Creating backend 'bar_backend' (host: httpbin.org, port: 443)",
"Uploading package",
"Activating service",
"SUCCESS: Deployed package (service 12345, version 1)",
Expand Down Expand Up @@ -843,13 +843,13 @@ func TestDeploy(t *testing.T) {
wantOutput: []string{
"Configure a backend called 'foo_backend'",
"Hostname or IP address: [127.0.0.1]",
"Port: [80]",
"Port: [443]",
"Configure a backend called 'bar_backend'",
"Hostname or IP address: [127.0.0.1]",
"Port: [80]",
"Port: [443]",
"Creating service",
"Creating backend 'foo_backend' (host: 127.0.0.1, port: 80)",
"Creating backend 'bar_backend' (host: 127.0.0.1, port: 80)",
"Creating backend 'foo_backend' (host: 127.0.0.1, port: 443)",
"Creating backend 'bar_backend' (host: 127.0.0.1, port: 443)",
"Uploading package",
"Activating service",
"SUCCESS: Deployed package (service 12345, version 1)",
Expand Down Expand Up @@ -979,7 +979,7 @@ func TestDeploy(t *testing.T) {
},
wantOutput: []string{
"Backend (hostname or IP address, or leave blank to stop adding backends):",
"Backend port number: [80]",
"Backend port number: [443]",
"Backend name:",
"Creating backend 'my_backend_name' (host: fastly.com, port: 443)",
"SUCCESS: Deployed package (service 12345, version 1)",
Expand Down Expand Up @@ -1023,7 +1023,7 @@ func TestDeploy(t *testing.T) {
},
wantOutput: []string{
"Backend (hostname or IP address, or leave blank to stop adding backends):",
"Backend port number: [80]",
"Backend port number: [443]",
"Backend name:",
"Creating backend 'backend_1' (host: fastly.com, port: 443)",
"Creating backend 'backend_2' (host: google.com, port: 123)",
Expand Down
4 changes: 2 additions & 2 deletions pkg/commands/compute/setup/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (b *Backends) checkPredefined() error {
addr = defaultAddress
}

port := int(80)
port := int(443)
if settings.Port > 0 {
port = settings.Port
}
Expand Down Expand Up @@ -232,7 +232,7 @@ func (b *Backends) promptForBackend() error {
return nil
}

port := int(80)
port := int(443)
input, err := text.Input(b.Stdout, text.BoldYellow(fmt.Sprintf("Backend port number: [%d] ", port)), b.Stdin)
if err != nil {
return fmt.Errorf("error reading prompt input: %w", err)
Expand Down