Commit c158d9c
feat: Add destroy() method to Runtime notebook interface with comprehensive tests (#305)
This PR adds the destroy() functionality to the Python Runtime operations for notebook interface.
**New Features:**
- Added destroy() method to Runtime class for cleaning up deployed resources
- Support for dry_run mode to preview what will be destroyed
- Option to delete ECR repository with delete_ecr_repo parameter
- Automatic state cleanup on successful destroy operations
- Comprehensive logging with warnings and errors
**Test Improvements:**
- Fixed all 11 failing destroy unit tests by correcting mock patch paths
- Added parametrized tests for better maintainability:
- test_destroy_with_parameters: 4 parameter combinations (dry_run, delete_ecr_repo)
- test_destroy_with_warnings_and_errors: 3 warning/error scenarios
- Removed 3 redundant tests now covered by parametrized versions
- Fixed variable naming bugs in test assertions
- All 931 tests passing, 2 skipped
**Testing:**
- Added integration test for destroy operation
- All pre-commit hooks passing (ruff, bandit, pytest with coverage)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Signed-off-by: Vivekbhadauria1 <vivekbh@amazon.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 196500a commit c158d9c
File tree
3 files changed
+488
-1
lines changed- src/bedrock_agentcore_starter_toolkit/notebook/runtime
- tests_integ/notebook
- tests/notebook/runtime
3 files changed
+488
-1
lines changedLines changed: 72 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
442 | 513 | | |
443 | 514 | | |
444 | 515 | | |
| |||
0 commit comments