feat(suite): Implement Suites (#1239)
* 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>
This commit is contained in:
16
main.go
16
main.go
@@ -103,6 +103,15 @@ func initializeStorage(cfg *config.Config) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// Remove all SuiteStatuses that represent suites which no longer exist in the configuration
|
||||
var suiteKeys []string
|
||||
for _, suite := range cfg.Suites {
|
||||
suiteKeys = append(suiteKeys, suite.Key())
|
||||
}
|
||||
numberOfSuiteStatusesDeleted := store.Get().DeleteAllSuiteStatusesNotInKeys(suiteKeys)
|
||||
if numberOfSuiteStatusesDeleted > 0 {
|
||||
logr.Infof("[main.initializeStorage] Deleted %d suite statuses because their matching suites no longer existed", numberOfSuiteStatusesDeleted)
|
||||
}
|
||||
// Remove all EndpointStatus that represent endpoints which no longer exist in the configuration
|
||||
var keys []string
|
||||
for _, ep := range cfg.Endpoints {
|
||||
@@ -111,6 +120,13 @@ func initializeStorage(cfg *config.Config) {
|
||||
for _, ee := range cfg.ExternalEndpoints {
|
||||
keys = append(keys, ee.Key())
|
||||
}
|
||||
// Also add endpoints that are part of suites
|
||||
for _, suite := range cfg.Suites {
|
||||
for _, ep := range suite.Endpoints {
|
||||
keys = append(keys, ep.Key())
|
||||
}
|
||||
}
|
||||
logr.Infof("[main.initializeStorage] Total endpoint keys to preserve: %d", len(keys))
|
||||
numberOfEndpointStatusesDeleted := store.Get().DeleteAllEndpointStatusesNotInKeys(keys)
|
||||
if numberOfEndpointStatusesDeleted > 0 {
|
||||
logr.Infof("[main.initializeStorage] Deleted %d endpoint statuses because their matching endpoints no longer existed", numberOfEndpointStatusesDeleted)
|
||||
|
||||
Reference in New Issue
Block a user