-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat: download and test with the latest release #6638
Conversation
| 'linux_deb' | ||
| 'linux_rpm'; | ||
|
||
function getPlatformShortName( |
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 URL for downloading the latest release ends in things like osx, darwin-arm64, darwin-x64, windows, linux_dev or linux_rpm. This just calculates that bit. I'm calling it a "platform short name" until we think of something better.
}); | ||
|
||
try { | ||
runTest({ appName, appPath }); |
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.
Again: This should actually see if you can update from this version. I'm just including it as a kind of sanity check that releasepath works.
|
||
export function assertCommonBuildInfo( | ||
buildInfo: unknown | ||
): asserts buildInfo is CommonBuildInfo { | ||
assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); | ||
assert( | ||
SUPPORTED_CHANNELS.includes((buildInfo as any).channel), |
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 is probably the easiest. It's a bit annoying that Array#includes
doesn't simply take an unknown
, but .. there are reasons.
SUPPORTED_CHANNELS.includes((buildInfo as any).channel), | |
SUPPORTED_CHANNELS.includes((buildInfo as unknown as Channel).channel), |
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.
buildInfo isn't a channel, though. it has a channel. And it is already unknown.
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.
Something like:
export function assertCommonBuildInfo(
buildInfo: unknown
): asserts buildInfo is CommonBuildInfo {
assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys);
assert(
SUPPORTED_CHANNELS.includes((buildInfo as { channel: Channel }).channel),
`Expected ${
(buildInfo as { channel: Channel }).channel
} to be in ${SUPPORTED_CHANNELS.join(',')}`
);
}
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.
Could you use assertObjectHasKeys
to make sure buildInfo
has the channel
property? 🤔
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.
Already did. I added channel to commonKeys.
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.
Then why the (buildInfo as { channel: Channel }).channel
? 🤔
Could that be buildInfo.channel as Channel
instead?
Co-authored-by: Kræn Hansen <[email protected]>
Co-authored-by: Kræn Hansen <[email protected]>
Closing in favour of #6669 |
Still a work in progress because this should test that it will upgrade to the new package. Right now it is just running an e2e test against the latest release for the relevant channel.
I'm just opening this draft early to get some feedback.