Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Nov 7, 2024

Q A
Bug fix? no
New feature? no
Issues Fix #...
License MIT

Added two new internal features to the test process:

  1. We now check for peerDependencies.* and symfony.importmap.* homogeneity, that was pretty useful before, when versions were altered without being restored when running yarn test. It's in fact less necessary due to the 2nd feature:
➜  assets git:(test-improvments-versions) ✗ yarn test                       
Processing workspace @symfony/ux-chartjs at location /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets...

Checking '/Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets/package.json' for peerDependencies and importmap dependencies to have the same version
 -> Version mismatch for chart.js: ^4.0 (peerDependencies) vs ^3.4.1 || ^4.0 (importmap)
 -> You need to match the version of the "peerDependency" with the version in the "importmap"

  1. We now cleanup changes when a peerDependency changed because it has multiple versions, this allows us to keep a clean package.json and yarn.lock, and so a clean project state:
➜  assets git:(test-improvments-versions) yarn test
Processing workspace @symfony/ux-chartjs at location /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets...

Checking '/Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets/package.json' for peerDependencies and importmap dependencies to have the same version
Checking '/Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets/package.json' for peerDependencies with multiple versions defined
 -> Multiple versions found for peerDependencies: chart.js
  - Install chart.js@^3.4.1 for @symfony/ux-chartjs

➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ rollup is listed by your project with version 4.22.5 (pf8256), which doesn't satisfy what @rollup/pluginutils (via @rollup/plugin-commonjs) and other dependencies request (^2.78.0 || ^3.0.0).
➤ YN0002: │ @symfony/ux-autocomplete@workspace:src/Autocomplete/assets doesn't provide vitest (pc8205), requested by vitest-fetch-mock.
➤ YN0002: │ @symfony/ux-chartjs@workspace:src/Chartjs/assets doesn't provide vitest (pccf90), requested by vitest-canvas-mock.
➤ YN0002: │ @symfony/ux-react@workspace:src/React/assets doesn't provide vite (pbe8ce), requested by @vitejs/plugin-react.
➤ YN0002: │ @symfony/ux-svelte@workspace:src/Svelte/assets doesn't provide vite (pf0478), requested by @sveltejs/vite-plugin-svelte.
➤ YN0002: │ @symfony/ux-vue@workspace:src/Vue/assets doesn't provide vite (p99573), requested by @vitejs/plugin-vue.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 268ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 666ms
Running tests for @symfony/ux-chartjs...


 RUN  v2.1.1 /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets

 ✓ test/controller.test.ts (5)
   ✓ ChartjsController (5)
     ✓ connect without options
     ✓ connect with options
     ✓ will update when the view data changes
     ✓ will update when the view data changes without options
     ✓ dispatches the events correctly

 Test Files  1 passed (1)
      Tests  5 passed (5)
   Start at  10:21:45
   Duration  1.13s (transform 51ms, setup 93ms, collect 205ms, tests 114ms, environment 480ms, prepare 63ms)

  - Install chart.js@^4.0 for @symfony/ux-chartjs

➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ rollup is listed by your project with version 4.22.5 (pf8256), which doesn't satisfy what @rollup/pluginutils (via @rollup/plugin-commonjs) and other dependencies request (^2.78.0 || ^3.0.0).
➤ YN0002: │ @symfony/ux-autocomplete@workspace:src/Autocomplete/assets doesn't provide vitest (pc8205), requested by vitest-fetch-mock.
➤ YN0002: │ @symfony/ux-chartjs@workspace:src/Chartjs/assets doesn't provide vitest (pccf90), requested by vitest-canvas-mock.
➤ YN0002: │ @symfony/ux-react@workspace:src/React/assets doesn't provide vite (pbe8ce), requested by @vitejs/plugin-react.
➤ YN0002: │ @symfony/ux-svelte@workspace:src/Svelte/assets doesn't provide vite (pf0478), requested by @sveltejs/vite-plugin-svelte.
➤ YN0002: │ @symfony/ux-vue@workspace:src/Vue/assets doesn't provide vite (p99573), requested by @vitejs/plugin-vue.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 259ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 664ms
Running tests for @symfony/ux-chartjs...


 RUN  v2.1.1 /Users/kocal/workspace-os/symfony-ux/src/Chartjs/assets

 ✓ test/controller.test.ts (5)
   ✓ ChartjsController (5)
     ✓ connect without options
     ✓ connect with options
     ✓ will update when the view data changes
     ✓ will update when the view data changes without options
     ✓ dispatches the events correctly

 Test Files  1 passed (1)
      Tests  5 passed (5)
   Start at  10:21:48
   Duration  757ms (transform 49ms, setup 69ms, collect 149ms, tests 114ms, environment 221ms, prepare 62ms)

 -> Reverting version changes for chart.js
➤ YN0000: · Yarn 4.5.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ rollup is listed by your project with version 4.22.5 (pf8256), which doesn't satisfy what @rollup/pluginutils (via @rollup/plugin-commonjs) and other dependencies request (^2.78.0 || ^3.0.0).
➤ YN0002: │ @symfony/ux-autocomplete@workspace:src/Autocomplete/assets doesn't provide vitest (pc8205), requested by vitest-fetch-mock.
➤ YN0002: │ @symfony/ux-chartjs@workspace:src/Chartjs/assets doesn't provide vitest (pccf90), requested by vitest-canvas-mock.
➤ YN0002: │ @symfony/ux-react@workspace:src/React/assets doesn't provide vite (pbe8ce), requested by @vitejs/plugin-react.
➤ YN0002: │ @symfony/ux-svelte@workspace:src/Svelte/assets doesn't provide vite (pf0478), requested by @sveltejs/vite-plugin-svelte.
➤ YN0002: │ @symfony/ux-vue@workspace:src/Vue/assets doesn't provide vite (p99573), requested by @vitejs/plugin-vue.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 259ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done with warnings in 0s 665ms
All tests passed!

…nup changes when a peerDependency changed because multiple versions
@carsonbot carsonbot added Bug Bug Fix Feature New Feature Status: Needs Review Needs to be reviewed labels Nov 7, 2024
@Kocal Kocal changed the title [Test] Some improvements for dependencies management when testing [DX] Some improvements for dependencies management when testing Nov 7, 2024
@Kocal Kocal added DX and removed Bug Bug Fix Feature New Feature labels Nov 7, 2024
@Kocal Kocal requested review from kbond, smnandre and WebMamba November 7, 2024 09:28
Copy link
Member

@smnandre smnandre left a comment

Choose a reason for hiding this comment

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

✅ Perfect!

 ux git:(test-improvments-versions) yarn test 
 
 [...]
 
 ux git:(test-improvments-versions) git st             

 rien à valider, la copie de travail est propre

➜  ux git:(test-improvments-versions) 

Thank you @Kocal ! 🙇

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Nov 7, 2024
@Kocal Kocal merged commit 78d243e into symfony:2.x Nov 7, 2024
55 of 56 checks passed
@Kocal Kocal deleted the test-improvments-versions branch November 7, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants