discourse/lib/tasks
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
..
add_topic_to_quotes.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
admin.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
annotate.rake FEATURE: Create legal topics for set company name (#21620) 2023-05-24 23:05:36 +03:00
api.rake
assets.rake DEV: Simplify sprockets configuration (#24111) 2023-10-26 17:29:53 +01:00
auto_annotate_models.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
autospec.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
avatars.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
backfill.thor DEV: Format .thor files (#23059) 2023-08-10 13:59:13 +02:00
categories.rake FIX: Update category tag stats with new or deleted (#21531) 2023-05-18 12:46:44 +03:00
cdn.rake DEV: Prefer \A and \z over ^ and $ in regexes (#19936) 2023-01-20 12:52:49 -06:00
db.rake DEV: Respect SKIP_TEST_DATABASE when running rake db:create (#24407) 2023-11-16 20:01:12 +08:00
destroy.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
dev.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
docker.rake DEV: Silence successful db:migrate output in docker.rake (#24417) 2023-11-16 16:07:36 +00:00
documentation.rake DEV: Restore the documentation format in system tests (#21471) 2023-05-12 11:13:52 +02:00
emails.rake FIX: improve mailman email parsing (#21627) 2023-05-19 10:33:48 +02:00
emoji.rake DEV: Update minitest to 5.19.0 (#22821) 2023-07-27 12:18:40 +02:00
export.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
groups.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
hashtags.rake DEV: Capture output in hashtags spec (#20773) 2023-03-23 11:47:14 +10:00
i18n.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
images.rake DEV: Upgrade to Rails 7 2022-04-28 11:51:03 +02:00
import.rake DEV: Create missing user profiles in "import:ensure_consistency" rake task 2023-08-09 20:56:14 +02:00
incoming_emails.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
integration.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
javascript.rake DEV: Modernise highlightjs loading (#24197) 2023-11-10 20:39:48 +00:00
log.rake
maxminddb.rake DEV: Avoid constant redefinition warnings in specs (#23241) 2023-08-24 23:16:32 +02:00
plugin.rake Remove discourse-canned-replies from official list (#22932) 2023-08-02 12:48:20 +01:00
populate.rake DEV: Convert admin-incoming-email modal to component-based API (#22701) 2023-07-20 16:31:20 -05:00
populate.thor DEV: Format .thor files (#23059) 2023-08-10 13:59:13 +02:00
posts.rake DEV: Replace #pluck_first freedom patch with AR #pick in core (#19893) 2023-02-13 12:39:45 +08:00
profile.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
qunit.rake DEV: Run QUnit tests for official Discourse themes (#24405) 2023-11-17 07:17:32 +08:00
redis.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
release_note.rake DEV: Add link to PR when generating release notes 2023-09-12 09:26:46 +02:00
revisions.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
rspec.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
s3.rake FEATURE: allow S3 ACLs to be disabled (#21769) 2023-06-06 15:47:40 +10:00
scheduler.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
search.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
site_settings.rake DEV: Add rake command to help detect dead settings (#23300) 2023-08-29 09:42:52 -06:00
site.rake FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
smoke_test.rake DEV: Drop /theme-qunit from smoke test (#23562) 2023-09-13 16:14:27 +01:00
svg_icons.rake DEV: Enable unless cops 2023-02-21 10:30:48 +01:00
svg_sprites.rake DEV: Store theme sprites in the DB (#20501) 2023-03-14 13:11:45 -05:00
tags.rake DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
themes.rake DEV: Run QUnit tests for official Discourse themes (#24405) 2023-11-17 07:17:32 +08:00
topics.rake FEATURE: do not bump topics when retroactively closing (#23115) 2023-08-16 11:20:47 +10:00
turbo.rake DEV: Fix bin/turbo_rspec runtime recording (#20407) 2023-02-23 07:47:11 +10:00
typepad.thor DEV: Format .thor files (#23059) 2023-08-10 13:59:13 +02:00
uploads.rake FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
users.rake DEV: Add task to anonymize user data (#20522) 2023-10-03 16:59:43 +08:00
version_bump.rake DEV: Do not squash commits in version_bump:stage_security_fixes (#23547) 2023-09-12 18:00:42 +01:00