feat: CI/CD pipeline + Learning/Medicine/Travel services
- Add Gitea Actions workflow for automated build & deploy - Add K8s manifests: webui, travel-svc, medicine-svc, sandbox-svc - Update kustomization for localhost:5000 registry - Add ingress for gooseek.ru and api.gooseek.ru - Learning cabinet with onboarding, courses, sandbox integration - Medicine service with symptom analysis and doctor matching - Travel service with itinerary planning - Server setup scripts (NVIDIA/CUDA, K3s, Gitea runner) Made-with: Cursor
This commit is contained in:
43
backend/internal/db/learning_repo_test.go
Normal file
43
backend/internal/db/learning_repo_test.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewLearningRepository(t *testing.T) {
|
||||
pg := &PostgresDB{}
|
||||
repo := NewLearningRepository(pg)
|
||||
if repo == nil {
|
||||
t.Fatalf("expected repository instance")
|
||||
}
|
||||
if repo.db != pg {
|
||||
t.Fatalf("repository must keep provided db pointer")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLearningUserProfileJSONContract(t *testing.T) {
|
||||
profile := LearningUserProfile{
|
||||
UserID: "u-1",
|
||||
DisplayName: "Alex",
|
||||
Profile: json.RawMessage(`{"target_track":"backend"}`),
|
||||
ResumeExtractedText: "resume text",
|
||||
OnboardingCompleted: true,
|
||||
}
|
||||
|
||||
raw, err := json.Marshal(profile)
|
||||
if err != nil {
|
||||
t.Fatalf("marshal profile: %v", err)
|
||||
}
|
||||
|
||||
var decoded map[string]interface{}
|
||||
if err := json.Unmarshal(raw, &decoded); err != nil {
|
||||
t.Fatalf("unmarshal profile json: %v", err)
|
||||
}
|
||||
if decoded["userId"] != "u-1" {
|
||||
t.Fatalf("unexpected userId: %v", decoded["userId"])
|
||||
}
|
||||
if decoded["onboardingCompleted"] != true {
|
||||
t.Fatalf("unexpected onboardingCompleted: %v", decoded["onboardingCompleted"])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user