* feat(suite): Implement Suites Fixes #1230 * Update docs * Fix variable alignment * Prevent always-run endpoint from running if a context placeholder fails to resolve in the URL * Return errors when a context placeholder path fails to resolve * Add a couple of unit tests * Add a couple of unit tests * fix(ui): Update group count properly Fixes #1233 * refactor: Pass down entire config instead of several sub-configs * fix: Change default suite interval and timeout * fix: Deprecate disable-monitoring-lock in favor of concurrency * fix: Make sure there are no duplicate keys * Refactor some code * Update watchdog/watchdog.go * Update web/app/src/components/StepDetailsModal.vue Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: Remove useless log * fix: Set default concurrency to 3 instead of 5 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
42 lines
918 B
Go
42 lines
918 B
Go
package key
|
|
|
|
import "testing"
|
|
|
|
func TestConvertGroupAndNameToKey(t *testing.T) {
|
|
type Scenario struct {
|
|
GroupName string
|
|
Name string
|
|
ExpectedOutput string
|
|
}
|
|
scenarios := []Scenario{
|
|
{
|
|
GroupName: "Core",
|
|
Name: "Front End",
|
|
ExpectedOutput: "core_front-end",
|
|
},
|
|
{
|
|
GroupName: "Load balancers",
|
|
Name: "us-west-2",
|
|
ExpectedOutput: "load-balancers_us-west-2",
|
|
},
|
|
{
|
|
GroupName: "a/b test",
|
|
Name: "a",
|
|
ExpectedOutput: "a-b-test_a",
|
|
},
|
|
{
|
|
GroupName: "",
|
|
Name: "name",
|
|
ExpectedOutput: "_name",
|
|
},
|
|
}
|
|
for _, scenario := range scenarios {
|
|
t.Run(scenario.ExpectedOutput, func(t *testing.T) {
|
|
output := ConvertGroupAndNameToKey(scenario.GroupName, scenario.Name)
|
|
if output != scenario.ExpectedOutput {
|
|
t.Errorf("expected '%s', got '%s'", scenario.ExpectedOutput, output)
|
|
}
|
|
})
|
|
}
|
|
}
|