Skip to content
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

test: Djanicek/infeng 456/workspaces and projects #9117

Merged
merged 11 commits into from
Apr 16, 2024

Conversation

djanicekpach
Copy link
Contributor

@djanicekpach djanicekpach commented Apr 5, 2024

Test: Djanicek/infeng 456/workspaces and projects

test: ui e2e workspace create and delete

Ticket

INFENG-456

Description

adds workspace create and delete tests to playwright. Requires a hew change to work correctly.

Test Plan

image

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Copy link

netlify bot commented Apr 5, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit ec1c415
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/661eafad5f93bc00082355bc
😎 Deploy Preview https://deploy-preview-9117--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@djanicekpach djanicekpach changed the title Djanicek/infeng 456/workspaces and projects Draft: Djanicek/infeng 456/workspaces and projects Apr 5, 2024
* @param {string} [obj.selector] - Used instead of `defaultSelector`
*/
export class ModelRegistryComponent extends NamedComponent {
override defaultSelector: string = '[data-testid=modelRegistry]';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

override not needed here


/**
* Returns a representation of the Model Registry Page component.
* This constructor represents the contents in src/components/Page.tsx.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotta update the docstring here too.
image
this class wants to have a Page like SignIn page has, and then it should import ModelRegistry from e2e/models/component/ModelRegistry.ts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ModelRegistry component will be initialize with pageComponent as it's parent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the page object, it is the page component. It's not referenced yet but will be in the next PR. It will be wrapped by the ModelRegistry page and also the Pivot n workspace details.

Copy link
Contributor

@JComins000 JComins000 Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Please remove the Page from that filename

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and doublecheck the docstring

export class WorkspacesList extends NamedComponent {
override defaultSelector: string = '[id=workspaces]';
readonly newWorkspaceButton: BaseComponent = new BaseComponent({
parent: this,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, you want a PageComponent parent

export class WorkspaceCreateModal extends Modal {

readonly workspaceName: BaseComponent = new BaseComponent({
parent: this,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.body, i think

Copy link

codecov bot commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 251 lines in your changes are missing coverage. Please review.

Project coverage is 35.37%. Comparing base (4ceaed0) to head (ec1c415).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9117       +/-   ##
===========================================
- Coverage   46.03%   35.37%   -10.67%     
===========================================
  Files         768      455      -313     
  Lines      106731    67574    -39157     
  Branches     2429     2438        +9     
===========================================
- Hits        49133    23903    -25230     
+ Misses      57375    43439    -13936     
- Partials      223      232        +9     
Flag Coverage Δ
harness ?
web 35.41% <0.00%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
webui/react/src/e2e/models/hew/Dropdown.ts 0.00% <0.00%> (ø)
...ui/react/src/pages/WorkspaceList/WorkspaceCard.tsx 0.00% <0.00%> (ø)
webui/react/src/pages/WorkspaceList.tsx 0.00% <0.00%> (ø)
...ebui/react/src/components/WorkspaceCreateModal.tsx 0.00% <0.00%> (ø)
...i/react/src/e2e/models/components/ModelRegistry.ts 0.00% <0.00%> (ø)
...eact/src/e2e/models/components/WorkspaceDetails.ts 0.00% <0.00%> (ø)
.../src/e2e/models/components/WorkspaceDeleteModal.ts 0.00% <0.00%> (ø)
webui/react/src/e2e/models/hew/Card.ts 0.00% <0.00%> (ø)
webui/react/src/e2e/models/ant/Switch.ts 0.00% <0.00%> (ø)
.../react/src/e2e/models/components/WorkspacesList.ts 0.00% <0.00%> (ø)
... and 4 more

... and 322 files with indirect coverage changes


test.afterEach(async ({ page }) => {
const workspacesPage = new Workspaces(page);
await test.step('Delete a workspace', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

best not to have split behavior in after all.
i would say the afterAll should delete any workspace through a single method. if we want to test an alternate method for deleting workspaces, then we should perform that in a test case. Check out how I deactivate users at the end of user tests.

Copy link
Contributor Author

@djanicekpach djanicekpach Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

best not to have split behavior in after all.

Why?
I need to test both ways of deleting. It's explicit in the test plan. I actually kind of like having steps in after all as clean-up, but I'm planning to defer the big test-organizational stuff until a future PR.

There's a trade off here, we can split everything into separate test cases which is cleaner, but also slower and more duplicative since we need to create/delete more workspaces overall. This test case needs 2 workspaces, so doing create/delete differently with them both to get the free coverage is better IMO than adding an additional test case to get the same coverage. I suspect at the end I may need to split this into separate cases. It's a big test. But for now I'm planning to leave it to see if we can have that coverage without more test cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intuitively, I would think if teardown should be the most stable and straightforward part of the test. i.e., if it fails on one test, i would expect it to fail in every test. if i'm just running a single test, it could be confusing which teardown is running. if we want two teardowns, maybe we should have two describes. anyway, this is all semantics and ultimately these details dont matter so much. I'll leave the decision to you

@djanicekpach djanicekpach changed the title Draft: Djanicek/infeng 456/workspaces and projects Test: Djanicek/infeng 456/workspaces and projects Apr 15, 2024
Copy link
Contributor

@JComins000 JComins000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving. i left comments about the teardown, which could be addressed later. also this file webui/react/src/e2e/models/components/ModelRegistryPage.ts should be renamed to not have Page in it's title

@djanicekpach djanicekpach changed the title Test: Djanicek/infeng 456/workspaces and projects test: Djanicek/infeng 456/workspaces and projects Apr 15, 2024
@djanicekpach djanicekpach force-pushed the djanicek/infeng-456/workspaces-and-projects branch from 63abd4b to 5142c95 Compare April 16, 2024 15:25
@djanicekpach
Copy link
Contributor Author

Build docs is failing after rebase because it's failing on master https://hpe-aiatscale.slack.com/archives/C04C9JXB1C2/p1713280926191379

@djanicekpach djanicekpach force-pushed the djanicek/infeng-456/workspaces-and-projects branch from 5142c95 to 58caec2 Compare April 16, 2024 16:28
@djanicekpach djanicekpach merged commit ee15da0 into main Apr 16, 2024
71 of 84 checks passed
@djanicekpach djanicekpach deleted the djanicek/infeng-456/workspaces-and-projects branch April 16, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants