Commit 641b57d
committed
Fix CodeRabbit issues and add test infrastructure
Addresses all CodeRabbit critical issues:
1. Case-insensitive error detection (CRITICAL)
- Use strings.ToLower() for error matching in retry logic
- Now catches '404 Not Found', 'No file found', 'FILE NOT FOUND', etc.
- Prevents immediate failure on HTTP 404 responses
2. Guard against invalid maxRetries configuration (CRITICAL)
- Added validation to fail fast when maxRetries <= 0
- Returns clear error message about configuration issue
3. Comprehensive edge case tests (MAJOR)
- ZeroMaxRetries: validates error on maxRetries=0
- NegativeMaxRetries: validates error on maxRetries=-1
- ErrorMessageCaseInsensitivity: tests all case variations
- Covers '404 Not Found', 'Unauthorized', 'Rate limit' scenarios
4. Test infrastructure improvements
- Created testdata files (sample.txt, sample1-3.txt) for acceptance tests
- Added testAccCheckOpenAIVectorStoreFileDestroy verification
- Made OPENAI_ORGANIZATION_ID optional (supports personal accounts)
- Added acceptance-tests.yml workflow for secure CI/CD testing
- Added cost warning in workflow output
All tests pass (33.354s) with proper timing validation.1 parent 8415abb commit 641b57d
4 files changed
+36
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments