mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-29 06:29:19 +02:00
## Summary Currently you can either run a single service or all-in-one mode. This PR adds support for running any 2 or 3 services together. For example `services: authorize,proxy`. I think I updated the conditions to make sense, but there's some risk here as there may have been some assumptions in places I'm overlooking. ## Related issues - [ENG-2485](https://linear.app/pomerium/issue/ENG-2485/core-support-running-multiple-but-not-all-services) ## Checklist - [x] reference any related issues - [x] updated unit tests - [x] add appropriate label (`enhancement`, `bug`, `breaking`, `dependencies`, `ci`) - [x] ready for review
27 lines
506 B
Go
27 lines
506 B
Go
package telemetry
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_ServiceName(t *testing.T) {
|
|
t.Parallel()
|
|
tests := []struct {
|
|
name string
|
|
servicesOpt string
|
|
want string
|
|
}{
|
|
{"all", "all", "pomerium"},
|
|
{"proxy", "proxy", "pomerium-proxy"},
|
|
{"missing", "", "pomerium"},
|
|
{"multiple", "authorize,proxy", "pomerium"},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
assert.Equal(t, tt.want, ServiceName(tt.servicesOpt))
|
|
})
|
|
}
|
|
}
|