discourse/config/initializers
Alan Guo Xiang Tan e0ef88abca
DEV: Run QUnit tests for official Discourse themes (#24405)
Why this change?

As the number of themes which the Discourse team supports officially
grows, we want to ensure that changes made to Discourse core do not
break the plugins. As such, we are adding a step to our Github actions
test job to run the QUnit tests for all official themes.

What does this change do?

This change adds a new job to our tests Github actions workflow to run the QUnit
tests for all official plugins. This is achieved with the following
changes:

1. Update `testem.js` to rely on the `THEME_TEST_PAGES` env variable to set the
   `test_page` option when running theme QUnit tests with testem. The
   `test_page` option [allows an array to be specified](https://github.com/testem/testem#multiple-test-pages) such that tests for
   multiple pages can be run at the same time. We are relying on a ENV variable
   because  the `testem` CLI does not support passing a list of pages
   to the `--test_page` option.

2. Support a `/testem-theme-qunit/:testem_id/theme-qunit` Rails route in the development environment. This
   is done because testem prefixes the path with a unique ID to the configured `test_page` URL.
   This is problematic for us because we proxy all testem requests to the
   Rails server and testem's proxy configuration option does not allow us
   to easily rewrite the URL to remove the prefix. Therefore, we configure a proxy in testem to prefix `theme-qunit` requests with
  `/testem-theme-qunit` which can then be easily identified by the Rails server and routed accordingly. 

3. Update `qunit:test` to support a `THEME_IDS` environment variable
   which will allow it to run QUnit tests for multiple themes at the
   same time.

4. Support `bin/rake themes:qunit[ids,"<theme_id>|<theme_id>"]` to run
   the QUnit tests for multiple themes at the same time.

5. Adds a `themes:qunit_all_official` Rake task which runs the QUnit
   tests for all the official themes.
2023-11-17 07:17:32 +08:00
..
000-development_reload_warnings.rb DEV: Further refine development reload for plugin files (#22141) 2023-06-16 16:15:15 +08:00
000-mini_sql.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
000-post_migration.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
000-trace_pg_connections.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
000-zeitwerk.rb DEV: Seperate concerns of tracking GC stat from `MethodProfiler` (#22921) 2023-08-02 10:46:37 +08:00
001-redis.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
002-freedom_patches.rb FIX: deprecation warning - initialization autoloaded the constant (#12400) 2021-03-16 09:47:57 +11:00
002-rails_failover.rb FEATURE: Introduce pg_force_readonly_mode GlobalSetting (#19612) 2023-01-19 13:59:11 +00:00
004-message_bus.rb DEV: Patch capybara to ignore client-triggered errors (#19972) 2023-01-24 11:07:29 +00:00
005-site_settings.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
006-ensure_login_hint.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
006-mini_profiler.rb DEV: Run QUnit tests for official Discourse themes (#24405) 2023-11-17 07:17:32 +08:00
008-rack-cors.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
009-omniauth.rb DEV: Drop legacy OpenID 2.0 support (#8894) 2020-02-07 17:32:35 +00:00
012-web_hook_events.rb FEATURE: Add webhooks for user suspend and unsuspend (#23684) 2023-09-28 10:51:05 +02:00
013-excon_defaults.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
014-track-setting-changes.rb PERF: Cache ToS and Privacy Policy paths (#21860) 2023-06-07 21:31:20 +03:00
099-anon-cache.rb SECURITY: Don't reuse CSP nonce between anonymous requests 2023-07-28 12:53:44 +01:00
099-drain_pool.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-i18n.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-logster.rb DEV: Remove older ruby version logic (#19971) 2023-01-24 10:42:56 +00:00
100-oj.rb DEV: default Oj to compat mode 2020-01-16 07:52:28 +11:00
100-onebox_options.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-push-notifications.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-quiet_logger.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-regex-timeout.rb DEV: Introduce regex_timeout_seconds global setting (#20774) 2023-03-22 12:01:35 +00:00
100-secret_token.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
100-session_store.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-sidekiq.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-silence_logger.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-strong_parameters.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
100-verify_config.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
100-wrap_parameters.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
101-lograge.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
102-truncate-logs.rb SECURITY: Add a default limit as to when logs should be truncated 2023-10-16 10:34:38 -04:00
200-first_middlewares.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
300-perf.rb FEATURE: add hook after all initializers 2019-08-26 10:49:26 +10:00
400-deprecations.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
assets.rb DEV: Simplify sprockets configuration (#24111) 2023-10-26 17:29:53 +01:00
filter_parameter_logging.rb DEV: Apply syntax_tree formatting to `config/*` 2023-01-09 11:13:29 +00:00
new_framework_defaults_7_0.rb Revert "DEV: Migrate existing cookies to Rails 7 format" 2023-01-12 12:07:49 +01:00