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]: Jest to Vitest migration caravan-client package #119

Merged

Conversation

DhairyaMajmudar
Copy link

@DhairyaMajmudar DhairyaMajmudar commented Aug 27, 2024

Jest to Vitest migration caravan-client package

Related to #115

Screenshot

image

cc: @bucko13 @Legend101Zz

Copy link

changeset-bot bot commented Aug 27, 2024

⚠️ No Changeset found

Latest commit: cb512ba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
caravan-coordinator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 30, 2024 6:40am

@DhairyaMajmudar
Copy link
Author

Needed one suggestion:

How's about keeping test files in __test__ folder this will help test and main files to keep separated and also gives below looking cool folder structure : )

image

@bucko13
Copy link
Contributor

bucko13 commented Aug 27, 2024

Very nice! Reorganizing to a tests or test directory sounds good to me as well.

Something also to consider as part of the larger #115 issue is to update the template generator and tooling packages to have and use a shared vitest config as well as update the shared tsconfig to include the vitest

@bucko13
Copy link
Contributor

bucko13 commented Aug 28, 2024

CI seems to be having trouble with this for some reason: https://github.com/caravan-bitcoin/caravan/actions/runs/10584531073/job/29340663941?pr=119

Have you tried running npm run ci locally to see if it's reproducible? I can't see anything obvious in the diff.

@DhairyaMajmudar
Copy link
Author

Very nice! Reorganizing to a tests or test directory sounds good to me as well.

Something also to consider as part of the larger #115 issue is to update the template generator and tooling packages to have and use a shared vitest config as well as update the shared tsconfig to include the vitest

Thank you! yeah keeping a common vitest config file will be a great idea leveraging the power of monorepos : )

@DhairyaMajmudar
Copy link
Author

CI seems to be having trouble with this for some reason: https://github.com/caravan-bitcoin/caravan/actions/runs/10584531073/job/29340663941?pr=119

Have you tried running npm run ci locally to see if it's reproducible? I can't see anything obvious in the diff.

I've run the command in local and while running so I've observed that the process is not getting exit after completion, this might be the reason Github actions got cancelled after a certain time

I think it will be good if we separate the linting, testing and building pipelines, and that too in both package and app folders (If files are changed and package folder/s than CI will run only for that not for app folder/s) this will reduce the GHA execution time.

What are your thoughts on this @bucko13 ?

@bucko13
Copy link
Contributor

bucko13 commented Aug 28, 2024

this might be the reason Github actions got cancelled after a certain time

it actually never canceled! I had to manually run it.

I think it will be good if we separate the linting, testing and building pipelines,

You can try that for sure, but just want to note that the CI is passing in other PRs. It's just this one where it gets stuck.

@DhairyaMajmudar
Copy link
Author

this might be the reason Github actions got cancelled after a certain time

it actually never canceled! I had to manually run it.

I think it will be good if we separate the linting, testing and building pipelines,

You can try that for sure, but just want to note that the CI is passing in other PRs. It's just this one where it gets stuck.

okayyy! I've made minor changes in the test scripts and it seems like now ci is passing.

Copy link
Contributor

@bucko13 bucko13 left a comment

Choose a reason for hiding this comment

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

Nice! Glad it's passing now. Just a couple other small things (which should be reusable for the next rounds/packages!

vitest.config.ts Outdated Show resolved Hide resolved
@DhairyaMajmudar DhairyaMajmudar changed the title [Test]: Jest to Vitest migration caravan-client pacakge [Test]: Jest to Vitest migration caravan-client package Sep 2, 2024
Copy link
Contributor

@bucko13 bucko13 left a comment

Choose a reason for hiding this comment

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

So I started to look at some turborepo examples to reference because I was a little confused since you're not actually using the config anywhere as far as I can see (it's not extended or imported for example). And it looks like maybe it's overkill to do it in this way.

Here is an example from turborepo.

What I was thinking about though you can see in this example from turborepo for eslint where there is a base package and then it's imported and extended in sub packages as they're needed.

Perhaps that's not needed though and everything can share the same base vitest config at the root.

Sorry for the back and forth on this! Just wanting to make sure we get it right while we're in the process of refactoring.

packages/vitest-config/vitest.config.ts Outdated Show resolved Hide resolved
@bucko13
Copy link
Contributor

bucko13 commented Sep 5, 2024

Also, because you applied the import order in the base eslint, then all other packages inherit that rule, and now the lint step is failing. Either we should do those one at a time in the individual child configs and then can move that to the parent when they're all done, or don't add that rule yet and do that in a separate PR separate from the testing changes.

I do like that rule and would like to add it, but I think it increases the scope of these efforts to upgrade testing (many more files in the diff!)

@DhairyaMajmudar
Copy link
Author

DhairyaMajmudar commented Sep 7, 2024

Got your point here @bucko13 #119 (review) let me revert back the changes from the last commit and get back the vitest config file in the root itself.

As of the comment here #119 (comment) yeah, it will be a good decision to open a separate PR for correcting the import orders from the codebase (Let me open one once this PR is merged)

EDIT: I've reverted back the last commit. If it looks good let's merge : )

@bucko13 bucko13 merged commit 070c97d into caravan-bitcoin:vite-migration Sep 10, 2024
4 checks passed
@DhairyaMajmudar DhairyaMajmudar deleted the client-migrate branch September 10, 2024 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants