From 93f307b7359b474ff5623c42e05c04834145ce30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dudak?= Date: Mon, 29 Jan 2024 19:48:00 +0100 Subject: [PATCH] [test] Speed up the envinfo test (#40669) --- packages/mui-envinfo/envinfo.test.js | 42 ++----- packages/mui-envinfo/test/package.json | 7 +- pnpm-lock.yaml | 151 +++++++++++++++++++------ pnpm-workspace.yaml | 2 +- 4 files changed, 131 insertions(+), 71 deletions(-) diff --git a/packages/mui-envinfo/envinfo.test.js b/packages/mui-envinfo/envinfo.test.js index 41209a3557cf83..1367c58eb72991 100644 --- a/packages/mui-envinfo/envinfo.test.js +++ b/packages/mui-envinfo/envinfo.test.js @@ -2,48 +2,24 @@ const { execFileSync } = require('child_process'); const path = require('path'); const { expect } = require('chai'); -const isRunningOnWindows = process.platform === 'win32'; - describe('@mui/envinfo', () => { const packagePath = __dirname; const testProjectPath = path.resolve(packagePath, 'test'); - before(function beforeHook() { - // only run in node - if (!/jsdom/.test(window.navigator.userAgent)) { - this.skip(); - } - - // Building might take some time - this.timeout(20000); - execFileSync('pnpm', ['build'], { - cwd: packagePath, + function execEnvinfo(args) { + const envinfoPath = path.resolve(packagePath, 'envinfo.js'); + return execFileSync('node', [envinfoPath, ...args], { + encoding: 'utf8', stdio: 'pipe', - }); - - execFileSync('npm', ['install'], { cwd: testProjectPath, - stdio: 'pipe', }); - }); - - function execEnvinfo(args) { - const buildPath = path.resolve(packagePath, 'build'); - - return execFileSync( - isRunningOnWindows ? 'npx.cmd' : 'npx', - ['--package', buildPath, 'envinfo', ...args], - { - encoding: 'utf8', - stdio: 'pipe', - cwd: testProjectPath, - }, - ); } it('includes info about the environment relevant to MUI', function test() { - // Need more time to download packages - this.timeout(20000); + // only run in node + if (!/jsdom/.test(window.navigator.userAgent)) { + this.skip(); + } const envinfoJSON = execEnvinfo(['--json']); @@ -60,7 +36,7 @@ describe('@mui/envinfo', () => { // Non-exhaustive list of `@mui/*` packages expect(envinfo).to.have.nested.property('npmPackages.@mui/material'); expect(envinfo).to.have.nested.property('npmPackages.@mui/joy'); - expect(envinfo).to.have.nested.property('npmPackages.@mui/utils'); + expect(envinfo).to.have.nested.property('npmPackages.@mui/base'); // Other libraries expect(envinfo).to.have.nested.property('npmPackages.react'); expect(envinfo).to.have.nested.property('npmPackages.react-dom'); diff --git a/packages/mui-envinfo/test/package.json b/packages/mui-envinfo/test/package.json index e6344c6f7bab2d..c4a6938fa98f5f 100644 --- a/packages/mui-envinfo/test/package.json +++ b/packages/mui-envinfo/test/package.json @@ -1,12 +1,13 @@ { - "name": "test-project", + "name": "envinfo-test-project", "version": "1.0.0", "private": true, "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", - "@mui/material": "^5.15.6", - "@mui/joy": "^5.0.0-beta.24", + "@mui/base": "5.0.0-beta.30", + "@mui/joy": "5.0.0-beta.22", + "@mui/material": "5.15.4", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6ae029f50956a4..aa78bcd5868b9b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1273,6 +1273,34 @@ importers: specifier: ^11.2.0 version: 11.2.0 + packages/mui-envinfo/test: + dependencies: + '@emotion/react': + specifier: ^11.11.3 + version: 11.11.3(@types/react@18.2.48)(react@18.2.0) + '@emotion/styled': + specifier: ^11.11.0 + version: 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.48)(react@18.2.0) + '@mui/base': + specifier: 5.0.0-beta.30 + version: 5.0.0-beta.30(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + '@mui/joy': + specifier: 5.0.0-beta.22 + version: 5.0.0-beta.22(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + '@mui/material': + specifier: 5.15.4 + version: 5.15.4(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + react: + specifier: ^18.2.0 + version: 18.2.0 + react-dom: + specifier: ^18.2.0 + version: 18.2.0(react@18.2.0) + devDependencies: + '@types/react': + specifier: ^18.2.48 + version: 18.2.48 + packages/mui-icons-material: dependencies: '@babel/runtime': @@ -5229,8 +5257,31 @@ packages: dependencies: '@babel/runtime': 7.23.9 '@floating-ui/react-dom': 2.0.8(react-dom@18.2.0)(react@18.2.0) - '@mui/types': 7.2.12(@types/react@18.2.48) - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.48) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) + '@popperjs/core': 2.11.8 + '@types/react': 18.2.48 + clsx: 2.1.0 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: false + + /@mui/base@5.0.0-beta.31(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-+uNbP3OHJuZVI00WyMg7xfLZotaEY7LgvYXDfONVJbrS+K9wyjCIPNfjy8r9XJn4fbHo/5ibiZqjWnU9LMNv+A==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@types/react': ^18.2.48 + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.23.9 + '@floating-ui/react-dom': 2.0.8(react-dom@18.2.0)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.48) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@popperjs/core': 2.11.8 '@types/react': 18.2.48 clsx: 2.1.0 @@ -5239,12 +5290,12 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/core-downloads-tracker@5.15.3: - resolution: {integrity: sha512-sWeihiVyxdJjpLkp8SHkTy9kt2M/o11M60G1MzwljGL2BXdM3Ktzqv5QaQHdi00y7Y1ulvtI3GOSxP2xU8mQJw==} + /@mui/core-downloads-tracker@5.15.6: + resolution: {integrity: sha512-0aoWS4qvk1uzm9JBs83oQmIMIQeTBUeqqu8u+3uo2tMznrB5fIKqQVCbCgq+4Tm4jG+5F7dIvnjvQ2aV7UKtdw==} dev: false - /@mui/material@5.15.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-DODBBMouyq1B5f3YkEWL9vO8pGCxuEGqtfpltF6peMJzz/78tJFyLQsDas9MNLC/8AdFu2BQdkK7wox5UBPTAA==} + /@mui/joy@5.0.0-beta.22(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-XFJd/cWXqt9MMlaUh10QQH893YaRw2CORYRhQovXvaJk7mmt/Sc4q3Fb7ANCXf4xMUPdwqdnvawLkAOAKVHuXg==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -5263,11 +5314,43 @@ packages: '@babel/runtime': 7.23.9 '@emotion/react': 11.11.3(@types/react@18.2.48)(react@18.2.0) '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.48)(react@18.2.0) - '@mui/base': 5.0.0-beta.30(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) - '@mui/core-downloads-tracker': 5.15.3 - '@mui/system': 5.15.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react@18.2.0) - '@mui/types': 7.2.12(@types/react@18.2.48) - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/base': 5.0.0-beta.31(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.15.6 + '@mui/system': 5.15.6(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.48) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) + '@types/react': 18.2.48 + clsx: 2.1.0 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: false + + /@mui/material@5.15.4(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-T/LGRAC+M0c+D3+y67eHwIN5bSje0TxbcJCWR0esNvU11T0QwrX3jedXItPNBwMupF2F5VWCDHBVLlFnN3+ABA==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@emotion/react': ^11.5.0 + '@emotion/styled': ^11.3.0 + '@types/react': ^18.2.48 + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@emotion/react': + optional: true + '@emotion/styled': + optional: true + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.23.9 + '@emotion/react': 11.11.3(@types/react@18.2.48)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.48)(react@18.2.0) + '@mui/base': 5.0.0-beta.31(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.15.6 + '@mui/system': 5.15.6(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.48) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@types/react': 18.2.48 '@types/react-transition-group': 4.4.10 clsx: 2.1.0 @@ -5279,8 +5362,8 @@ packages: react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0) dev: false - /@mui/private-theming@5.15.3(@types/react@18.2.48)(react@18.2.0): - resolution: {integrity: sha512-Q79MhVMmywC1l5bMsMZq5PsIudr1MNPJnx9/EqdMP0vpz5iNvFpnLmxsD7d8/hqTWgFAljI+LH3jX8MxlZH9Gw==} + /@mui/private-theming@5.15.6(@types/react@18.2.48)(react@18.2.0): + resolution: {integrity: sha512-ZBX9E6VNUSscUOtU8uU462VvpvBS7eFl5VfxAzTRVQBHflzL+5KtnGrebgf6Nd6cdvxa1o0OomiaxSKoN2XDmg==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^18.2.48 @@ -5290,14 +5373,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.9 - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@types/react': 18.2.48 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/styled-engine@5.15.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0): - resolution: {integrity: sha512-+d5XZCTeemOO/vBfWGEeHgTm8fjU1Psdgm+xAw+uegycO2EnoA/EfGSaG5UwZ6g3b66y48Mkxi35AggShMr88w==} + /@mui/styled-engine@5.15.6(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0): + resolution: {integrity: sha512-KAn8P8xP/WigFKMlEYUpU9z2o7jJnv0BG28Qu1dhNQVutsLVIFdRf5Nb+0ijp2qgtcmygQ0FtfRuXv5LYetZTg==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.4.1 @@ -5318,8 +5401,8 @@ packages: react: 18.2.0 dev: false - /@mui/system@5.15.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react@18.2.0): - resolution: {integrity: sha512-ewVU4eRgo4VfNMGpO61cKlfWmH7l9s6rA8EknRzuMX3DbSLfmtW2WJJg6qPwragvpPIir0Pp/AdWVSDhyNy5Tw==} + /@mui/system@5.15.6(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react@18.2.0): + resolution: {integrity: sha512-J01D//u8IfXvaEHMBQX5aO2l7Q+P15nt96c4NskX7yp5/+UuZP8XCQJhtBtLuj+M2LLyXHYGmCPeblsmmscP2Q==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -5337,10 +5420,10 @@ packages: '@babel/runtime': 7.23.9 '@emotion/react': 11.11.3(@types/react@18.2.48)(react@18.2.0) '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.48)(react@18.2.0) - '@mui/private-theming': 5.15.3(@types/react@18.2.48)(react@18.2.0) - '@mui/styled-engine': 5.15.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0) - '@mui/types': 7.2.12(@types/react@18.2.48) - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/private-theming': 5.15.6(@types/react@18.2.48)(react@18.2.0) + '@mui/styled-engine': 5.15.6(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.48) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@types/react': 18.2.48 clsx: 2.1.0 csstype: 3.1.2 @@ -5348,8 +5431,8 @@ packages: react: 18.2.0 dev: false - /@mui/types@7.2.12(@types/react@18.2.48): - resolution: {integrity: sha512-3kaHiNm9khCAo0pVe0RenketDSFoZGAlVZ4zDjB/QNZV0XiCj+sh1zkX0VVhQPgYJDlBEzAag+MHJ1tU3vf0Zw==} + /@mui/types@7.2.13(@types/react@18.2.48): + resolution: {integrity: sha512-qP9OgacN62s+l8rdDhSFRe05HWtLLJ5TGclC9I1+tQngbssu0m2dmFZs+Px53AcOs9fD7TbYd4gc9AXzVqO/+g==} peerDependencies: '@types/react': ^18.2.48 peerDependenciesMeta: @@ -5359,8 +5442,8 @@ packages: '@types/react': 18.2.48 dev: false - /@mui/utils@5.15.3(@types/react@18.2.48)(react@18.2.0): - resolution: {integrity: sha512-mT3LiSt9tZWCdx1pl7q4Q5tNo6gdZbvJel286ZHGuj6LQQXjWNAh8qiF9d+LogvNUI+D7eLkTnj605d1zoazfg==} + /@mui/utils@5.15.6(@types/react@18.2.48)(react@18.2.0): + resolution: {integrity: sha512-qfEhf+zfU9aQdbzo1qrSWlbPQhH1nCgeYgwhOVnj9Bn39shJQitEnXpSQpSNag8+uty5Od6PxmlNKPTnPySRKA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^18.2.48 @@ -5447,7 +5530,7 @@ packages: '@babel/runtime': 7.23.9 '@mui/material': link:packages/mui-material/build '@mui/system': link:packages/mui-system/build - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@mui/x-data-grid': 6.19.2(@mui/material@packages+mui-material+build)(@mui/system@packages+mui-system+build)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) '@mui/x-data-grid-pro': 6.19.2(@mui/material@packages+mui-material+build)(@mui/system@packages+mui-system+build)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) '@mui/x-license-pro': 6.10.2(@types/react@18.2.48)(react@18.2.0) @@ -5474,7 +5557,7 @@ packages: '@babel/runtime': 7.23.9 '@mui/material': link:packages/mui-material/build '@mui/system': link:packages/mui-system/build - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@mui/x-data-grid': 6.19.2(@mui/material@packages+mui-material+build)(@mui/system@packages+mui-system+build)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) '@mui/x-license-pro': 6.10.2(@types/react@18.2.48)(react@18.2.0) '@types/format-util': 1.0.4 @@ -5499,7 +5582,7 @@ packages: '@babel/runtime': 7.23.9 '@mui/material': link:packages/mui-material/build '@mui/system': link:packages/mui-system/build - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) clsx: 2.1.0 prop-types: 15.8.1 react: 18.2.0 @@ -5552,7 +5635,7 @@ packages: '@mui/base': 5.0.0-beta.30(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) '@mui/material': link:packages/mui-material/build '@mui/system': link:packages/mui-system/build - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@mui/x-date-pickers': 6.19.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@mui/material@packages+mui-material+build)(@mui/system@packages+mui-system+build)(@types/react@18.2.48)(date-fns-jalali@2.21.3-1)(date-fns@2.30.0)(react-dom@18.2.0)(react@18.2.0) '@mui/x-license-pro': 6.10.2(@types/react@18.2.48)(react@18.2.0) clsx: 2.1.0 @@ -5609,7 +5692,7 @@ packages: '@mui/base': 5.0.0-beta.30(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) '@mui/material': link:packages/mui-material/build '@mui/system': link:packages/mui-system/build - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@types/react-transition-group': 4.4.10 clsx: 2.1.0 date-fns: 2.30.0 @@ -5629,7 +5712,7 @@ packages: react: ^17.0.0 || ^18.0.0 dependencies: '@babel/runtime': 7.23.9 - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) react: 18.2.0 transitivePeerDependencies: - '@types/react' @@ -5652,7 +5735,7 @@ packages: '@mui/base': 5.0.0-beta.30(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) '@mui/material': link:packages/mui-material/build '@mui/system': link:packages/mui-system/build - '@mui/utils': 5.15.3(@types/react@18.2.48)(react@18.2.0) + '@mui/utils': 5.15.6(@types/react@18.2.48)(react@18.2.0) '@types/react-transition-group': 4.4.10 clsx: 2.1.0 prop-types: 15.8.1 @@ -15531,7 +15614,7 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: '@babel/runtime': 7.23.9 - '@mui/material': 5.15.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) + '@mui/material': 5.15.4(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.48)(react-dom@18.2.0)(react@18.2.0) classnames: 2.3.2 prop-types: 15.8.1 react: 18.2.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c341679f07bae9..7381846dd1bbab 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,7 +1,7 @@ packages: - 'benchmark' - 'packages/*' - - '!packages/mui-envinfo/test' + - 'packages/mui-envinfo/test' - 'docs' - 'test' - 'apps/*'