maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Add command-line switch to omit folders from debug output

Open Fishbowler opened this issue 3 months ago • 0 comments

Continuing #1445 Fixes #1427

Adding a --flatten-debug-output switch that will remove the datetime folder, as well as /.maestro/tests/ from the path, leaving the debug output exactly where the user defined.

(Updated with feedback from previous PR to remove

Proposed Changes

Added a new option --flatten-debug-output to the test command in maestro-cli to simplify the test output folder structure for CI environments. Updated the TestDebugReporter class to handle this option and generate the output path accordingly.

Testing

I'm using a simple flow to force an error:

appId: com.example
---
- assertTrue: 
    condition: ${ 1 === 2 }
    label: 1 is the same as 2

No params:

 ⇒ ./maestro test scratch.yaml 
Running on emulator-5554      
                              
 ║                            
 ║  > Flow                    
 ║                            
 ║    ❌  Does 1 equal 2?     
 ║                            
                              
Assertion is false: false is true

==== Debug output (logs & screenshots) ====

/Users/danc/.maestro/tests/2024-05-17_150239

Just the debug option:

 ⇒ ./maestro test --debug-output /tmp/maestro scratch.yaml                    
Running on emulator-5554        
                                
 ║                              
 ║  > Flow                      
 ║                              
 ║    ❌  1 is the same as 2    
 ║                              
                                
Assertion is false: false is true

==== Debug output (logs & screenshots) ====

/tmp/maestro/.maestro/tests/2024-05-17_150426

With the new option:

 ⇒ ./maestro test --debug-output /tmp/maestro --flatten-debug-output  scratch.yaml
Running on emulator-5554        
                                
 ║                              
 ║  > Flow                      
 ║                              
 ║    ❌  1 is the same as 2    
 ║                              
                                
Assertion is false: false is true

==== Debug output (logs & screenshots) ====

/tmp/maestro

Full file listing of /tmp/maestro after above:

 ⇒ find /tmp/maestro 
/tmp/maestro
/tmp/maestro/screenshot-❌-1715954725865-(scratch.yaml).png
/tmp/maestro/commands-(scratch.yaml).json
/tmp/maestro/.maestro
/tmp/maestro/.maestro/tests
/tmp/maestro/.maestro/tests/2024-05-17_150426
/tmp/maestro/.maestro/tests/2024-05-17_150426/commands-(scratch.yaml).json
/tmp/maestro/.maestro/tests/2024-05-17_150426/maestro.log
/tmp/maestro/.maestro/tests/2024-05-17_150426/screenshot-❌-1715954675177-(scratch.yaml).png
/tmp/maestro/maestro.log

Issues Fixed

#1427

Fishbowler avatar May 17 '24 14:05 Fishbowler