Skip to content
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

Skip building vite assets in tests if possible #51

Merged
merged 2 commits into from Apr 10, 2024
Merged

Skip building vite assets in tests if possible #51

merged 2 commits into from Apr 10, 2024

Conversation

mattbrictson
Copy link
Owner

@mattbrictson mattbrictson commented Mar 31, 2024

Previously, the presence of vite.rb in test/support/ meant that Vite assets would be eagerly built whenever any type of test was run. When running a model test, for example, this would lead to unnecessarily slow test startup time.

What we want is to compile Vite assets before system tests, and before helper tests that specifically expect compiled assets.

Implement this by moving the Vite compilation logic to test/vite_helper.rb. Tests can now explicitly require "vite_helper" if they require compiled assets.

Add require "vite_helper" to application_system_test_case.rb so that system tests always have compiled assets.

@mattbrictson mattbrictson added ✨ Feature Adds a new feature automerge Automatically merge PR once all required checks pass and removed automerge Automatically merge PR once all required checks pass labels Mar 31, 2024
@mattbrictson mattbrictson marked this pull request as draft March 31, 2024 01:51
@mattbrictson mattbrictson changed the title Wait for system testing to load before compiling Vite assets Skip building vite assets in tests unless absolutely needed Mar 31, 2024
@mattbrictson mattbrictson changed the title Skip building vite assets in tests unless absolutely needed Skip building vite assets in tests if possible Mar 31, 2024
@mattbrictson mattbrictson marked this pull request as ready for review March 31, 2024 20:10
@mattbrictson mattbrictson marked this pull request as draft April 10, 2024 14:54
@mattbrictson mattbrictson added the automerge Automatically merge PR once all required checks pass label Apr 10, 2024
@mattbrictson mattbrictson marked this pull request as ready for review April 10, 2024 19:26
@kodiakhq kodiakhq bot merged commit 93d550f into main Apr 10, 2024
8 checks passed
@kodiakhq kodiakhq bot deleted the lazy-vite branch April 10, 2024 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all required checks pass ✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant