Commit 0fd7518
Jose Luis Moreno
fix: resolve failing test issues and establish comprehensive integration test suite
MAJOR IMPROVEMENTS TO TEST INFRASTRUCTURE AND API COMPATIBILITY
## Protocol and Library Upgrades
- Upgrade to FastMCP library for improved MCP protocol handling
- Deprecate legacy trio protocol support in favor of asyncio-based testing
- Remove @pytest.mark.anyio decorators and trio backend dependencies
- Standardize on pytest.mark.asyncio for consistent async test execution
- Improve test fixture scoping and eliminate circular dependency issues
## Core Test Fixes (Previously Failing Due to Deprecated API Patterns)
- Fix startAt → start_at parameter consistency across all pagination tests
- Update test payload parsing to handle paginated API responses with metadata structure
- Replace deprecated jira_get_epic_issues tool with jira_search using JQL queries
- Enhance skip conditions for insufficient test data scenarios (len(results1["issues"]) <= 1)
- Verify pagination functionality across both Jira Cloud and Data Center environments
## New Features and Enhancements
- Add ADF (Atlassian Document Format) parser for comment content processing
- Create comprehensive MCP application integration tests (19 tests)
- Add Cloud/DC differentiation tests for issue comments
- Enhance search functionality with improved error handling and compatibility
- Implement robust cross-environment testing framework with proper flag usage
## Test Structure Consolidation and Organization
- MOVE: tests/test_real_api_validation.py → tests/integration/test_real_api_tool_validation.py
- PRESERVE: All 57 working validation tests with updated fixes intact
- FIX: test_real_api.py to use --integration flag consistently (11 tests now working)
- CREATE: Comprehensive test documentation in tests/README.md
- UPGRADE: Test infrastructure to use FastMCP and modern async patterns
### Complete Integration Test Suite (87 tests total):
1. **test_mcp_application.py** (19 tests) - Comprehensive MCP functionality validation
- Search functionality, issue operations, comment handling, Epic management
- ADF parsing, environment consistency, project operations, agile boards
- Batch operations, error handling, pagination behavior differences
2. **test_real_api.py** (11 tests) - Direct API client integration testing
- Complete issue lifecycle (CRUD operations)
- Attachment upload/download, bulk issue creation, rate limiting
- Page lifecycle, page hierarchy, CQL search, large content handling
- Cross-service Jira-Confluence integration
3. **test_real_api_tool_validation.py** (57 tests) - FastMCP tool validation
- All original test fixes preserved and working
- Comprehensive API validation scenarios across Cloud/DC environments
- Tool-specific validation with proper error handling
## Technical Implementation Details
- Enhanced JQL search with parent queries: parent = "{epic_key}" ORDER BY created ASC
- Fixed API response parsing: assert isinstance(results.get("issues"), list)
- Improved skip logic for pagination: len(results1["issues"]) <= 1 or len(results2["issues"]) == 0
- Confirmed API compatibility: Cloud (POST /rest/api/3/search/jql) vs DC (GET /rest/api/2/search)
- Standardized integration test execution with --integration flag
- Advanced error handling patterns for robust API interactions
- Modernized async test patterns with FastMCP library integration
## Development Environment Improvements
- Add .amazonq/ and AmazonQ.md to .gitignore (exclude development context files)
- Enhance .env.example with comprehensive integration testing configuration:
* JIRA_TEST_ISSUE_KEY, JIRA_TEST_EPIC_KEY, JIRA_TEST_PROJECT_KEY
* JIRA_TEST_BOARD_ID, JIRA_TEST_SPRINT_ID for agile testing
* CONFLUENCE_TEST_PAGE_ID, CONFLUENCE_TEST_SPACE_KEY
* TEST_PROXY_URL for proxy-related integration tests
- Update tests/README.md with clear documentation of test purposes and execution
- Upgrade dependency management with FastMCP library integration
## Execution and Compatibility Verification
- ALL 87 integration tests verified working in both environments:
* Server/DC (.env.test): All tests pass
* Cloud (.env.realcloud): All tests pass
- Consistent flag usage: --integration for comprehensive integration tests
- Proper test separation: Each file covers distinct, non-overlapping functionality
- Performance: ~22s (Server/DC), ~29s (Cloud) for direct API tests
- FastMCP library compatibility verified across all test scenarios
## Files Modified (22):
- Core functionality: jira/epics.py, jira/issues.py, jira/search.py (+321 lines)
- Models: Enhanced comment.py, issue.py, search.py with better parsing
- Tests: Comprehensive reorganization and consolidation with full documentation
- Configuration: Updated .gitignore, .env.example, pyproject.toml, uv.lock
- Dependencies: FastMCP library integration and trio protocol deprecation
## Files Created (4):
- src/mcp_atlassian/models/jira/adf_parser.py (ADF content parser)
- tests/integration/test_mcp_application.py (comprehensive MCP functionality tests)
- tests/unit/models/test_adf_parser.py (ADF parser unit tests)
- tests/unit/models/test_issue_comment_cloud_differentiation.py (Cloud/DC tests)
## Impact and Results
- Previously failing tests now fully functional across both platforms
- Modern FastMCP library integration improves test reliability and performance
- Deprecated trio protocol removed in favor of standardized asyncio patterns
- Comprehensive test coverage demonstrating proper pagination and API compatibility
- Clean, organized test structure with clear documentation and consistent execution
- Verified Cloud/DC environment compatibility for all integration scenarios
- Enhanced developer experience with proper test categorization and documentation
## Statistics
- Total changes: +4064 insertions, -1540 deletions across 25 files
- Integration test coverage: 87 tests across 3 properly organized files
- Environment compatibility: 100% test pass rate in both Cloud and Server/DC
- Documentation: Complete test suite documentation with execution examples
- Library upgrade: FastMCP integration with deprecated trio protocol removal
This comprehensive update resolves all failing test issues while establishing
a robust, well-organized, and fully documented integration test framework with
modern FastMCP library integration and deprecated protocol cleanup.1 parent 9ad2cbf commit 0fd7518
File tree
25 files changed
+4064
-1540
lines changed- src/mcp_atlassian
- jira
- models/jira
- servers
- tests
- integration
- unit
- jira
- models
- servers
25 files changed
+4064
-1540
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
123 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
124 | 118 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 119 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 120 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
136 | 124 | | |
137 | 125 | | |
138 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 47 | + | |
52 | 48 | | |
53 | 49 | | |
54 | | - | |
| 50 | + | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
62 | 58 | | |
63 | 59 | | |
64 | 60 | | |
| |||
780 | 776 | | |
781 | 777 | | |
782 | 778 | | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
| 779 | + | |
788 | 780 | | |
789 | | - | |
790 | | - | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
791 | 787 | | |
792 | 788 | | |
793 | 789 | | |
| |||
811 | 807 | | |
812 | 808 | | |
813 | 809 | | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
821 | 821 | | |
822 | 822 | | |
823 | 823 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
645 | 646 | | |
646 | 647 | | |
647 | 648 | | |
648 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
649 | 652 | | |
650 | 653 | | |
651 | 654 | | |
| |||
1080 | 1083 | | |
1081 | 1084 | | |
1082 | 1085 | | |
1083 | | - | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1084 | 1089 | | |
1085 | 1090 | | |
1086 | 1091 | | |
| |||
1123 | 1128 | | |
1124 | 1129 | | |
1125 | 1130 | | |
1126 | | - | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
1127 | 1134 | | |
1128 | 1135 | | |
1129 | 1136 | | |
| |||
1222 | 1229 | | |
1223 | 1230 | | |
1224 | 1231 | | |
1225 | | - | |
| 1232 | + | |
1226 | 1233 | | |
1227 | 1234 | | |
1228 | 1235 | | |
| |||
1466 | 1473 | | |
1467 | 1474 | | |
1468 | 1475 | | |
| 1476 | + | |
1469 | 1477 | | |
1470 | 1478 | | |
1471 | 1479 | | |
| |||
0 commit comments