-
Notifications
You must be signed in to change notification settings - Fork 244
chore(e2e): refactor smoke-test.ts structure COMPASS-8795 #6602
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1dd3ac8
refactor smoke-test.ts structure
lerouxb 4c8ac8a
might help if I use bash comments in a bash script
lerouxb 96f2856
more uncommenting
lerouxb 4a6e2d3
Update packages/compass-e2e-tests/installers/mac-dmg.ts
lerouxb 92630b4
Update packages/compass-e2e-tests/helpers/buildinfo.ts
lerouxb 56c1153
Update packages/compass-e2e-tests/helpers/buildinfo.ts
lerouxb 0888f6c
Update packages/compass-e2e-tests/helpers/buildinfo.ts
lerouxb 4b928e0
Update packages/compass-e2e-tests/helpers/buildinfo.ts
lerouxb 50e565b
Update packages/compass-e2e-tests/helpers/buildinfo.ts
lerouxb 4b7fb81
prettier
lerouxb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import assert from 'node:assert/strict'; | ||
|
|
||
| // subsets of the hadron-build info result | ||
|
|
||
| const commonKeys = ['productName']; | ||
| type CommonBuildInfo = Record<typeof commonKeys[number], string>; | ||
|
|
||
| function assertObjectHasKeys( | ||
| obj: unknown, | ||
| name: string, | ||
| keys: readonly string[] | ||
| ) { | ||
| assert( | ||
| typeof obj === 'object' && obj !== null, | ||
| 'Expected buildInfo to be an object' | ||
| ); | ||
|
|
||
| for (const key of keys) { | ||
| assert(key in obj, `Expected '${name}' to have '${key}'`); | ||
| } | ||
| } | ||
|
|
||
| export function assertCommonBuildInfo( | ||
| buildInfo: unknown | ||
| ): asserts buildInfo is CommonBuildInfo { | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); | ||
| } | ||
|
|
||
| const windowsFilenameKeys = [ | ||
| 'windows_setup_filename', | ||
| 'windows_msi_filename', | ||
| 'windows_zip_filename', | ||
| 'windows_nupkg_full_filename', | ||
| ] as const; | ||
| type WindowsBuildInfo = CommonBuildInfo & | ||
| Record<typeof windowsFilenameKeys[number], string>; | ||
|
|
||
| const osxFilenameKeys = ['osx_dmg_filename', 'osx_zip_filename'] as const; | ||
| type OSXBuildInfo = CommonBuildInfo & | ||
| Record<typeof osxFilenameKeys[number], string>; | ||
|
|
||
| const ubuntuFilenameKeys = [ | ||
| 'linux_deb_filename', | ||
| 'linux_tar_filename', | ||
| ] as const; | ||
| type UbuntuBuildInfo = CommonBuildInfo & | ||
| Record<typeof ubuntuFilenameKeys[number], string>; | ||
|
|
||
| const rhelFilenameKeys = ['linux_rpm_filename', 'rhel_tar_filename'] as const; | ||
| type RHELBuildInfo = CommonBuildInfo & | ||
| Record<typeof rhelFilenameKeys[number], string>; | ||
|
|
||
| export function assertBuildInfoIsWindows( | ||
| buildInfo: unknown | ||
| ): asserts buildInfo is WindowsBuildInfo { | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', windowsFilenameKeys); | ||
| } | ||
|
|
||
| export function assertBuildInfoIsOSX( | ||
| buildInfo: unknown | ||
| ): asserts buildInfo is OSXBuildInfo { | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', osxFilenameKeys); | ||
| } | ||
|
|
||
| export function assertBuildInfoIsUbuntu( | ||
| buildInfo: unknown | ||
| ): buildInfo is UbuntuBuildInfo { | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', ubuntuFilenameKeys); | ||
| return true; | ||
| } | ||
|
|
||
| export function assertBuildInfoIsRHEL( | ||
| buildInfo: unknown | ||
| ): asserts buildInfo is RHELBuildInfo { | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', commonKeys); | ||
| assertObjectHasKeys(buildInfo, 'buildInfo', rhelFilenameKeys); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,19 @@ | ||
| export type Installer = (pkg: InstallablePackage) => Promise<InstalledAppInfo>; | ||
|
|
||
| export type Package = { | ||
| filename: string; | ||
| appName: string; | ||
| packageFilepath: string; | ||
| // TODO: once we can download the most recent release | ||
| //releaseFilepath: string; | ||
| installer: Installer; | ||
| }; | ||
|
|
||
| export type InstallablePackage = { | ||
| appName: string; | ||
| filepath: string; | ||
| }; | ||
|
|
||
| export type InstalledAppInfo = { | ||
| appName: string; | ||
| appPath: string; | ||
| uninstall: () => Promise<void>; | ||
| }; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Doing nothing will just fail now if we ever call smoke-test.ts. But we also won't call it until we update functions.yml to call it. So this is just wasteful in the meantime.