Refactor actions.Client with options to help extensibility (#2193)

This commit is contained in:
Francesco Renzi
2023-01-23 11:50:14 +00:00
committed by GitHub
parent 282f2dd09c
commit 3327f620fb
11 changed files with 642 additions and 1285 deletions

View File

@@ -6,20 +6,15 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"time"
"github.com/actions/actions-runner-controller/logging"
"github.com/go-logr/logr"
)
func TestAddClient(t *testing.T) {
logger, err := logging.NewLogger(logging.LogLevelDebug, logging.LogFormatText)
if err != nil {
fmt.Fprintf(os.Stderr, "Error: creating logger: %v\n", err)
os.Exit(1)
}
logger := logr.Discard()
multiClient := NewMultiClient("test-user-agent", logger).(*multiClient)
ctx := context.Background()