feat: config grouped by area, with per-provider timeouts and an update interval (#60)
Regroups the config, while there are no users to migrate: - `ui`: icons, sourcesView, collapseGroups, loadDelay, expiryWarningDays - `values`: revealTimeout, hideOnBlur, clipboardClear - `storage`: cache, history - `updates`: autoCheck (was updateCheck), autoCheckInterval (new, 24h by default), updateSources (was releases) - `providers.timeout` (was timeout), plus `timeout` on azure, databricks and repos overriding it for that provider; `--timeout` still sets them all - `sharing` (was share), in the config and in a repo's `.lazysecrets.yaml` docs/config.md and the pages naming these keys are updated. Reviewed-on: #60 Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
This commit was merged in pull request #60.
This commit is contained in:
1 parent
5cd6d90555
commit
10d1fc63c7
24 files changed
+308
-172
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.kebcloud.no/keb/lazysecrets/internal/provider"
|
||||
"git.kebcloud.no/keb/lazysecrets/internal/provider/fake"
|
||||
)
|
||||
|
||||
// A provider's own timeout applies to it alone.
|
||||
func TestTimeoutPerProvider(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriverOpts(t, Options{Timeout: 5 * time.Second, Timeouts: map[provider.Kind]time.Duration{provider.KindAzure: 10 * time.Millisecond}},
|
||||
fake.Azure(300*time.Millisecond), fake.Databricks(300*time.Millisecond))
|
||||
scr := d.screen()
|
||||
if !strings.Contains(scr, "✗ Azure: context deadline exceeded") || !strings.Contains(scr, "Databricks (…)") ||
|
||||
strings.Contains(scr, "Databricks: context deadline") {
|
||||
t.Errorf("want Azure timed out and Databricks still loading:\n%s", scr)
|
||||
}
|
||||
if got := (timeouts{def: time.Minute}).of(provider.KindRepo); got != time.Minute {
|
||||
t.Errorf("no override: %s, want the default", got)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user