Extend the user agent and fix the build version for the listener app (#2892)

This commit is contained in:
Nikola Jokic
2023-09-14 20:10:49 +02:00
committed by GitHub
parent ea2fb32e20
commit 07bff8aa1e
19 changed files with 186 additions and 94 deletions
+62 -19
View File
@@ -1,4 +1,4 @@
// Code generated by mockery v2.16.0. DO NOT EDIT.
// Code generated by mockery v2.33.2. DO NOT EDIT.
package actions
@@ -19,6 +19,10 @@ func (_m *MockActionsService) AcquireJobs(ctx context.Context, runnerScaleSetId
ret := _m.Called(ctx, runnerScaleSetId, messageQueueAccessToken, requestIds)
var r0 []int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int, string, []int64) ([]int64, error)); ok {
return rf(ctx, runnerScaleSetId, messageQueueAccessToken, requestIds)
}
if rf, ok := ret.Get(0).(func(context.Context, int, string, []int64) []int64); ok {
r0 = rf(ctx, runnerScaleSetId, messageQueueAccessToken, requestIds)
} else {
@@ -27,7 +31,6 @@ func (_m *MockActionsService) AcquireJobs(ctx context.Context, runnerScaleSetId
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int, string, []int64) error); ok {
r1 = rf(ctx, runnerScaleSetId, messageQueueAccessToken, requestIds)
} else {
@@ -42,6 +45,10 @@ func (_m *MockActionsService) CreateMessageSession(ctx context.Context, runnerSc
ret := _m.Called(ctx, runnerScaleSetId, owner)
var r0 *RunnerScaleSetSession
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int, string) (*RunnerScaleSetSession, error)); ok {
return rf(ctx, runnerScaleSetId, owner)
}
if rf, ok := ret.Get(0).(func(context.Context, int, string) *RunnerScaleSetSession); ok {
r0 = rf(ctx, runnerScaleSetId, owner)
} else {
@@ -50,7 +57,6 @@ func (_m *MockActionsService) CreateMessageSession(ctx context.Context, runnerSc
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int, string) error); ok {
r1 = rf(ctx, runnerScaleSetId, owner)
} else {
@@ -65,6 +71,10 @@ func (_m *MockActionsService) CreateRunnerScaleSet(ctx context.Context, runnerSc
ret := _m.Called(ctx, runnerScaleSet)
var r0 *RunnerScaleSet
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *RunnerScaleSet) (*RunnerScaleSet, error)); ok {
return rf(ctx, runnerScaleSet)
}
if rf, ok := ret.Get(0).(func(context.Context, *RunnerScaleSet) *RunnerScaleSet); ok {
r0 = rf(ctx, runnerScaleSet)
} else {
@@ -73,7 +83,6 @@ func (_m *MockActionsService) CreateRunnerScaleSet(ctx context.Context, runnerSc
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *RunnerScaleSet) error); ok {
r1 = rf(ctx, runnerScaleSet)
} else {
@@ -130,6 +139,10 @@ func (_m *MockActionsService) GenerateJitRunnerConfig(ctx context.Context, jitRu
ret := _m.Called(ctx, jitRunnerSetting, scaleSetId)
var r0 *RunnerScaleSetJitRunnerConfig
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *RunnerScaleSetJitRunnerSetting, int) (*RunnerScaleSetJitRunnerConfig, error)); ok {
return rf(ctx, jitRunnerSetting, scaleSetId)
}
if rf, ok := ret.Get(0).(func(context.Context, *RunnerScaleSetJitRunnerSetting, int) *RunnerScaleSetJitRunnerConfig); ok {
r0 = rf(ctx, jitRunnerSetting, scaleSetId)
} else {
@@ -138,7 +151,6 @@ func (_m *MockActionsService) GenerateJitRunnerConfig(ctx context.Context, jitRu
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *RunnerScaleSetJitRunnerSetting, int) error); ok {
r1 = rf(ctx, jitRunnerSetting, scaleSetId)
} else {
@@ -153,6 +165,10 @@ func (_m *MockActionsService) GetAcquirableJobs(ctx context.Context, runnerScale
ret := _m.Called(ctx, runnerScaleSetId)
var r0 *AcquirableJobList
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int) (*AcquirableJobList, error)); ok {
return rf(ctx, runnerScaleSetId)
}
if rf, ok := ret.Get(0).(func(context.Context, int) *AcquirableJobList); ok {
r0 = rf(ctx, runnerScaleSetId)
} else {
@@ -161,7 +177,6 @@ func (_m *MockActionsService) GetAcquirableJobs(ctx context.Context, runnerScale
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
r1 = rf(ctx, runnerScaleSetId)
} else {
@@ -176,6 +191,10 @@ func (_m *MockActionsService) GetMessage(ctx context.Context, messageQueueUrl st
ret := _m.Called(ctx, messageQueueUrl, messageQueueAccessToken, lastMessageId)
var r0 *RunnerScaleSetMessage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64) (*RunnerScaleSetMessage, error)); ok {
return rf(ctx, messageQueueUrl, messageQueueAccessToken, lastMessageId)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, int64) *RunnerScaleSetMessage); ok {
r0 = rf(ctx, messageQueueUrl, messageQueueAccessToken, lastMessageId)
} else {
@@ -184,7 +203,6 @@ func (_m *MockActionsService) GetMessage(ctx context.Context, messageQueueUrl st
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, string, int64) error); ok {
r1 = rf(ctx, messageQueueUrl, messageQueueAccessToken, lastMessageId)
} else {
@@ -199,6 +217,10 @@ func (_m *MockActionsService) GetRunner(ctx context.Context, runnerId int64) (*R
ret := _m.Called(ctx, runnerId)
var r0 *RunnerReference
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int64) (*RunnerReference, error)); ok {
return rf(ctx, runnerId)
}
if rf, ok := ret.Get(0).(func(context.Context, int64) *RunnerReference); ok {
r0 = rf(ctx, runnerId)
} else {
@@ -207,7 +229,6 @@ func (_m *MockActionsService) GetRunner(ctx context.Context, runnerId int64) (*R
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
r1 = rf(ctx, runnerId)
} else {
@@ -222,6 +243,10 @@ func (_m *MockActionsService) GetRunnerByName(ctx context.Context, runnerName st
ret := _m.Called(ctx, runnerName)
var r0 *RunnerReference
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*RunnerReference, error)); ok {
return rf(ctx, runnerName)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *RunnerReference); ok {
r0 = rf(ctx, runnerName)
} else {
@@ -230,7 +255,6 @@ func (_m *MockActionsService) GetRunnerByName(ctx context.Context, runnerName st
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, runnerName)
} else {
@@ -245,6 +269,10 @@ func (_m *MockActionsService) GetRunnerGroupByName(ctx context.Context, runnerGr
ret := _m.Called(ctx, runnerGroup)
var r0 *RunnerGroup
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*RunnerGroup, error)); ok {
return rf(ctx, runnerGroup)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *RunnerGroup); ok {
r0 = rf(ctx, runnerGroup)
} else {
@@ -253,7 +281,6 @@ func (_m *MockActionsService) GetRunnerGroupByName(ctx context.Context, runnerGr
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, runnerGroup)
} else {
@@ -268,6 +295,10 @@ func (_m *MockActionsService) GetRunnerScaleSet(ctx context.Context, runnerGroup
ret := _m.Called(ctx, runnerGroupId, runnerScaleSetName)
var r0 *RunnerScaleSet
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int, string) (*RunnerScaleSet, error)); ok {
return rf(ctx, runnerGroupId, runnerScaleSetName)
}
if rf, ok := ret.Get(0).(func(context.Context, int, string) *RunnerScaleSet); ok {
r0 = rf(ctx, runnerGroupId, runnerScaleSetName)
} else {
@@ -276,7 +307,6 @@ func (_m *MockActionsService) GetRunnerScaleSet(ctx context.Context, runnerGroup
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int, string) error); ok {
r1 = rf(ctx, runnerGroupId, runnerScaleSetName)
} else {
@@ -291,6 +321,10 @@ func (_m *MockActionsService) GetRunnerScaleSetById(ctx context.Context, runnerS
ret := _m.Called(ctx, runnerScaleSetId)
var r0 *RunnerScaleSet
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int) (*RunnerScaleSet, error)); ok {
return rf(ctx, runnerScaleSetId)
}
if rf, ok := ret.Get(0).(func(context.Context, int) *RunnerScaleSet); ok {
r0 = rf(ctx, runnerScaleSetId)
} else {
@@ -299,7 +333,6 @@ func (_m *MockActionsService) GetRunnerScaleSetById(ctx context.Context, runnerS
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int) error); ok {
r1 = rf(ctx, runnerScaleSetId)
} else {
@@ -314,6 +347,10 @@ func (_m *MockActionsService) RefreshMessageSession(ctx context.Context, runnerS
ret := _m.Called(ctx, runnerScaleSetId, sessionId)
var r0 *RunnerScaleSetSession
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int, *uuid.UUID) (*RunnerScaleSetSession, error)); ok {
return rf(ctx, runnerScaleSetId, sessionId)
}
if rf, ok := ret.Get(0).(func(context.Context, int, *uuid.UUID) *RunnerScaleSetSession); ok {
r0 = rf(ctx, runnerScaleSetId, sessionId)
} else {
@@ -322,7 +359,6 @@ func (_m *MockActionsService) RefreshMessageSession(ctx context.Context, runnerS
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int, *uuid.UUID) error); ok {
r1 = rf(ctx, runnerScaleSetId, sessionId)
} else {
@@ -346,11 +382,20 @@ func (_m *MockActionsService) RemoveRunner(ctx context.Context, runnerId int64)
return r0
}
// SetUserAgent provides a mock function with given fields: info
func (_m *MockActionsService) SetUserAgent(info UserAgentInfo) {
_m.Called(info)
}
// UpdateRunnerScaleSet provides a mock function with given fields: ctx, runnerScaleSetId, runnerScaleSet
func (_m *MockActionsService) UpdateRunnerScaleSet(ctx context.Context, runnerScaleSetId int, runnerScaleSet *RunnerScaleSet) (*RunnerScaleSet, error) {
ret := _m.Called(ctx, runnerScaleSetId, runnerScaleSet)
var r0 *RunnerScaleSet
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, int, *RunnerScaleSet) (*RunnerScaleSet, error)); ok {
return rf(ctx, runnerScaleSetId, runnerScaleSet)
}
if rf, ok := ret.Get(0).(func(context.Context, int, *RunnerScaleSet) *RunnerScaleSet); ok {
r0 = rf(ctx, runnerScaleSetId, runnerScaleSet)
} else {
@@ -359,7 +404,6 @@ func (_m *MockActionsService) UpdateRunnerScaleSet(ctx context.Context, runnerSc
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, int, *RunnerScaleSet) error); ok {
r1 = rf(ctx, runnerScaleSetId, runnerScaleSet)
} else {
@@ -369,13 +413,12 @@ func (_m *MockActionsService) UpdateRunnerScaleSet(ctx context.Context, runnerSc
return r0, r1
}
type mockConstructorTestingTNewMockActionsService interface {
// NewMockActionsService creates a new instance of MockActionsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockActionsService(t interface {
mock.TestingT
Cleanup(func())
}
// NewMockActionsService creates a new instance of MockActionsService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockActionsService(t mockConstructorTestingTNewMockActionsService) *MockActionsService {
}) *MockActionsService {
mock := &MockActionsService{}
mock.Mock.Test(t)