feat: allow production provider bootstrap
This commit is contained in:
1 parent
6480e503eb
commit
22fc7a56d8
21 files changed
+192
-18
No files matched your search
@@ -100,6 +100,23 @@ func TestServiceGetUsesInjectedEnvironmentWithoutMutatingProcess(t *testing.T) {
|
||||
assertSecretProjection(t, value, "SEEDANCE_API_KEY", true)
|
||||
}
|
||||
|
||||
func TestLoadEnvironmentAllowsBootstrapRuntimeFlagButIgnoresUnknownKeys(t *testing.T) {
|
||||
path := filepath.Join(t.TempDir(), ".env.local")
|
||||
if err := os.WriteFile(path, []byte("ZHINIAN_ALLOW_UNCONFIGURED_PROVIDERS=true\nUNKNOWN_RUNTIME_FLAG=true\n"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
values, err := LoadEnvironment(path, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if values["ZHINIAN_ALLOW_UNCONFIGURED_PROVIDERS"] != "true" {
|
||||
t.Fatalf("bootstrap flag = %q", values["ZHINIAN_ALLOW_UNCONFIGURED_PROVIDERS"])
|
||||
}
|
||||
if _, exists := values["UNKNOWN_RUNTIME_FLAG"]; exists {
|
||||
t.Fatal("unknown runtime flag was loaded")
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceSynchronizesBillingAccountWithoutRequiringRestart(t *testing.T) {
|
||||
writer := &billingWriterStub{}
|
||||
service := New(filepath.Join(t.TempDir(), ".env.local"), nil, nil).WithBillingAccountWriter(writer)
|
||||
|
||||
Reference in new issue
Block a user