Integration Tests and CI #328
-
My rspec Integration Tests work great locally and the Building with Vite ⚡️ works fine. But when they run in a Bitbucket Pipelines step (limited to 1 Image, which is Ruby) they fail with: Rather than trying to mess with caches and artifacts between a node step and ruby step, can I just configure Vite to not throw errors when its tags do not successfully render? I feel like I missing something obvious and trying to do it the hard way. I have read these: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi there!
I'd recommend you run Not familiar with Bitbucket pipelines, the one image limit might be what's making this tricky. Disabling the JS could cause your app's behavior not to reflect the real behavior in production, I wouldn't recommend doing that for integration tests. In the future Vite Ruby might provide a test helpers module to ignore assets in controller tests, but again, wouldn't recommend that for integration tests. |
Beta Was this translation helpful? Give feedback.
-
With no success I tried disabling vite_ruby in the test environment. I tried modifying vite.json (there's no node!), conditionally disabling bin/vite. Apparently because of vite_ruby/vite_ruby/lib/vite_ruby/manifest.rb Line 205 in 41441af
I do not need JS for simple request tests. So I guess my only remaining options are: |
Beta Was this translation helpful? Give feedback.
-
I had to conditionally disable any tags that referenced vite_ruby.
It's a shame, because including the vite build in the rspec process (as works locally) was a nice to have. Maybe in the future there will better container provisioning in CI, simpler artifact processing, or, in the context of this library, some way of mocking or containerizing the build without node. @ElMassimo Really appreciate your help. |
Beta Was this translation helpful? Give feedback.
I had to conditionally disable any tags that referenced vite_ruby.
<%= vite_javascript_tag 'component.jsx' unless Rails.env.test? %>
It's a shame, because including the vite build in the rspec process (as works locally) was a nice to have.
Maybe in the future there will better container provisioning in CI, simpler artifact processing, or, in the context of this library, some way of mocking or containerizing the build without node.
@ElMassimo Really appreciate your help.