refactor: rename package from gitops_rac to benadis_rac
The package and related files have been renamed to better reflect the project's naming conventions. This change includes: - Renaming the main package file - Updating all references in integration tests - Maintaining all existing functionality without behavior changes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Package gitops_rac provides functionality for managing 1C service mode
|
||||
package gitops_rac
|
||||
// Package benadis_rac provides functionality for managing 1C service mode
|
||||
package benadis_rac
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -1,7 +1,7 @@
|
||||
//go:build integration
|
||||
// +build integration
|
||||
|
||||
package gitops_rac
|
||||
package git.benadis.ru/gitops/benadis-rac
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -21,17 +21,17 @@ func TestIntegrationServiceMode(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create client: %v", err)
|
||||
}
|
||||
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
|
||||
defer cancel()
|
||||
|
||||
|
||||
// Получаем текущий статус
|
||||
initialStatus, err := client.GetServiceModeStatus(ctx)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to get initial service mode status: %v", err)
|
||||
}
|
||||
t.Logf("Initial service mode status: %v", initialStatus)
|
||||
|
||||
|
||||
// Тестируем включение сервисного режима
|
||||
t.Run("Enable Service Mode", func(t *testing.T) {
|
||||
err := client.EnableServiceMode(ctx)
|
||||
@@ -39,23 +39,23 @@ func TestIntegrationServiceMode(t *testing.T) {
|
||||
t.Errorf("Failed to enable service mode: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Проверяем что режим действительно включен
|
||||
status, err := client.GetServiceModeStatus(ctx)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to get service mode status after enabling: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if !status {
|
||||
t.Error("Service mode should be enabled but it's not")
|
||||
}
|
||||
t.Log("Service mode enabled successfully")
|
||||
})
|
||||
|
||||
|
||||
// Небольшая пауза между операциями
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
|
||||
// Тестируем выключение сервисного режима
|
||||
t.Run("Disable Service Mode", func(t *testing.T) {
|
||||
err := client.DisableServiceMode(ctx)
|
||||
@@ -63,20 +63,20 @@ func TestIntegrationServiceMode(t *testing.T) {
|
||||
t.Errorf("Failed to disable service mode: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Проверяем что режим действительно выключен
|
||||
status, err := client.GetServiceModeStatus(ctx)
|
||||
if err != nil {
|
||||
t.Errorf("Failed to get service mode status after disabling: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if status {
|
||||
t.Error("Service mode should be disabled but it's not")
|
||||
}
|
||||
t.Log("Service mode disabled successfully")
|
||||
})
|
||||
|
||||
|
||||
// Восстанавливаем исходное состояние
|
||||
if initialStatus {
|
||||
t.Log("Restoring initial service mode state (enabled)")
|
||||
@@ -98,15 +98,15 @@ func TestIntegrationStatusOnly(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create client: %v", err)
|
||||
}
|
||||
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
||||
|
||||
status, err := client.GetServiceModeStatus(ctx)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to get service mode status: %v", err)
|
||||
}
|
||||
|
||||
|
||||
t.Logf("Current service mode status: %v", status)
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ func TestIntegrationConfigValidation(t *testing.T) {
|
||||
expectErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
_, err := NewClient(Config{
|
||||
@@ -145,7 +145,7 @@ func TestIntegrationConfigValidation(t *testing.T) {
|
||||
SecretPath: tt.secretPath,
|
||||
LogLevel: "Error", // Минимальный уровень логирования для тестов
|
||||
})
|
||||
|
||||
|
||||
if tt.expectErr && err == nil {
|
||||
t.Error("Expected error but got none")
|
||||
}
|
||||
@@ -166,9 +166,9 @@ func BenchmarkServiceModeOperations(b *testing.B) {
|
||||
if err != nil {
|
||||
b.Fatalf("Failed to create client: %v", err)
|
||||
}
|
||||
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
|
||||
b.Run("GetStatus", func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
_, err := client.GetServiceModeStatus(ctx)
|
||||
@@ -177,4 +177,4 @@ func BenchmarkServiceModeOperations(b *testing.B) {
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user