mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-10-17 17:04:27 +02:00
Modify user agent format with subsystem and is proxy configured information (#3116)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package actions_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/actions/actions-runner-controller/github/actions"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestUserAgentInfoString(t *testing.T) {
|
||||
userAgentInfo := actions.UserAgentInfo{
|
||||
Version: "0.1.0",
|
||||
CommitSHA: "1234567890abcdef",
|
||||
ScaleSetID: 10,
|
||||
HasProxy: true,
|
||||
Subsystem: "test",
|
||||
}
|
||||
|
||||
userAgent := userAgentInfo.String()
|
||||
expectedProduct := "actions-runner-controller/0.1.0 (1234567890abcdef; test)"
|
||||
assert.Contains(t, userAgent, expectedProduct)
|
||||
expectedScaleSet := "ScaleSetID/10 (Proxy/enabled)"
|
||||
assert.Contains(t, userAgent, expectedScaleSet)
|
||||
}
|
||||
Reference in New Issue
Block a user