-
Notifications
You must be signed in to change notification settings - Fork 93
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
fix(upgrade-service): allow no preflights and no config #4942
fix(upgrade-service): allow no preflights and no config #4942
Conversation
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.
just two little linter errors! Great work Joao!
lint-web has a few failures - any reason those can't be fixed? |
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 see a unit test for info API call, but not one for validating that the UI shows what's expected based on the values of hasPreflight
and isConfigurable
.
9f7b297
to
d37f4ed
Compare
"testEnvironmentOptions": { | ||
"customExportConditions": [ | ||
"" | ||
] | ||
}, |
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.
import "intersection-observer"; | ||
import "@testing-library/jest-dom"; |
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.
There's a whole set of things which aren't pollyfilled by jsdom which is what the @testing-library/jest-dom is for. We also need to pollyfill the intersection-observer for the AppConfig component to render.
Ok, after fighting a lot with |
</MemoryRouter> | ||
); | ||
|
||
await findByTestId("preflight-check-area"); |
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.
is this right? should this be available if preflights are not available?
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.
Ah nice catch, thanks! This doesn't make sense though, there's something in the tests that's leading to this behaviour because if I it.only
this test it fails as expected, if I run the whole file it passes 🙃 need to debug this further tomorrow 😩 I wonder if it's something to do with the http interception.
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.
Managed to reproduce the failure locally while running the full harness of tests, turns out the state of the interceptors wasn't being correctly reset. I've also created different slugs per test to ensure we have fully decoupled setup processes (and prevent stuff like this in the future), fixed via - 84eb952
What this PR does / why we need it:
This PR fixes the upgrade flow for when an upgrade doesn't have config or preflight checks (the shortcut story has a video which illustrates the whole flow).
Which issue(s) this PR fixes:
https://app.shortcut.com/replicated/story/113259/new-upgrade-workflow-doesn-t-work-if-there-is-no-config
https://app.shortcut.com/replicated/story/113787/upgrade-workflow-doesn-t-work-if-you-don-t-have-preflights
Does this PR require a test?
Yes, I'll be looking into adding a playwright test to the EC repo.
Does this PR require a release note?
Does this PR require documentation?
NONE