@@ -8,15 +8,12 @@ import { createDefaultServiceConfig, getAllServiceDefinitions, getServiceDefinit
8
8
import { disableService , enableService , getServiceStatus , initializeServiceManager , listServices , restartService , startService , stopService } from '../src/services/manager'
9
9
import { generateLaunchdPlist , generateSystemdService , getServiceManagerName , isPlatformSupported } from '../src/services/platform'
10
10
11
- // Helper function to detect if we're in a CI environment
11
+ // Helper function to detect if we're in a CI environment where services aren't available
12
12
function isRunningInCI ( ) : boolean {
13
13
return process . env . CI === 'true'
14
14
|| process . env . GITHUB_ACTIONS === 'true'
15
15
|| process . env . RUNNER_OS !== undefined
16
16
|| process . env . GITHUB_RUN_ID !== undefined
17
- // Check if PostgreSQL tools are actually available
18
- || ! process . env . PATH ?. includes ( '/usr/bin' )
19
- || process . env . NODE_ENV === 'test' // Fallback for test environments
20
17
}
21
18
22
19
describe ( 'Service Management' , ( ) => {
@@ -501,7 +498,7 @@ describe('Service Management', () => {
501
498
}
502
499
503
500
// Skip actual service operations in CI where services aren't installed
504
- if ( process . env . CI || process . env . GITHUB_ACTIONS ) {
501
+ if ( isRunningInCI ( ) ) {
505
502
const serviceName = 'redis'
506
503
expect ( serviceName ) . toBe ( 'redis' )
507
504
return
@@ -568,7 +565,7 @@ describe('Service Management', () => {
568
565
}
569
566
570
567
// Skip actual service operations in CI where services aren't installed
571
- if ( process . env . CI || process . env . GITHUB_ACTIONS ) {
568
+ if ( isRunningInCI ( ) ) {
572
569
// Just test configuration setting without actually starting services
573
570
const mockConfig = {
574
571
'maxmemory' : '128mb' ,
@@ -612,7 +609,7 @@ describe('Service Management', () => {
612
609
expect ( isPlatformSupported ( ) ) . toBe ( true )
613
610
614
611
// Skip actual service operations in CI where services aren't installed
615
- if ( process . env . CI || process . env . GITHUB_ACTIONS ) {
612
+ if ( isRunningInCI ( ) ) {
616
613
// Just test that we can import and call the platform check
617
614
expect ( isPlatformSupported ( ) ) . toBe ( true )
618
615
}
0 commit comments