Commit graph

4 commits

Author SHA1 Message Date
mashraf-222
8216f32d9e
Optimization Factory update (#2035)
Co-authored-by: Mohamed Ashraf <mohamedashrraf222@gmail.com>
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
2025-12-08 23:22:32 +05:30
mashraf-222
e785a7676b
Enhancing tests catching in the optimization factory script (#1887)
1. **New log with ANSI codes** (`tests-2025-10-07T22-58-04-00-00.log`):
   - **Before**: `passed=0 failed=1 errors=28 ratio=0%` 
   - **After**: `passed=28441 failed=46 errors=0 ratio=99%` 

2. **Original log with errors** (`tests-2025-10-07T22-56-48-00-00.log`):
   - **Before**: `passed=0 failed=0 errors=83 ratio=0%`   
   - **After**: `passed=44359 failed=0 errors=83 ratio=99%` 

3. **Interrupted log without summary**
(`tests-2025-10-07T01-59-08-00-00.log`):
   - **Before**: `passed=0 failed=1 errors=0 ratio=0%` 
- **After**: Uses fallback method to count individual
`PASSED`/`FAILED`/`SKIPPED` lines 

###  **Implementation Details:**

The current script now uses:
```bash
# Primary method: Extract from summary lines
PASSED=$(grep -oE '[0-9]+ passed' "$TEST_LOG_FILE" | tail -n1 | grep -oE '[0-9]+')
FAILED=$(grep -oE '[0-9]+ failed' "$TEST_LOG_FILE" | tail -n1 | grep -oE '[0-9]+')
ERRORS=$(grep -oE '[0-9]+ errors' "$TEST_LOG_FILE" | tail -n1 | grep -oE '[0-9]+')

# Fallback method: Count individual test results
if [ -z "$PASSED" ] && [ -z "$FAILED" ] && [ -z "$ERRORS" ]; then
  PASSED=$(grep -c "PASSED" "$TEST_LOG_FILE" 2>/dev/null || echo "0")
  FAILED=$(grep -c "FAILED" "$TEST_LOG_FILE" 2>/dev/null || echo "0")
  SKIPPED=$(grep -c "SKIPPED" "$TEST_LOG_FILE" 2>/dev/null || echo "0")
fi
```

###  **Key Improvements:**

1. **Handles ANSI color codes** - `grep -oE` ignores color codes and
extracts the actual numbers
2. **Robust regex patterns** - Uses `[0-9]+` instead of greedy `.*`
patterns
3. **Fallback mechanism** - Counts individual test results when no
summary line exists
4. **Works with all pytest formats** - Handles both `X passed, Y failed,
Z errors` and `X passed, Y errors` formats

###  **Conclusion:**

**Yes, the current implementation will correctly catch all types of test
results** from the three log files you mentioned. The script will now:

-  Correctly parse `28441 passed` from ANSI-colored summary lines
-  Correctly parse `44359 passed` from clean summary lines  
-  Correctly parse `83 errors` when present
-  Fall back to counting individual test results for interrupted runs
-  Calculate accurate pass ratios (99% instead of 0%)

---------

Co-authored-by: Mohamed Ashraf <mohamedashrraf222@gmail.com>
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
2025-10-23 19:27:00 -07:00
mashraf-222
ebd1755359
Feature/optimizer updates (#1871)
- Introduced new API endpoints for downloading individual archived logs
and all logs for a repository as a ZIP file.
- Enhanced the CSV handling in the application to include new fields for
auto-termination and analysis configuration.
- Updated the frontend to support new features, including a modal for
auto-termination settings and improved UI for log management.
- Updated styles for modals and tables to enhance visual consistency and
usability."
- Added Dumpy security code in the FE with "123456"
- added ability to customize and view the repo analysis by the LLM
results
- adding deployment folder for the whole deployment flow along with the
dogs
- fixed some permission errors and ssh access by www-data user while
deployment
- added s3 bucket saving logs based

---------

Co-authored-by: Ashraf <ashraf@rapiddata.io>
Co-authored-by: Mohamed Ashraf <mohamedashrraf222@gmail.com>
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2025-10-11 02:08:21 -07:00
Sarthak Agarwal
0c16414301
optimization Pipeline (#1860)
Co-authored-by: saga4 <saga4@codeflashs-MacBook-Air.local>
2025-10-02 12:21:10 -07:00