mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-10-05 03:26:09 +02:00
Refactor actions client error to include request id (#3430)
Co-authored-by: Francesco Renzi <rentziass@gmail.com>
This commit is contained in:
co-authored by
Francesco Renzi
parent
963ae48a3f
commit
8075e5ee74
@@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/actions/actions-runner-controller/github/actions"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -124,9 +125,15 @@ func TestGetRunnerScaleSet(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Multiple runner scale sets found", func(t *testing.T) {
|
||||
wantErr := fmt.Errorf("multiple runner scale sets found with name %s", scaleSetName)
|
||||
reqID := uuid.NewString()
|
||||
wantErr := &actions.ActionsError{
|
||||
StatusCode: http.StatusOK,
|
||||
ActivityID: reqID,
|
||||
Err: fmt.Errorf("multiple runner scale sets found with name %q", scaleSetName),
|
||||
}
|
||||
runnerScaleSetsResp := []byte(`{"count":2,"value":[{"id":1,"name":"ScaleSet"}]}`)
|
||||
server := newActionsServer(t, http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.Header().Set(actions.HeaderActionsActivityID, reqID)
|
||||
w.Write(runnerScaleSetsResp)
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user