Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi committed Jun 4, 2024
1 parent 428516d commit a39e053
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/decidim/dev/test/rspec_support/webpacker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

RSpec.configure do |config|
config.before(:all) do
raise "Rails.root directory does not exist" unless Rails.root.exist?
raise "package.json file does not exist" unless Rails.root.join("package.json").exist?

Dir.chdir(Rails.root) { Webpacker.compile }
rescue Errno::ENOENT
node_modules_contents = `ls #{Rails.root.join("node_modules")}`

message = <<~ERROR
There was an error during the Webpacker compilation
#{"=" * 80}
Node version: #{`node -v`}
#{"=" * 80}
NPM version: #{`npm -v`}
#{"=" * 80}
Node modules packages: #{`npm list`}
#{"=" * 80}
Node modules contents: #{node_modules_contents}
#{"=" * 80}
ERROR

raise message
end
end
6 changes: 6 additions & 0 deletions spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@
"/lib/decidim/forms/user_answers_serializer.rb" => "a81a7e01a12ead59cc6cb7505b1041b5"
}
},
{
package: "decidim-dev",
files: {
"/lib/decidim/dev/test/rspec_support/webpacker.rb" => "1c61c660c9e3b1aaf767fce948b9c371"
}
},
{
# Fix origami date compatibility with Ruby 3.0 monkey-patching it on origami_date.rb
package: "origami",
Expand Down

0 comments on commit a39e053

Please sign in to comment.