-
Notifications
You must be signed in to change notification settings - Fork 297
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
[WIP] Fixes #37752 - Update to Patternfly 5 #11120
base: master
Are you sure you want to change the base?
Conversation
Fixed more tests but not sure what to do about the last 8 failing with this type of error as in some of them I do see the request being mocked in the test
|
8b4bb20
to
d4b0e8b
Compare
@@ -387,6 +389,7 @@ test('Can display create wizard and create simplified ACS', async (done) => { | |||
assertNockRequest(productScope); | |||
assertNockRequest(contentCredentialScope); | |||
assertNockRequest(smartProxyScope); | |||
assertNockRequest(createScope, done); | |||
assertNockRequest(createScope); | |||
done(); |
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.
Think we have the act(done) in the tests to stop further API calls from being recorded and for nocks to get cleaned up..I am not entirely sure we need the done() here..I can try locally..
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.
Running assertNockRequest(X, done);
did not work for tests, I had to change it to:
assertNockRequest(X);
done();
In all of them
This should fix the lint errors:
This leaves only some |
@@ -11,15 +11,15 @@ const EnvironmentLabels = (environments) => { | |||
<React.Fragment key={env.id} style={{ marginBottom: '5px' }}> | |||
<Label | |||
color={labelColor} | |||
isTruncated |
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.
Did isTruncated
get deprecated too?
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.
"Removed the isTruncated property from Label. This is now the default behavior. In addition, you can limit the text width using the new textMaxWidth property."
https://v5-archive.patternfly.org/get-started/upgrade/release-notes
For the conflicts here: webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVReassignActivationKeysForm.js, the branch code is right. For webpack/scenes/ContentViews/Details/Versions/Delete/RemoveSteps/CVVersionRemoveReview.js , The master branch has some logic which needs to be maintained.
|
Fixed the notifications in foreman, and sub tabs in Katello. Also fixed the lint issues, will resolve the conflicts (once laptop will get unstuck 🙃 ) |
Locally, I am seeing only 7 failures, some nock ones and others where react test is failing to read by label text on 2 pages..Looking at those..Not sure what's causing the CI failures here though.. |
CI failures are due to foreman-js pr not being merged/released, so the packages are wrong |
Fixed select2 issue in foreman core |
The dropdown looks good now..Functionally seems to be in a good state..Looking into tests to see if they can be fixed locally.. |
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.
With the foreman-js, foreman PRs, this PR works for Katello components in as much as I tested. The code looks right..The CI errors here are due to dependency and there are some relevant failures when running locally..I'm ok to merge this and get a look at the actual CI errors when the dependencies are resolved and have a follow-up PR for those.
I have the commit with local test fixes but we need to run the CI once to make sure the same tests fail on the CI with PF5.. |
Updating pf4 to pf5
some work is done by running
npx @patternfly/pf-codemods@latest webpack --fix
search& replace "pf-c-" to "pf-v5-c-"
Check all "onChange={[^(]" to make sure that pure pf5 are using the right arguments, as they changed order, and most onChange are onChange(event,value) and not onChange(value)
And adding act wrapper around tests.
To test this pr you will need the foreman core pf5 pr, foreman js pr, link foreman-js, and to remove any foreman-js/patternfly folder in the katello node_modules (as this breaks React shared context in tests).
This is a WIP since the other prs were just done and not polished, and also because some of the tests I had troubles fixing and dont have capacity currently to fix. These tests fail with
Error: Uncaught [Error: Warning: An update to %s inside a test was not wrapped in act(...)
even if every line in the test is wrapped in act, or