-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test cases for viewing specific patterns by name #11166
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: yash37158 <yash37158@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #11166 +/- ##
==========================================
+ Coverage 9.11% 9.21% +0.09%
==========================================
Files 146 146
Lines 19303 19303
==========================================
+ Hits 1760 1778 +18
+ Misses 17241 17215 -26
- Partials 302 310 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: yash37158 <yash37158@gmail.com>
@yash37158 Thank you for your contributions. |
It’s great to see this PR. 🤠 |
@DevRish would you like to review this PR and offer comment? |
URLs: []utils.MockURL{ | ||
{ | ||
Method: "GET", | ||
URL: "https://raw.githubusercontent.com/yash37158/SamplePattern/main/samplepatternwithservicemesh.golden", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is best to keep test related assets within this repo itself and not have dependency on files from external repositories.
We have a similar design file in the fixtures
directory here.
We can use a link to that instead (https://raw.githubusercontent.com/meshery/meshery/master/mesheryctl/internal/cli/root/pattern/fixtures/pattern.golden)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sure @DevRish
Args: []string{"view", "design"}, | ||
ExpectedResponse: "view.pattern.output.golden", | ||
Fixture: "view.pattern.api.response.golden", | ||
URL: testContext.BaseURL + "/api/pattern?name=Untitled Design", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently a design with this name exists. But if gets deleted in the future, this test might fail. We could add a block before this to upload a design with a name, and then use that name in this block. This will ensure that the file always exists when the test runs...
Args: []string{"view", "design"}, | ||
ExpectedResponse: "view.pattern.output.golden", | ||
Fixture: "view.pattern.api.response.golden", | ||
URL: testContext.BaseURL + "/api/pattern?name=NonExistentDesign", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar concern here. A file with this name currently doesn't exist, but if it does get created somehow in the future, this test might fail... Can we somehow ensure that the design doesn't exist before using that design's name in this test?
Thanks, @DevRish 👍 |
It'd be great to have this as a point of discussion on tomorrow's Meshery Build and Release call. |
Notes for Reviewers
This PR adds test cases to the Meshery project to verify the ability to view specific patterns based on their names within a design file. The new test cases cover both successful retrieval and handling of non-existent patterns, enhancing the
pattern
package's functionality.This PR fixes #11107
Signed commits