@@ -1759,7 +1759,7 @@ describe('docker-manager', () => {
17591759 expect ( squid . volumes ) . toContain ( '/tmp/awf-test/squid-logs:/var/log/squid:rw' ) ;
17601760 } ) ;
17611761
1762- it ( 'should use sibling api-proxy-logs directory when proxyLogsDir is specified' , ( ) => {
1762+ it ( 'should use api-proxy-logs subdirectory inside proxyLogsDir when specified' , ( ) => {
17631763 const config : WrapperConfig = {
17641764 ...mockConfig ,
17651765 proxyLogsDir : '/custom/proxy/logs' ,
@@ -1772,7 +1772,7 @@ describe('docker-manager', () => {
17721772 } ) ;
17731773 const apiProxy = result . services [ 'api-proxy' ] ;
17741774
1775- expect ( apiProxy . volumes ) . toContain ( '/custom/proxy/api-proxy-logs:/var/log/api-proxy:rw' ) ;
1775+ expect ( apiProxy . volumes ) . toContain ( '/custom/proxy/logs/ api-proxy-logs:/var/log/api-proxy:rw' ) ;
17761776 } ) ;
17771777
17781778 it ( 'should use workDir/api-proxy-logs when proxyLogsDir is not specified' , ( ) => {
@@ -2711,7 +2711,7 @@ describe('docker-manager', () => {
27112711 expect ( fs . existsSync ( proxyLogsDir ) ) . toBe ( true ) ;
27122712 } ) ;
27132713
2714- it ( 'should create api-proxy-logs sibling directory when proxyLogsDir is specified' , async ( ) => {
2714+ it ( 'should create api-proxy-logs subdirectory inside proxyLogsDir when specified' , async ( ) => {
27152715 const proxyLogsDir = path . join ( testDir , 'custom-proxy-logs' ) ;
27162716 const config : WrapperConfig = {
27172717 allowedDomains : [ 'github.com' ] ,
@@ -2728,8 +2728,8 @@ describe('docker-manager', () => {
27282728 // May fail after writing configs
27292729 }
27302730
2731- // Verify api-proxy-logs sibling directory was created
2732- const apiProxyLogsDir = path . join ( testDir , 'api-proxy-logs' ) ;
2731+ // Verify api-proxy-logs subdirectory was created inside proxyLogsDir
2732+ const apiProxyLogsDir = path . join ( proxyLogsDir , 'api-proxy-logs' ) ;
27332733 expect ( fs . existsSync ( apiProxyLogsDir ) ) . toBe ( true ) ;
27342734 } ) ;
27352735
@@ -3253,11 +3253,11 @@ describe('docker-manager', () => {
32533253 }
32543254 } ) ;
32553255
3256- it ( 'should chmod api-proxy-logs sibling when proxyLogsDir is specified' , async ( ) => {
3256+ it ( 'should chmod api-proxy-logs subdirectory when proxyLogsDir is specified' , async ( ) => {
32573257 // proxyLogsDir must be OUTSIDE workDir since cleanup deletes workDir
32583258 const externalDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'awf-proxy-logs-test-' ) ) ;
32593259 const proxyLogsDir = path . join ( externalDir , 'proxy-logs' ) ;
3260- const apiProxyLogsDir = path . join ( externalDir , 'api-proxy-logs' ) ;
3260+ const apiProxyLogsDir = path . join ( proxyLogsDir , 'api-proxy-logs' ) ;
32613261 fs . mkdirSync ( proxyLogsDir , { recursive : true } ) ;
32623262 fs . mkdirSync ( apiProxyLogsDir , { recursive : true } ) ;
32633263 fs . writeFileSync ( path . join ( proxyLogsDir , 'access.log' ) , 'proxy log content' ) ;
@@ -3266,7 +3266,7 @@ describe('docker-manager', () => {
32663266 try {
32673267 await cleanup ( testDir , false , proxyLogsDir ) ;
32683268
3269- // Verify chmod was called on both proxyLogsDir and api-proxy-logs sibling
3269+ // Verify chmod was called on both proxyLogsDir and api-proxy-logs subdirectory
32703270 expect ( mockExecaSync ) . toHaveBeenCalledWith ( 'chmod' , [ '-R' , 'a+rX' , proxyLogsDir ] ) ;
32713271 expect ( mockExecaSync ) . toHaveBeenCalledWith ( 'chmod' , [ '-R' , 'a+rX' , apiProxyLogsDir ] ) ;
32723272 } finally {
0 commit comments