-
Notifications
You must be signed in to change notification settings - Fork 167
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
Task/APPENG-2738: NIM Cypress E2E tests #3298
Task/APPENG-2738: NIM Cypress E2E tests #3298
Conversation
Hi @dmartinol. Thanks for your PR. I'm waiting for a opendatahub-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
8480168
to
e8be6e5
Compare
Below check on the PR is currently failing, but it seems to be passing in our local environment. It might be worth re-running the check to determine if it's a legitimate issue. faling cypress file as per above check - on local it is successful |
/ok-to-test |
ff4c204
to
b1c2492
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3298 +/- ##
==========================================
+ Coverage 85.13% 85.88% +0.75%
==========================================
Files 1338 1338
Lines 30118 30123 +5
Branches 8269 8270 +1
==========================================
+ Hits 25641 25872 +231
+ Misses 4477 4251 -226 see 29 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
Some initial feedback. I'll finish up the review on Monday.
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.
More comments -- I tried to avoid making the same comment multiple times, but I may have missed the mark on that. General themes should be applied to all tests.
frontend/src/__tests__/cypress/cypress/tests/mocked/projects/modelServingNim.cy.ts
Outdated
Show resolved
Hide resolved
frontend/src/__tests__/cypress/cypress/tests/mocked/projects/modelServingNim.cy.ts
Outdated
Show resolved
Hide resolved
frontend/src/__tests__/cypress/cypress/tests/mocked/projects/modelServingNim.cy.ts
Outdated
Show resolved
Hide resolved
frontend/src/__tests__/cypress/cypress/tests/mocked/projects/modelServingNim.cy.ts
Outdated
Show resolved
Hide resolved
@andrewballantyne , shall I rebase to resolve the new conflicts? |
Signed-off-by: Tomer Figenblat <[email protected]>
…s standalone cypress test suite.
…#2) Signed-off-by: Daniele Martinoli <[email protected]>
…render nim and all other cards on overview and model tab when there are no ServingRuntimes configured.
Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Daniele Martinoli <[email protected]>
* when combination of configurations to enable nim models are not configured properly.
Signed-off-by: Tomer Figenblat <[email protected]>
…here are deployments and no deployments. (#9) * Moved the utility method to nimUtils.ts
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Daniele Martinoli <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
- Use JSON object instead of string in mocking of NIM images configmap - Remove experiementalStudio cypres config param - Add mock for NIM project Co-authored-by: Daniele Martinoli <[email protected]> Co-authored-by: lokeshrangineni <[email protected]> Signed-off-by: Tomer Figenblat <[email protected]>
- Add nim-serving interception to odh intercept type safety mechanism - Add accelerators interception to odh intercept type safety mechanism Co-authored-by: Daniele Martinoli <[email protected]> Co-authored-by: lokeshrangineni <[email protected]> Signed-off-by: Tomer Figenblat <[email protected]>
Co-authored-by: Daniele Martinoli <[email protected]> Co-authored-by: lokeshrangineni <[email protected]> Signed-off-by: Tomer Figenblat <[email protected]>
…odelServingNim.cy.ts Co-authored-by: Andrew Ballantyne <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
Signed-off-by: Tomer Figenblat <[email protected]>
bd71dc4
to
06baa5e
Compare
Signed-off-by: Tomer Figenblat <[email protected]>
frontend/src/__tests__/cypress/cypress/pages/components/NIMDeployModal.ts
Show resolved
Hide resolved
} | ||
|
||
findNimModelReplicas() { | ||
return cy.get('[id="model-server-replicas"]'); |
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.
Same here -- another gap we already had.
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'll log a bug for this... this is a common component we failed to properly annotate, shouldn't be one you folks have to make use of. Leave as-is.
findNimModelReplicasMinusButton() { | ||
return this.find().find('button[aria-label="Minus"]').eq(1); | ||
} | ||
|
||
findNimModelReplicasPlusButton() { | ||
return this.find().find('button[aria-label="Plus"]').eq(1); | ||
} |
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 wonder if these have a chance of conflicting with the StorageSize +/-
Hopefully in the improvement issues I'll log we can make sure this is covered too.
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'll log a bug for this... this is a common component we failed to properly annotate, shouldn't be one you folks have to make use of. Leave as-is.
findServingRuntime() { | ||
return this.find().find(`[data-label="Serving Runtime"]`); | ||
} | ||
|
||
findProject() { | ||
return this.find().find(`[data-label=Project]`); | ||
} |
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.
Although these are not likely to change, they feel like they might be brittle based on how the selectors are written.
No action needed atm, but I wonder if we can't log something to improve these gaps in the future.
findDeployedModelServingRuntime(name: string) { | ||
return cy | ||
.findByTestId('section-overview') | ||
.get('div') | ||
.contains(name) | ||
.parents('.odh-type-bordered-card .model-server') | ||
.get('dd'); | ||
} |
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 don't think this will select anything -- I can't find section-overview
test id in the code outside of this selector.
Looking for classes and going through divs is definitely a fast-track to brittle tests. If you're trying to select an element specifically on a page, we need a better data-testid on it.
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 does selects, the test works:
it('should list the deployed model in Overview tab', () => {
initInterceptsToEnableNim({ hasAllModels: false });
cy.interceptK8sList(InferenceServiceModel, mockK8sResourceList([mockNimInferenceService()]));
cy.interceptK8sList(ServingRuntimeModel, mockK8sResourceList([mockNimServingRuntime()]));
projectDetails.visit('test-project');
// Card is visible
projectDetailsOverviewTab
.findDeployedModelServingRuntime('Test Name')
.should('have.text', 'NVIDIA NIM');
});
I couldn't find a testid on the deployed model card, using the parent based on the calsses was the only way I was able to select the card. Can you suggest something else please?
} | ||
} | ||
|
||
class KserveTableRow extends TableRow { |
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.
This feels like it doesn't belong here -- KServe Specific stuff in a projects file? Hmmm... I wonder if this doesn't belong better in the modelServing.ts
page component file?
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.
Maybe we named it incorrectly, but we use it to select deployed model records from the models table in the Models tab. See test called should list the deployed model in Models tab.
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.
@andrewballantyne there's a decent amount of model serving related duplication between the projects page tests and the model serving page tests, since we have some of the same functionality in 3 places (project details overview tab, project details models tab, model serving page). It maybe should be cleaned up at the same time as some of the refactoring @lucferbux and @emilys314 have mentioned doing as part of the KServe Raw Deployment work.
frontend/src/__tests__/cypress/cypress/tests/mocked/modelServing/modelServingNim.cy.ts
Outdated
Show resolved
Hide resolved
initInterceptsToDeployModel(nimInferenceService); | ||
|
||
projectDetails.visitSection('test-project', 'model-server'); | ||
cy.get('button[data-testid=deploy-button]').click(); |
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.
This feels like a gap in the page object -- you shouldn't need selectors in the test itself.
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.
In the project's models tab, when no models are deployed:
-
If only one type of platform is enabled, i.e. nim for our tests, the one and only deploy button's testid is deploy-button.
-
If multiple platform are enabled, each button get's a its own testid, for nim it's nim-serving-deploy-button.
Do you want to add a "findNim..", "findSingle...", "findMulti...", "findOnlyOne..."?
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.
Hmmm -- there are probably better ways to handle this. I'd need to take a look at the situation more closely to know what the best call is. Having a page selector for each seems a bit much; especially when only 1 will work at a given moment.
disableNIMModelServing: true, | ||
}); | ||
projectDetailsOverviewTab.visit('test-project'); | ||
cy.findByTestId('model-serving-platform-button').should('not.exist'); |
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.
The initial part should be in a page object -- you should be doing the .should
off page object methods.
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.
Yeah, the reason I did that here, in the comment below (and in a bunch of other places in this file 😃 ), is because both deploy buttons for single-serving and nim-serving have the same testid; in our test cases, only the nim-platform-card is available, so this works.
We can add object funcs like "findNimServingDeployButton" and "findSingleServingDeployButton", but it won't be pretty. Unless we can change the testid of one of the buttons...
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.
The parent => parent div has nvidia-nim-platform-card
}); | ||
projectDetailsOverviewTab.visit('test-project'); | ||
projectDetailsOverviewTab.findModelServingPlatform('nvidia-nim').should('not.exist'); | ||
cy.findByTestId('model-serving-platform-button').should('not.exist'); |
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.
Most definitely if you're repeating the selector.
co-authored-by: Andrew Ballantyne <[email protected]> Signed-off-by: Tomer Figenblat <[email protected]>
5684898
to
80af75e
Compare
@andrewballantyne - the changes to the infereceservice mock for supporting custom labels, as we talked about offline are here: 80af75e. |
db79682
to
80af75e
Compare
co-authored-by: Andrew Ballantyne <[email protected]> Signed-off-by: Tomer Figenblat <[email protected]>
368e747
to
a9007d5
Compare
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.
/hold
Waiting to see if Tomer has something he wants to do here... there are other changes we can do but this is a lingering PR that I would like merged so we can keep building on it.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
Description
Adding Cypress UI tests to cover the NIM Model use cases from all the supported pages and tabs:
How Has This Been Tested?
Running
npm run test:cypress-ci
command.Test Impact
Increases code coverage of UI code for all the components impacted by the NIM models.
Request review criteria:
Self checklist (all need to be checked):
After the PR is posted & before it merges:
main