-
Notifications
You must be signed in to change notification settings - Fork 370
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: [M3-7139] - Enable TypeScript typechecking in Cypress directory #10086
test: [M3-7139] - Enable TypeScript typechecking in Cypress directory #10086
Conversation
Thanks @jdamore-linode! This is exciting. Do you still need help to fix types in here? Happy to jump in in my leisurely time to help with the PR |
… unrestricted users
…` and `active` params are not required
Thanks @abailly-akamai! Just pushed changes that get the typecheck passing, although some of the fixes are pretty ugly and I'd love a second set of eyes on those in case there are opportunities to make things better/safer/etc. (And if you do see anything to improve, you're absolutely welcome to push improvements here) Some examples of questionable fixes:
(Also CCing @bnussman-akamai since he normally advocates for increased type safety and I'd like to hear his opinion) |
@@ -354,7 +354,7 @@ export interface CreateLinodeRequest { | |||
tags?: string[]; | |||
private_ip?: boolean; | |||
authorized_users?: string[]; | |||
interfaces?: Interface[]; | |||
interfaces?: InterfacePayload[]; |
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 want to draw attention to this change in case it's incorrect. Without this change, I encountered type errors in the config test because TypeScript expected id
and active
properties to be specified when creating a Linode with Interfaces via the API SDK's createLinode
function.
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.
Linode API docs show active
in the request payload (after VPC beta), but I have a feeling that it's supposed to be a read-only property? Anyways I think InterfacePayload
is correct and id
definitely shouldn't be in there.
Coverage Report: ✅ |
Wonder if we should add
This might bring up any new type errors as team members are working on the cloud instead of having to run typechecks manually or relying on test failures. |
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.
Nice work on getting types working here, I'm confident this can help prevent some testing bugs in the future.
This is great! 🎉 You may have been use to it @jdamore-linode, but for me it was very frustrating working on the e2es without proper language server help! This is gonna be super nice and help me move faster 🚀
I'm not too stressed about any of the "questionable fixes". I think we can iron those out over time. Regarding what @hkhalil-akamai said about adding I'll continue reviewing and thinking over the changes! |
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.
Thanks @jdamore-linode - this is a great improvement.
Also agree we don't need the --watch as much here, but we can always change our mind
I pushed a few type improvements around any
and type casting which I hope won't break anything!
// }); | ||
// const volume = await createVolume(volumeRequest); | ||
// return [linode, volume]; | ||
// }; |
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.
can we add a comment as to commenting this out?
@bnussman-akamai Interestingly, using Sublime Text with the |
@jdamore-linode Ahh, very interesting. In VSCode it seemed that things were partially working in general. |
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.
Awesome stuff 🚀
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.
Thank you @jdamore-linode Nice work!
Description 📝
This updates the Cypress
tsconfig.json
file to allow typechecking against files in the Cypress directory, and fixes some TypeScript errors.Changes 🔄
List any change relevant to the reviewer.
tsconfig
from Manager'stsconfig
, remove a lot of unneeded configCreateLinodeRequest
interfaces
property to acceptInterfacePayload
objects instead ofInterface
objectsHow to test 🧪
We can lean on the automated tests to make sure the e2e tests themselves aren't broken. I did make a really minor change to
vite.config.ts
, and any issues there should also manifest during the tests, but it might be good to build Cloud and give it a quick look just to make sure there are no unexpected issues.To run typechecking against the Cypress code, you can run this command from within
packages/manager
:As an Author I have considered 🤔
Check all that apply