Open
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR adds comprehensive integration test support for the test provider, enabling simulation of various HTTP response codes and error conditions for both generate and topology endpoints. Key Changes:
Review Notes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant HTTPServer
participant TestProvider
participant AsyncQueue
participant ModelLoader
Client->>HTTPServer: POST /v1/generate (with test provider params)
HTTPServer->>TestProvider: HandleTestProviderRequest()
alt Generate error simulation (4xx/5xx)
TestProvider->>TestProvider: Check generateResponseCode
TestProvider-->>HTTPServer: Return error immediately
HTTPServer-->>Client: HTTP error (4xx/5xx)
else Normal flow (202)
TestProvider-->>HTTPServer: Return false (continue normal flow)
HTTPServer->>AsyncQueue: Submit(request)
AsyncQueue-->>HTTPServer: uid
HTTPServer-->>Client: HTTP 202 + uid
Client->>HTTPServer: GET /v1/topology?uid=<uid>
HTTPServer->>AsyncQueue: Get topology result
alt Topology error simulation (4xx/5xx)
AsyncQueue->>TestProvider: Loader()
TestProvider->>TestProvider: Check topologyResponseCode
TestProvider-->>AsyncQueue: Return httperr (4xx/5xx/202)
AsyncQueue-->>HTTPServer: Error response
HTTPServer-->>Client: HTTP error
else Success (200)
AsyncQueue->>TestProvider: Loader()
TestProvider->>TestProvider: Check modelFileName or modelPath
alt Embedded model file
TestProvider->>ModelLoader: GetModelFileData(modelFileName)
ModelLoader-->>TestProvider: Model data
TestProvider->>TestProvider: NewModelFromData()
else File path
TestProvider->>TestProvider: NewModelFromFile(modelPath)
else Default
TestProvider->>TestProvider: GetTreeTestSet()
end
TestProvider->>TestProvider: Generate topology tree
TestProvider-->>AsyncQueue: Provider instance
AsyncQueue->>TestProvider: GenerateTopologyConfig()
TestProvider-->>AsyncQueue: Topology vertex
AsyncQueue-->>HTTPServer: Topology config
HTTPServer-->>Client: HTTP 200 + topology config
end
end
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
==========================================
+ Coverage 65.83% 66.15% +0.32%
==========================================
Files 81 82 +1
Lines 4484 4524 +40
==========================================
+ Hits 2952 2993 +41
+ Misses 1419 1417 -2
- Partials 113 114 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Ravi Shankar <ravish@nvidia.com>
Signed-off-by: Ravi Shankar <ravish@nvidia.com>
b914f49 to
87e7ba4
Compare
Signed-off-by: Ravi Shankar <ravish@nvidia.com>
87e7ba4 to
b6409a6
Compare
Signed-off-by: Ravi Shankar <ravish@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.