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

Fix/44 Add tests #53

Merged
merged 1 commit into from
Mar 25, 2025
Merged

Fix/44 Add tests #53

merged 1 commit into from
Mar 25, 2025

Conversation

karanBRAVO
Copy link
Contributor

@karanBRAVO karanBRAVO commented Mar 11, 2025

Describe the PR

In this PR, I have added the configuration files for writing tests in both frontend and backend. Using Vitest as the testing framework.
Resolves #44

How to test this PR

  1. Install the dependencies
npm ci
  1. To run frontend tests
npm run test:frontend
  1. To run backend tests
npm run test:backend

@karanBRAVO
Copy link
Contributor Author

/assign @william-wang

@karanBRAVO
Copy link
Contributor Author

/assign @Monokaix

Copy link

@de6p de6p left a comment

Choose a reason for hiding this comment

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

The project does require tests and a testing framework, but this can be handled as a separate issue or as mentorship work for a mentee. The current state of the volcano dashboard still needs refinement and stabilization, which means testing is not the immediate priority. We also need to discuss which framework would be the best fit. In my opinion, we should revisit the testing aspect later.

cc @Monokaix @JesseStutler

@Monokaix
Copy link
Member

You can rebase the master branch first: )

@karanBRAVO
Copy link
Contributor Author

You can rebase the master branch first: )

ok

@karanBRAVO
Copy link
Contributor Author

Hello @Monokaix,
I have updated the PR, need your reviews. let me know if there's any issue.
Thanks
Karan Yadav

@@ -76,6 +76,7 @@ const Layout = () => {
</AppBar>

<Drawer
data-testid="sidebar-drawer"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

id given to this component so that it is easier to get this while testing.

Comment on lines +13 to +21
// browser: {
// provider: "playwright",
// enabled: true,
// instances: [
// {
// browser: "chromium",
// },
// ],
// },
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 useful when we want to run tests in the browser natively.
https://vitest.dev/guide/browser/

Copy link
Member

Choose a reason for hiding this comment

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

Why comment this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why comment this?

because this is Experimental feature.

@Monokaix
Copy link
Member

Does this pr only add a test framework?And why choose vitest?

@karanBRAVO
Copy link
Contributor Author

Does this pr only add a test framework?And why choose vitest?

Yes, this adds the test framework vitest, also 2 tests to check this PR.

Why Vitest

Since we are use vite.js so vitest is the natural choice, and it provides better Dev Experience as it has interactive ui. Along with that, it is fast and similar to jest.

@karanBRAVO
Copy link
Contributor Author

Hey @Monokaix, rebased the PR, let me know if there's any other issue.

@karanBRAVO
Copy link
Contributor Author

Hello @Monokaix, What are your reviews on this?

@Monokaix
Copy link
Member

/lgtm

Copy link
Member

@kevin-wangzefeng kevin-wangzefeng left a comment

Choose a reason for hiding this comment

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

/approve

@Monokaix
Copy link
Member

Hi please rebase the master and keep one clean commit: )

Signed-off-by: Karan Yadav <xpresskaran98@gmail.com>
@karanBRAVO
Copy link
Contributor Author

Hello @Monokaix, I have updated the commits, let me know if there's any other issue(s). :)

@@ -0,0 +1,12 @@
import { defineConfig } from "vitest/config";
Copy link

Choose a reason for hiding this comment

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

We could have utilized Jest or Mocha for backend testing. However, we can postpone the testing phase for now, as there are still many progressive changes to be made in this PR #61

cc @william-wang @Monokaix @JesseStutler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

Copy link
Member

Choose a reason for hiding this comment

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

Yeah you can keep working on that @de6p

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kevin-wangzefeng, Monokaix

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:
  • OWNERS [Monokaix,kevin-wangzefeng]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Monokaix
Copy link
Member

/lgtm

@volcano-sh-bot volcano-sh-bot merged commit a4742ce into volcano-sh:main Mar 25, 2025
3 checks passed
@karanBRAVO
Copy link
Contributor Author

Hey @Monokaix, Now we have to write tests. Should I create issue related to this? Also, I wanna work on this.
Do we have to keep this for next LFX mentorship program?

@Monokaix
Copy link
Member

Hey @Monokaix, Now we have to write tests. Should I create issue related to this? Also, I wanna work on this. Do we have to keep this for next LFX mentorship program?

Maybe we can consider that: )

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.

Add tests
6 participants