mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 21:11:10 +08:00

This totally separate SCSS and i18n compilation pipelines only existed so that we could run `ember exam` in CI without starting Rails. Now that our CI has such heavy caching of Ruby dependencies and database migrations, the speed benefit of this is not worth the cost of maintaining these separate pipelines. Therefore, this commit removes that system, and updates CI to use `bin/rake qunit:test`. That will start up a Rails server and proxy stylesheet/locale requests to it. This strategy was already used for our theme and plugin qunit test runs.
33 lines
821 B
Ruby
33 lines
821 B
Ruby
# frozen_string_literal: true
|
|
|
|
class BootstrapController < ApplicationController
|
|
skip_before_action :redirect_to_login_if_required, :check_xhr
|
|
|
|
def plugin_css_for_tests
|
|
targets = Discourse.find_plugin_css_assets(include_disabled: true, desktop_view: true)
|
|
render_css_for_tests(targets)
|
|
end
|
|
|
|
def core_css_for_tests
|
|
targets = %w[color_definitions desktop admin]
|
|
render_css_for_tests(targets)
|
|
end
|
|
|
|
private
|
|
|
|
def render_css_for_tests(targets)
|
|
urls =
|
|
targets.map do |target|
|
|
details = Stylesheet::Manager.new().stylesheet_details(target, "all")
|
|
details[0][:new_href]
|
|
end
|
|
|
|
stylesheet = <<~CSS
|
|
/* For use in tests only */
|
|
#{urls.map { |url| "@import \"#{url}\";" }.join("\n")}
|
|
CSS
|
|
|
|
render plain: stylesheet, content_type: "text/css"
|
|
end
|
|
end
|