File tree 5 files changed +12
-36
lines changed
internal/infrastructure/app
5 files changed +12
-36
lines changed Original file line number Diff line number Diff line change 14
14
badge-title : Coverage (integration)
15
15
coverage-file : assets/coverage/integration/coverage.out
16
16
report : true
17
- report -path : assets/coverage/integration
17
+ output -path : assets/coverage/integration
18
18
chart : true
Original file line number Diff line number Diff line change 14
14
badge-title : Coverage (unit)
15
15
coverage-file : assets/coverage/unit/coverage.out
16
16
report : true
17
- report -path : assets/coverage/unit
17
+ output -path : assets/coverage/unit
18
18
chart : true
Original file line number Diff line number Diff line change 9
9
----
10
10
11
11
[ ![ Lint Golangci] ( https://github.com/mgerasimchuk/protty/actions/workflows/lint-golangci.yml/badge.svg )] ( https://github.com/mgerasimchuk/protty/actions/workflows/lint-golangci.yml )
12
- [ ![ Test Unit ] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-unit.yml/badge.svg )] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-unit.yml )
12
+ [ ![ Test (unit) ] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-unit.yml/badge.svg )] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-unit.yml )
13
13
[ ![ Coverage (unit)] ( https://github.com/mgerasimchuk/protty/wiki/assets/coverage/unit/coverage.svg )] ( https://github.com/mgerasimchuk/protty/wiki/Test-coverage-report )
14
- [ ![ Test Integration ] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-integration.yml/badge.svg )] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-integration.yml )
14
+ [ ![ Test (integration) ] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-integration.yml/badge.svg )] ( https://github.com/mgerasimchuk/protty/actions/workflows/test-integration.yml )
15
15
[ ![ Coverage (integration)] ( https://github.com/mgerasimchuk/protty/wiki/assets/coverage/integration/coverage.svg )] ( https://github.com/mgerasimchuk/protty/wiki/Test-coverage-report )
16
16
17
17
Protty is an HTTP proxy written in Go that redirects, intercepts, and modifies both requests to a remote host and their
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -7,14 +7,13 @@ import (
7
7
"context"
8
8
"fmt"
9
9
"github.com/gavv/httpexpect/v2"
10
- "github.com/sirupsen/logrus"
11
10
"github.com/stretchr/testify/assert"
12
11
"io"
13
12
"net/http"
14
13
"os"
15
- "protty/internal/infrastructure/app/mock"
16
14
"protty/internal/infrastructure/config"
17
15
"testing"
16
+ "time"
18
17
)
19
18
20
19
func TestStartCommand (t * testing.T ) {
@@ -71,12 +70,16 @@ func TestStartCommand(t *testing.T) {
71
70
cfg := config .GetStartCommandConfig ()
72
71
prottyApp := NewProttyApp (cfg )
73
72
prottyApp .logger .SetOutput (io .Discard )
74
- logrusHook := mock .NewLogrusHook ([]logrus.Level {logrus .InfoLevel }, 50 )
75
- prottyApp .logger .Hooks .Add (logrusHook )
76
73
go func () { assert .NoError (t , prottyApp .Start ()) }()
77
74
78
75
// waiting for the first info message from logger as a signal that the proxy is ready to handle requests
79
- <- logrusHook .EntryChan ()
76
+ for i := 0 ; i < 5 ; i ++ {
77
+ _ , err := http .Get ("http://0.0.0.0:80" )
78
+ if err == nil {
79
+ break
80
+ }
81
+ time .Sleep (50 * time .Millisecond )
82
+ }
80
83
81
84
// test
82
85
e := httpexpect .Default (t , fmt .Sprintf ("http://0.0.0.0:%d" , cfg .LocalPort .Value ))
You can’t perform that action at this time.
0 commit comments