Skip to content

Conversation

@lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Jan 10, 2025

We spoke about this and I need some amount of structure in place before we add the autoupdate tests. Would be nice to try and get it out of the way ahead of time so we don't have unnecessary merge conflicts.

This reduces the amount of parameters it takes considerably while still fitting in with our evergreen setup. The parameters we're left with are modelled after how hadron-build info works so we can still use that to calculate all the metadata we need, especially the relevant filenames. It should be a little bit simpler to use / work in locally too.

There's also a one-to-one relation between the script being invoked and which "package" (ie. osx_dmg) gets tested. I think it simplifies things a bit and makes it a bit simpler to work on locally.

run_on: 'ubuntu2004-large',
depends_on: 'package-ubuntu',
},
// {
Copy link
Contributor Author

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.

eval $(.evergreen/print-compass-env.sh)
if [[ "$IS_WINDOWS" == "true" ]]; then
// TODO: windows_setup
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could also just call the smoketest script for each of these TODOs now already because it will only be executed for mac. We'd just have to leave osx_zip out for now.

.option('package', {
type: 'string',
choices: [
'windows_setup',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are based on the naming convention in hadron-build. ie. in theory you can just do ${context.package}_filename to look up the filename for each of them.

'linux_deb',
'linux_tar',
'linux_rpm',
'rhel_tar',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that the redhat tarball is not named quite like the others because that's how it is inside hadron build already.

});

type SmokeTestsContext = ReturnType<typeof argv['parseSync']>;
type SmokeTestsContext = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better way to infer this type from the yargs setup somehow?

| { filename: string; installer: Installer; updatable: boolean }
| undefined = undefined;

if (context.package === 'windows_setup') {
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 could also be a giant switch case or a hashmap to map these things or pluggable or.. I don't personally have a preference.

@lerouxb lerouxb marked this pull request as ready for review January 10, 2025 14:10
@lerouxb lerouxb changed the title chore(e2e): refactor smoke-test.ts structure chore(e2e): refactor smoke-test.ts structure COMPASS-8795 Jan 10, 2025
@lerouxb lerouxb requested a review from kraenhansen January 10, 2025 15:46
Copy link
Contributor

@kraenhansen kraenhansen left a comment

Choose a reason for hiding this comment

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

Great stuff 👍

Co-authored-by: Kræn Hansen <kraen.hansen@mongodb.com>
lerouxb and others added 6 commits January 13, 2025 12:30
Co-authored-by: Kræn Hansen <kraen.hansen@mongodb.com>
Co-authored-by: Kræn Hansen <kraen.hansen@mongodb.com>
Co-authored-by: Kræn Hansen <kraen.hansen@mongodb.com>
Co-authored-by: Kræn Hansen <kraen.hansen@mongodb.com>
Co-authored-by: Kræn Hansen <kraen.hansen@mongodb.com>
@lerouxb lerouxb merged commit c6af6bf into main Jan 13, 2025
5 of 6 checks passed
@lerouxb lerouxb deleted the refactor-smoktest-structure branch January 13, 2025 13:07
@lerouxb lerouxb restored the refactor-smoktest-structure branch January 13, 2025 13:07
@lerouxb lerouxb deleted the refactor-smoktest-structure branch January 13, 2025 13:07
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.

3 participants