Skip to content

Commit 5052446

Browse files
authored
[infra] Fix test_types_next, test_react_18, test_react_next jobs (#46182)
1 parent 25fcf0e commit 5052446

File tree

13 files changed

+70
-85
lines changed

13 files changed

+70
-85
lines changed

.circleci/config.yml

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ parameters:
88
description: Whether to force browserstack usage. We have limited resources on browserstack so the pipeline might decide to skip browserstack if this parameter isn't set to true.
99
type: boolean
1010
default: false
11-
react-version:
12-
description: The version of react to be used
13-
type: string
14-
default: stable
1511
workflow:
1612
description: The name of the workflow to run
1713
type: string
@@ -26,7 +22,11 @@ default-job: &default-job
2622
react-version:
2723
description: The version of react to be used
2824
type: string
29-
default: << pipeline.parameters.react-version >>
25+
default: stable
26+
typescript-version:
27+
description: The version of typescript to be used
28+
type: string
29+
default: stable
3030
test-gate:
3131
description: A particular type of tests that should be run
3232
type: string
@@ -39,6 +39,7 @@ default-job: &default-job
3939
# expose it globally otherwise we have to thread it from each job to the install command
4040
BROWSERSTACK_FORCE: << pipeline.parameters.browserstack-force >>
4141
REACT_VERSION: << parameters.react-version >>
42+
TYPESCRIPT_VERSION: << parameters.typescript-version >>
4243
TEST_GATE: << parameters.test-gate >>
4344
AWS_REGION_ARTIFACTS: eu-central-1
4445
COREPACK_ENABLE_DOWNLOAD_PROMPT: '0'
@@ -84,12 +85,13 @@ commands:
8485
steps:
8586
- run:
8687
name: Install pnpm package manager
87-
# See https://stackoverflow.com/a/73411601
88-
command: corepack enable --install-directory ~/bin
88+
command: sudo corepack enable
8989
- run:
9090
name: View install environment
9191
command: |
92+
which node
9293
node --version
94+
which pnpm
9395
pnpm --version
9496
install_js:
9597
parameters:
@@ -100,15 +102,13 @@ commands:
100102
steps:
101103
- setup_corepack:
102104
browsers: << parameters.browsers >>
103-
- run:
104-
name: Resolve React version
105-
command: |
106-
pnpm use-react-version
107-
# log a patch for maintainers who want to check out this change
108-
git --no-pager diff HEAD
109105
- run:
110106
name: Install js dependencies
111107
command: pnpm install
108+
- run:
109+
name: Set version overrides
110+
command: |
111+
pnpm code-infra set-version-overrides --pkg "react@$REACT_VERSION" --pkg "typescript@$TYPESCRIPT_VERSION"
112112
113113
jobs:
114114
test_unit:
@@ -264,44 +264,19 @@ jobs:
264264
steps:
265265
- checkout
266266
- install_js
267-
- run:
268-
name: Resolve typescript version
269-
command: |
270-
pnpm update -r typescript@next
271-
# log a patch for maintainers who want to check out this change
272-
git --no-pager diff HEAD
273267
- run:
274268
name: Tests TypeScript definitions
275-
command: |
276-
# ignore build failures
277-
# it's expected that typescript@next fails since the lines of the errors
278-
# change frequently. This build is monitored regardless of its status
279-
set +e
280-
pnpm typescript:ci
281-
exit 0
282-
- restore_cache:
283-
name: Restore generated declaration files
284-
keys:
285-
# We assume that the target branch is `next` and that declaration files are persisted in commit order.
286-
# "If there are multiple matches, the most recently generated cache will be used."
287-
- typescript-declaration-files-next
269+
command: pnpm typescript:ci
270+
environment:
271+
NODE_OPTIONS: --max-old-space-size=3072
288272
- run:
289-
name: Diff declaration files
273+
name: Build declaration files
290274
command: |
291-
git add -f packages/mui-material/build || echo '/core declarations do not exist'
292-
git add -f packages/mui-lab/build || echo '/lab declarations do not exist'
293-
git add -f packages/mui-utils/build || echo '/utils declarations do not exist'
294-
pnpm -r build:types
295-
git --no-pager diff
275+
pnpm -r build:stable && pnpm -r build:types
296276
- run:
297277
name: Log defect declaration files
298278
command: |
299-
# ignore build failures
300-
# Fixing these takes some effort that isn't viable to merge in a single PR.
301-
# We'll simply monitor them for now.
302-
set +e
303279
node scripts/testBuiltTypes.mjs
304-
exit 0
305280
test_browser:
306281
<<: *default-job
307282
resource_class: 'medium+'
@@ -869,6 +844,14 @@ workflows:
869844
name: test_e2e-react@next
870845

871846
typescript-next:
847+
when:
848+
equal: [typescript-next, << pipeline.parameters.workflow >>]
849+
jobs:
850+
- test_types_next:
851+
<<: *default-context
852+
typescript-version: next
853+
854+
typescript-next-cron:
872855
triggers:
873856
- schedule:
874857
cron: '0 0 * * *'
@@ -881,3 +864,4 @@ workflows:
881864
jobs:
882865
- test_types_next:
883866
<<: *default-context
867+
typescript-version: next

apps/pigment-css-vite-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"@mui/material-pigment-css": "workspace:^",
1616
"@mui/system": "workspace:^",
1717
"@mui/utils": "workspace:^",
18-
"clsx": "^2.1.1",
1918
"@playwright/test": "^1.54.1",
19+
"clsx": "^2.1.1",
2020
"react": "^19.1.0",
2121
"react-dom": "^19.1.0",
2222
"react-error-boundary": "^6.0.0",

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"@mui/material": "workspace:^",
3737
"@mui/styled-engine": "workspace:^",
3838
"@mui/styled-engine-sc": "workspace:^",
39+
"@mui/stylis-plugin-rtl": "workspace:^",
3940
"@mui/system": "workspace:^",
4041
"@mui/types": "workspace:^",
4142
"@mui/utils": "workspace:^",
42-
"@mui/stylis-plugin-rtl": "workspace:^",
4343
"@mui/x-charts": "8.9.0",
4444
"@mui/x-data-grid": "8.9.1",
4545
"@mui/x-data-grid-generator": "8.9.1",
@@ -114,6 +114,7 @@
114114
"@mui/internal-docs-utils": "workspace:^",
115115
"@mui/internal-scripts": "workspace:^",
116116
"@mui/internal-test-utils": "workspace:^",
117+
"@playwright/test": "^1.54.1",
117118
"@types/autosuggest-highlight": "^3.2.3",
118119
"@types/chai": "^4.3.20",
119120
"@types/chance": "^1.1.7",
@@ -134,7 +135,6 @@
134135
"cross-fetch": "^4.1.0",
135136
"gm": "^1.25.1",
136137
"marked": "^15.0.12",
137-
"@playwright/test": "^1.54.1",
138138
"prettier": "^3.6.2",
139139
"tailwindcss": "^4.1.11",
140140
"yargs": "^17.7.2"

docs/pages/material-ui/api/snackbar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"slotProps": {
3737
"type": {
3838
"name": "shape",
39-
"description": "{ clickAwayListener?: func<br>&#124;&nbsp;{ children: element, disableReactTree?: bool, mouseEvent?: 'onClick'<br>&#124;&nbsp;'onMouseDown'<br>&#124;&nbsp;'onMouseUp'<br>&#124;&nbsp;'onPointerDown'<br>&#124;&nbsp;'onPointerUp'<br>&#124;&nbsp;false, onClickAway?: func, touchEvent?: 'onTouchEnd'<br>&#124;&nbsp;'onTouchStart'<br>&#124;&nbsp;false }, content?: func<br>&#124;&nbsp;object, root?: func<br>&#124;&nbsp;object, transition?: func<br>&#124;&nbsp;object }"
39+
"description": "{ clickAwayListener?: func<br>&#124;&nbsp;object, content?: func<br>&#124;&nbsp;object, root?: func<br>&#124;&nbsp;object, transition?: func<br>&#124;&nbsp;object }"
4040
},
4141
"default": "{}"
4242
},

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"test:unit": "nx run nx_test_unit",
8484
"test:argos": "code-infra argos-push --folder test/regressions/screenshots/chrome",
8585
"typescript": "lerna run --no-bail typescript",
86-
"typescript:ci": "lerna run --concurrency 3 --no-bail typescript",
86+
"typescript:ci": "lerna run --concurrency 1 --no-bail typescript",
8787
"use-react-version": "node ./scripts/useReactVersion.mjs",
8888
"validate-declarations": "tsx scripts/validateTypescriptDeclarations.mts",
8989
"generate-codeowners": "node scripts/generateCodeowners.mjs",
@@ -123,7 +123,7 @@
123123
"@mui/internal-babel-plugin-minify-errors": "^2.0.8-canary.3",
124124
"@mui/internal-babel-plugin-resolve-imports": "^2.0.7-canary.11",
125125
"@mui/internal-bundle-size-checker": "^1.0.9-canary.10",
126-
"@mui/internal-code-infra": "0.0.2-canary.23",
126+
"@mui/internal-code-infra": "0.0.2-canary.24",
127127
"@mui/internal-docs-utils": "workspace:^",
128128
"@mui/internal-scripts": "workspace:^",
129129
"@mui/internal-test-utils": "workspace:^",
@@ -187,6 +187,7 @@
187187
"prettier": "^3.6.2",
188188
"pretty-quick": "^4.2.2",
189189
"process": "^0.11.10",
190+
"react": "^19.1.0",
190191
"rimraf": "^6.0.1",
191192
"serve": "^14.2.4",
192193
"stylelint": "^16.22.0",

packages-internal/test-utils/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@
5454
"sinon": "^21.0.0"
5555
},
5656
"devDependencies": {
57+
"@playwright/test": "^1.54.1",
5758
"@types/chai": "^4.3.20",
5859
"@types/chai-dom": "^1.11.3",
5960
"@types/format-util": "^1.0.4",
6061
"@types/prop-types": "^15.7.15",
6162
"@types/react": "^19.1.8",
6263
"@types/react-dom": "^19.1.6",
6364
"@types/sinon": "^17.0.4",
64-
"@playwright/test": "^1.54.1",
6565
"typescript": "^5.8.3"
6666
},
6767
"peerDependencies": {
68+
"@playwright/test": "^1.53.1",
6869
"chai": "^4.5.0 || ^5.0.0",
6970
"react": "^18.0.0 || ^19.0.0",
70-
"react-dom": "^18.0.0 || ^19.0.0",
71-
"@playwright/test": "^1.53.1"
71+
"react-dom": "^18.0.0 || ^19.0.0"
7272
},
7373
"publishConfig": {
7474
"access": "public"

packages/mui-material-pigment-css/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
"@babel/runtime": "^7.28.2",
4242
"@mui/system": "workspace:*"
4343
},
44+
"devDependencies": {
45+
"react": "^19.1.0"
46+
},
4447
"peerDependencies": {
4548
"@pigment-css/react": "^0.0.30"
4649
},

packages/mui-material/src/Snackbar/Snackbar.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -358,24 +358,8 @@ Snackbar.propTypes /* remove-proptypes */ = {
358358
* The props used for each slot inside.
359359
* @default {}
360360
*/
361-
slotProps: PropTypes.shape({
362-
clickAwayListener: PropTypes.oneOfType([
363-
PropTypes.func,
364-
PropTypes.shape({
365-
children: PropTypes.element.isRequired,
366-
disableReactTree: PropTypes.bool,
367-
mouseEvent: PropTypes.oneOf([
368-
'onClick',
369-
'onMouseDown',
370-
'onMouseUp',
371-
'onPointerDown',
372-
'onPointerUp',
373-
false,
374-
]),
375-
onClickAway: PropTypes.func,
376-
touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false]),
377-
}),
378-
]),
361+
slotProps: PropTypes /* @typescript-to-proptypes-ignore */.shape({
362+
clickAwayListener: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
379363
content: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
380364
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
381365
transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),

packages/mui-material/src/TablePaginationActions/TablePaginationActions.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ describe('<TablePaginationActions />', () => {
2222
}
2323
return 'previous';
2424
}}
25+
count={100}
26+
onPageChange={() => {}}
27+
page={1}
28+
rowsPerPage={10}
29+
showFirstButton
30+
showLastButton
2531
/>,
2632
() => ({
2733
inheritComponent: 'div',

packages/mui-material/src/styles/ThemeProviderWithVars.test.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { expect } from 'chai';
3-
import { createRenderer, screen, fireEvent, reactMajor } from '@mui/internal-test-utils';
3+
import { createRenderer, screen, fireEvent } from '@mui/internal-test-utils';
44
import Box from '@mui/material/Box';
55
import {
66
CssVarsProvider,
@@ -470,11 +470,11 @@ describe('[Material UI] ThemeProviderWithVars', () => {
470470
}
471471
const { container } = render(<App />);
472472

473-
expect(container).to.have.text(`${reactMajor >= 19 ? 2 : 1} light`);
473+
expect(container).to.have.text(`2 light`);
474474

475475
fireEvent.click(screen.getByRole('button'));
476476

477-
expect(container).to.have.text(`${reactMajor >= 19 ? 2 : 1} light`);
477+
expect(container).to.have.text(`2 light`);
478478
});
479479

480480
it('palette mode should change if not using CSS variables', () => {
@@ -505,14 +505,12 @@ describe('[Material UI] ThemeProviderWithVars', () => {
505505
}
506506
const { container } = render(<App />);
507507

508-
expect(container).to.have.text(
509-
`${reactMajor >= 19 ? 2 : 1} light ${createTheme().palette.primary.main}`,
510-
);
508+
expect(container).to.have.text(`2 light ${createTheme().palette.primary.main}`);
511509

512510
fireEvent.click(screen.getByRole('button'));
513511

514512
expect(container).to.have.text(
515-
`${reactMajor >= 19 ? 3 : 2} dark ${createTheme({ palette: { mode: 'dark' } }).palette.primary.main}`,
513+
`3 dark ${createTheme({ palette: { mode: 'dark' } }).palette.primary.main}`,
516514
);
517515
});
518516

@@ -544,10 +542,10 @@ describe('[Material UI] ThemeProviderWithVars', () => {
544542
}
545543
const { container } = render(<App />);
546544

547-
expect(container).to.have.text(`${reactMajor >= 19 ? 2 : 1} light`);
545+
expect(container).to.have.text(`2 light`);
548546

549547
fireEvent.click(screen.getByRole('button'));
550548

551-
expect(container).to.have.text(`${reactMajor >= 19 ? 3 : 2} dark`);
549+
expect(container).to.have.text(`3 dark`);
552550
});
553551
});

0 commit comments

Comments
 (0)