chore: import lab4 baseline

This commit is contained in:
2026-10-22 16:20:54 +03:00
parent 276dbdad8a
commit 709346783e
68 changed files with 8356 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
package config
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestLoadReconciliationDoesNotRequireServerSettings(t *testing.T) {
values := map[string]string{
"DATABASE_URL": "postgres://user:password@postgres:5432/messenger",
"DB_MIN_CONNS": "0", "DB_MAX_CONNS": "4",
"DB_MAX_CONNECTION_AGE_SECONDS": "300", "DB_MAX_CONNECTION_IDLE_SECONDS": "60",
"DB_HEALTH_CHECK_SECONDS": "30", "DEPENDENCY_TIMEOUT_SECONDS": "5",
"S3_ENDPOINT": "s3:9000", "S3_REGION": "us-east-1", "S3_BUCKET": "attachments",
"S3_ACCESS_KEY": "application", "S3_SECRET_KEY": "application-secret",
"S3_USE_TLS": "false", "S3_TIMEOUT_SECONDS": "5",
}
for name, value := range values {
t.Setenv(name, value)
}
t.Setenv("APP_HOST", "")
t.Setenv("CACHE_URL", "")
t.Setenv("SWAGGER_PORT", "")
settings, err := LoadReconciliation()
require.NoError(t, err)
require.Equal(t, "attachments", settings.S3Bucket)
}