265 lines
17 KiB
Text
265 lines
17 KiB
Text
=== RUN TestAdminService_ListCompanies
|
|
=== RUN TestAdminService_ListCompanies/returns_empty_list_when_no_companies
|
|
=== RUN TestAdminService_ListCompanies/filters_by_verified_status
|
|
--- PASS: TestAdminService_ListCompanies (0.00s)
|
|
--- PASS: TestAdminService_ListCompanies/returns_empty_list_when_no_companies (0.00s)
|
|
--- PASS: TestAdminService_ListCompanies/filters_by_verified_status (0.00s)
|
|
=== RUN TestAdminService_ListTags
|
|
=== RUN TestAdminService_ListTags/returns_empty_list_when_no_tags
|
|
=== RUN TestAdminService_ListTags/filters_by_category
|
|
--- PASS: TestAdminService_ListTags (0.00s)
|
|
--- PASS: TestAdminService_ListTags/returns_empty_list_when_no_tags (0.00s)
|
|
--- PASS: TestAdminService_ListTags/filters_by_category (0.00s)
|
|
=== RUN TestAdminService_CreateTag
|
|
=== RUN TestAdminService_CreateTag/creates_a_new_tag
|
|
=== RUN TestAdminService_CreateTag/rejects_empty_tag_name
|
|
--- PASS: TestAdminService_CreateTag (0.00s)
|
|
--- PASS: TestAdminService_CreateTag/creates_a_new_tag (0.00s)
|
|
--- PASS: TestAdminService_CreateTag/rejects_empty_tag_name (0.00s)
|
|
=== RUN TestAdminService_GetUser
|
|
=== RUN TestAdminService_GetUser/returns_user_by_id
|
|
admin_service_test.go:173: Unexpected error: Query: could not match actual sql: "SELECT id, full_name, email, role, COALESCE(status, 'active'), created_at, phone, bio, avatar_url FROM users WHERE id = $1" with expected regexp "SELECT id, full_name, email, role, created_at FROM users WHERE id"
|
|
--- FAIL: TestAdminService_GetUser (0.00s)
|
|
--- FAIL: TestAdminService_GetUser/returns_user_by_id (0.00s)
|
|
=== RUN TestAdminService_UpdateCompanyStatus
|
|
=== RUN TestAdminService_UpdateCompanyStatus/updates_active_status_successfully
|
|
=== RUN TestAdminService_UpdateCompanyStatus/updates_verified_status_successfully
|
|
=== RUN TestAdminService_UpdateCompanyStatus/returns_error_when_company_not_found
|
|
--- PASS: TestAdminService_UpdateCompanyStatus (0.00s)
|
|
--- PASS: TestAdminService_UpdateCompanyStatus/updates_active_status_successfully (0.00s)
|
|
--- PASS: TestAdminService_UpdateCompanyStatus/updates_verified_status_successfully (0.00s)
|
|
--- PASS: TestAdminService_UpdateCompanyStatus/returns_error_when_company_not_found (0.00s)
|
|
=== RUN TestAdminService_ListUsers
|
|
=== RUN TestAdminService_ListUsers/returns_users_list
|
|
--- PASS: TestAdminService_ListUsers (0.00s)
|
|
--- PASS: TestAdminService_ListUsers/returns_users_list (0.00s)
|
|
=== RUN TestAdminService_DuplicateJob
|
|
--- PASS: TestAdminService_DuplicateJob (0.00s)
|
|
=== RUN TestAdminService_EmailTemplates
|
|
=== RUN TestAdminService_EmailTemplates/ListEmailTemplates
|
|
=== RUN TestAdminService_EmailTemplates/CreateEmailTemplate
|
|
--- PASS: TestAdminService_EmailTemplates (0.00s)
|
|
--- PASS: TestAdminService_EmailTemplates/ListEmailTemplates (0.00s)
|
|
--- PASS: TestAdminService_EmailTemplates/CreateEmailTemplate (0.00s)
|
|
=== RUN TestStringOrNil
|
|
=== RUN TestStringOrNil/nil_for_invalid
|
|
=== RUN TestStringOrNil/pointer_for_valid
|
|
--- PASS: TestStringOrNil (0.00s)
|
|
--- PASS: TestStringOrNil/nil_for_invalid (0.00s)
|
|
--- PASS: TestStringOrNil/pointer_for_valid (0.00s)
|
|
=== RUN TestBuildLocation
|
|
=== RUN TestBuildLocation/nil_when_both_empty
|
|
=== RUN TestBuildLocation/city,_state_format
|
|
=== RUN TestBuildLocation/city_only
|
|
--- PASS: TestBuildLocation (0.00s)
|
|
--- PASS: TestBuildLocation/nil_when_both_empty (0.00s)
|
|
--- PASS: TestBuildLocation/city,_state_format (0.00s)
|
|
--- PASS: TestBuildLocation/city_only (0.00s)
|
|
=== RUN TestNormalizeSkills
|
|
--- PASS: TestNormalizeSkills (0.00s)
|
|
=== RUN TestIsActiveApplicationStatus
|
|
--- PASS: TestIsActiveApplicationStatus (0.00s)
|
|
=== RUN TestAdminService_GetCompanyByUserID
|
|
admin_service_test.go:501: GetCompanyByUserID error (likely query mismatch): Query: could not match actual sql: "SELECT id, full_name, email, role, COALESCE(status, 'active'), created_at, phone, bio, avatar_url FROM users WHERE id = $1" with expected regexp "SELECT id, name, slug, description, logo_url, website, location, active, verified, created_at, updated_at FROM companies WHERE user_id=\$1"
|
|
--- PASS: TestAdminService_GetCompanyByUserID (0.00s)
|
|
=== RUN TestAdminService_DeleteCompanyBasic
|
|
--- PASS: TestAdminService_DeleteCompanyBasic (0.00s)
|
|
=== RUN TestAdminService_DeleteEmailTemplateBasic
|
|
--- PASS: TestAdminService_DeleteEmailTemplateBasic (0.00s)
|
|
=== RUN TestAdminService_GetEmailSettingsBasic
|
|
--- PASS: TestAdminService_GetEmailSettingsBasic (0.00s)
|
|
=== RUN TestAuditService_RecordLogin
|
|
=== RUN TestAuditService_RecordLogin/records_login_successfully
|
|
=== RUN TestAuditService_RecordLogin/records_login_without_optional_fields
|
|
--- PASS: TestAuditService_RecordLogin (0.00s)
|
|
--- PASS: TestAuditService_RecordLogin/records_login_successfully (0.00s)
|
|
--- PASS: TestAuditService_RecordLogin/records_login_without_optional_fields (0.00s)
|
|
=== RUN TestAuditService_ListLogins
|
|
=== RUN TestAuditService_ListLogins/returns_empty_list_when_no_audits
|
|
=== RUN TestAuditService_ListLogins/respects_custom_limit
|
|
--- PASS: TestAuditService_ListLogins (0.00s)
|
|
--- PASS: TestAuditService_ListLogins/returns_empty_list_when_no_audits (0.00s)
|
|
--- PASS: TestAuditService_ListLogins/respects_custom_limit (0.00s)
|
|
=== RUN TestNewChatService
|
|
--- PASS: TestNewChatService (0.00s)
|
|
=== RUN TestChatService_SendMessage
|
|
chat_service_test.go:37: Skipping due to async goroutine requiring real dependencies
|
|
--- SKIP: TestChatService_SendMessage (0.00s)
|
|
=== RUN TestChatService_ListMessages
|
|
=== RUN TestChatService_ListMessages/returns_messages_list
|
|
=== RUN TestChatService_ListMessages/returns_empty_list_when_no_messages
|
|
--- PASS: TestChatService_ListMessages (0.00s)
|
|
--- PASS: TestChatService_ListMessages/returns_messages_list (0.00s)
|
|
--- PASS: TestChatService_ListMessages/returns_empty_list_when_no_messages (0.00s)
|
|
=== RUN TestChatService_ListConversations
|
|
=== RUN TestChatService_ListConversations/lists_conversations_for_candidate
|
|
=== RUN TestChatService_ListConversations/lists_conversations_for_company
|
|
=== RUN TestChatService_ListConversations/returns_error_for_invalid_context
|
|
--- PASS: TestChatService_ListConversations (0.00s)
|
|
--- PASS: TestChatService_ListConversations/lists_conversations_for_candidate (0.00s)
|
|
--- PASS: TestChatService_ListConversations/lists_conversations_for_company (0.00s)
|
|
--- PASS: TestChatService_ListConversations/returns_error_for_invalid_context (0.00s)
|
|
=== RUN TestMessage_Struct
|
|
--- PASS: TestMessage_Struct (0.00s)
|
|
=== RUN TestConversation_Struct
|
|
--- PASS: TestConversation_Struct (0.00s)
|
|
=== RUN TestNewEmailService
|
|
--- PASS: TestNewEmailService (0.00s)
|
|
=== RUN TestEmailService_SendTemplateEmail_NoAMQPURL
|
|
=== RUN TestEmailService_SendTemplateEmail_NoAMQPURL/returns_error_when_AMQP_URL_not_configured
|
|
--- PASS: TestEmailService_SendTemplateEmail_NoAMQPURL (0.00s)
|
|
--- PASS: TestEmailService_SendTemplateEmail_NoAMQPURL/returns_error_when_AMQP_URL_not_configured (0.00s)
|
|
=== RUN TestEmailService_SendTemplateEmail_DBError
|
|
=== RUN TestEmailService_SendTemplateEmail_DBError/handles_db_error_gracefully
|
|
2026/02/25 06:02:13 [EmailService] Failed to fetch AMQP URL: sql: connection is already closed
|
|
--- PASS: TestEmailService_SendTemplateEmail_DBError (0.00s)
|
|
--- PASS: TestEmailService_SendTemplateEmail_DBError/handles_db_error_gracefully (0.00s)
|
|
=== RUN TestEmailJob_Struct
|
|
--- PASS: TestEmailJob_Struct (0.00s)
|
|
=== RUN TestNotificationService_ListNotifications
|
|
=== RUN TestNotificationService_ListNotifications/returns_empty_list_when_no_notifications
|
|
--- PASS: TestNotificationService_ListNotifications (0.00s)
|
|
--- PASS: TestNotificationService_ListNotifications/returns_empty_list_when_no_notifications (0.00s)
|
|
=== RUN TestNotificationService_CreateNotification
|
|
=== RUN TestNotificationService_CreateNotification/creates_a_new_notification
|
|
--- PASS: TestNotificationService_CreateNotification (0.00s)
|
|
--- PASS: TestNotificationService_CreateNotification/creates_a_new_notification (0.00s)
|
|
=== RUN TestNotificationService_MarkAsRead
|
|
=== RUN TestNotificationService_MarkAsRead/marks_notification_as_read
|
|
--- PASS: TestNotificationService_MarkAsRead (0.00s)
|
|
--- PASS: TestNotificationService_MarkAsRead/marks_notification_as_read (0.00s)
|
|
=== RUN TestNotificationService_MarkAllAsRead
|
|
=== RUN TestNotificationService_MarkAllAsRead/marks_all_notifications_as_read
|
|
--- PASS: TestNotificationService_MarkAllAsRead (0.00s)
|
|
--- PASS: TestNotificationService_MarkAllAsRead/marks_all_notifications_as_read (0.00s)
|
|
=== RUN TestNewNotificationService
|
|
--- PASS: TestNewNotificationService (0.00s)
|
|
=== RUN TestNewSettingsService
|
|
--- PASS: TestNewSettingsService (0.00s)
|
|
=== RUN TestSettingsService_GetSettings
|
|
=== RUN TestSettingsService_GetSettings/returns_setting_value
|
|
=== RUN TestSettingsService_GetSettings/returns_nil_when_not_found
|
|
=== RUN TestSettingsService_GetSettings/returns_error_on_db_failure
|
|
--- PASS: TestSettingsService_GetSettings (0.00s)
|
|
--- PASS: TestSettingsService_GetSettings/returns_setting_value (0.00s)
|
|
--- PASS: TestSettingsService_GetSettings/returns_nil_when_not_found (0.00s)
|
|
--- PASS: TestSettingsService_GetSettings/returns_error_on_db_failure (0.00s)
|
|
=== RUN TestSettingsService_SaveSettings
|
|
=== RUN TestSettingsService_SaveSettings/saves_setting_successfully
|
|
=== RUN TestSettingsService_SaveSettings/upserts_existing_setting
|
|
=== RUN TestSettingsService_SaveSettings/returns_error_on_db_failure
|
|
=== RUN TestSettingsService_SaveSettings/handles_unmarshalable_value
|
|
--- PASS: TestSettingsService_SaveSettings (0.00s)
|
|
--- PASS: TestSettingsService_SaveSettings/saves_setting_successfully (0.00s)
|
|
--- PASS: TestSettingsService_SaveSettings/upserts_existing_setting (0.00s)
|
|
--- PASS: TestSettingsService_SaveSettings/returns_error_on_db_failure (0.00s)
|
|
--- PASS: TestSettingsService_SaveSettings/handles_unmarshalable_value (0.00s)
|
|
=== RUN TestNewStorageService
|
|
--- PASS: TestNewStorageService (0.00s)
|
|
=== RUN TestUploadConfig_Validation
|
|
--- PASS: TestUploadConfig_Validation (0.00s)
|
|
=== RUN TestUploadConfig_DefaultRegion
|
|
--- PASS: TestUploadConfig_DefaultRegion (0.00s)
|
|
=== RUN TestUploadConfig_IncompleteFields
|
|
storage_service_test.go:90: Correctly identified incomplete credentials
|
|
--- PASS: TestUploadConfig_IncompleteFields (0.00s)
|
|
=== RUN TestAdminService_Extra_Unit
|
|
--- PASS: TestAdminService_Extra_Unit (0.00s)
|
|
=== RUN TestAdminService_DuplicateJob
|
|
--- PASS: TestAdminService_DuplicateJob (0.00s)
|
|
=== RUN TestAdminService_ListMethods
|
|
--- PASS: TestAdminService_ListMethods (0.00s)
|
|
=== RUN TestCreateApplication_Success
|
|
--- PASS: TestCreateApplication_Success (0.10s)
|
|
=== RUN TestApplicationService_DeleteApplication
|
|
--- PASS: TestApplicationService_DeleteApplication (0.00s)
|
|
=== RUN TestApplicationService_CreateApplication_Full
|
|
application_service_test.go:136: CreateApplication failed: Query '
|
|
INSERT INTO applications (
|
|
job_id, user_id, name, phone, line_id, whatsapp, email,
|
|
message, resume_url, documents, answers, status, created_at, updated_at
|
|
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)
|
|
RETURNING id, created_at, updated_at
|
|
', arguments do not match: expected 13, but got 14 arguments
|
|
--- FAIL: TestApplicationService_CreateApplication_Full (0.00s)
|
|
=== RUN TestApplicationService_GetApplications
|
|
application_service_test.go:171: GetApplications failed: sql: expected 13 destination arguments in Scan, not 15
|
|
--- FAIL: TestApplicationService_GetApplications (0.00s)
|
|
=== RUN TestApplicationService_GetApplicationByID
|
|
application_service_test.go:206: GetApplicationByID failed: sql: expected 14 destination arguments in Scan, not 15
|
|
--- FAIL: TestApplicationService_GetApplicationByID (0.00s)
|
|
=== RUN TestAuxiliaryServices_WithMockDB
|
|
--- PASS: TestAuxiliaryServices_WithMockDB (0.00s)
|
|
=== RUN TestLocationService_WithMockRepo
|
|
--- PASS: TestLocationService_WithMockRepo (0.00s)
|
|
=== RUN TestNotificationService_SaveFCMToken
|
|
--- PASS: TestNotificationService_SaveFCMToken (0.00s)
|
|
=== RUN TestChatService_Constructors
|
|
--- PASS: TestChatService_Constructors (0.00s)
|
|
=== RUN TestSaveCredentials
|
|
--- PASS: TestSaveCredentials (0.00s)
|
|
=== RUN TestGetDecryptedKey
|
|
--- PASS: TestGetDecryptedKey (0.48s)
|
|
=== RUN TestListConfiguredServices
|
|
--- PASS: TestListConfiguredServices (0.00s)
|
|
=== RUN TestDeleteCredentials
|
|
--- PASS: TestDeleteCredentials (0.00s)
|
|
=== RUN TestEncryptPayload
|
|
--- PASS: TestEncryptPayload (0.39s)
|
|
=== RUN TestCreateJob
|
|
=== RUN TestCreateJob/Success
|
|
[JOB_SERVICE DEBUG] === CreateJob Started ===
|
|
[JOB_SERVICE DEBUG] CompanyID=1, CreatedBy=user-123, Title=Go Developer, Status=published
|
|
[JOB_SERVICE DEBUG] Executing INSERT query...
|
|
[JOB_SERVICE DEBUG] Job struct: &{ID: CompanyID:1 CreatedBy:user-123 Title:Go Developer Description: SalaryMin:<nil> SalaryMax:<nil> SalaryType:<nil> Currency:<nil> SalaryNegotiable:false EmploymentType:<nil> WorkMode:<nil> WorkingHours:<nil> Location:<nil> RegionID:<nil> CityID:<nil> Requirements:map[] Benefits:map[] Questions:map[] VisaSupport:false LanguageLevel:<nil> Status:published IsFeatured:false ViewCount:0 FeaturedUntil:<nil> DatePosted:2026-02-25 06:02:14.4861294 -0600 CST m=+1.036940001 CreatedAt:2026-02-25 06:02:14.4861294 -0600 CST m=+1.036940001 UpdatedAt:2026-02-25 06:02:14.4861294 -0600 CST m=+1.036940001}
|
|
[JOB_SERVICE ERROR] INSERT query failed: Query '
|
|
INSERT INTO jobs (
|
|
company_id, created_by, title, description, salary_min, salary_max, salary_type, currency,
|
|
employment_type, work_mode, working_hours, location, region_id, city_id,
|
|
requirements, benefits, questions, visa_support, language_level, status, date_posted, created_at, updated_at, salary_negotiable
|
|
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)
|
|
RETURNING id, date_posted, created_at, updated_at
|
|
', arguments do not match: expected 21, but got 24 arguments
|
|
job_service_test.go:62: JobService.CreateJob() error = Query '
|
|
INSERT INTO jobs (
|
|
company_id, created_by, title, description, salary_min, salary_max, salary_type, currency,
|
|
employment_type, work_mode, working_hours, location, region_id, city_id,
|
|
requirements, benefits, questions, visa_support, language_level, status, date_posted, created_at, updated_at, salary_negotiable
|
|
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)
|
|
RETURNING id, date_posted, created_at, updated_at
|
|
', arguments do not match: expected 21, but got 24 arguments, wantErr false
|
|
=== RUN TestCreateJob/DB_Error
|
|
[JOB_SERVICE DEBUG] === CreateJob Started ===
|
|
[JOB_SERVICE DEBUG] CompanyID=1, CreatedBy=user-123, Title=Go Developer, Status=
|
|
[JOB_SERVICE DEBUG] Executing INSERT query...
|
|
[JOB_SERVICE DEBUG] Job struct: &{ID: CompanyID:1 CreatedBy:user-123 Title:Go Developer Description: SalaryMin:<nil> SalaryMax:<nil> SalaryType:<nil> Currency:<nil> SalaryNegotiable:false EmploymentType:<nil> WorkMode:<nil> WorkingHours:<nil> Location:<nil> RegionID:<nil> CityID:<nil> Requirements:map[] Benefits:map[] Questions:map[] VisaSupport:false LanguageLevel:<nil> Status: IsFeatured:false ViewCount:0 FeaturedUntil:<nil> DatePosted:2026-02-25 06:02:14.4879161 -0600 CST m=+1.038726701 CreatedAt:2026-02-25 06:02:14.4879161 -0600 CST m=+1.038726701 UpdatedAt:2026-02-25 06:02:14.4879161 -0600 CST m=+1.038726701}
|
|
[JOB_SERVICE ERROR] INSERT query failed: Query '
|
|
INSERT INTO jobs (
|
|
company_id, created_by, title, description, salary_min, salary_max, salary_type, currency,
|
|
employment_type, work_mode, working_hours, location, region_id, city_id,
|
|
requirements, benefits, questions, visa_support, language_level, status, date_posted, created_at, updated_at, salary_negotiable
|
|
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24)
|
|
RETURNING id, date_posted, created_at, updated_at
|
|
', arguments do not match: expected 21, but got 24 arguments
|
|
--- FAIL: TestCreateJob (0.00s)
|
|
--- FAIL: TestCreateJob/Success (0.00s)
|
|
--- PASS: TestCreateJob/DB_Error (0.00s)
|
|
=== RUN TestGetJobs
|
|
=== RUN TestGetJobs/List_All
|
|
--- PASS: TestGetJobs (0.00s)
|
|
--- PASS: TestGetJobs/List_All (0.00s)
|
|
=== RUN TestGetJobByID
|
|
job_service_test.go:165: GetJobByID() error = sql: expected 20 destination arguments in Scan, not 26
|
|
--- FAIL: TestGetJobByID (0.00s)
|
|
=== RUN TestUpdateJob
|
|
job_service_test.go:210: UpdateJob() error = sql: expected 20 destination arguments in Scan, not 26
|
|
--- FAIL: TestUpdateJob (0.00s)
|
|
=== RUN TestDeleteJob
|
|
--- PASS: TestDeleteJob (0.00s)
|
|
=== RUN TestTicketService_CRUD
|
|
--- PASS: TestTicketService_CRUD (0.00s)
|
|
=== RUN TestTicketService_Extended
|
|
--- PASS: TestTicketService_Extended (0.00s)
|
|
FAIL
|
|
FAIL github.com/rede5/gohorsejobs/backend/internal/services 1.143s
|
|
FAIL
|