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
admin.rake
annotate.rake
api.rake
assets.rake DEV: Simplify sprockets configuration (#24111) 2023-10-26 17:29:53 +01:00
auto_annotate_models.rake
autospec.rake
avatars.rake
backfill.thor DEV: Format .thor files (#23059) 2023-08-10 13:59:13 +02:00
categories.rake
cdn.rake
db.rake DEV: Respect `SKIP_TEST_DATABASE` when running `rake db:create` (#24407) 2023-11-16 20:01:12 +08:00
destroy.rake
dev.rake
docker.rake DEV: Silence successful db:migrate output in docker.rake (#24417) 2023-11-16 16:07:36 +00:00
documentation.rake
emails.rake
emoji.rake
export.rake
groups.rake
hashtags.rake
i18n.rake
images.rake
import.rake DEV: Create missing user profiles in "import:ensure_consistency" rake task 2023-08-09 20:56:14 +02:00
incoming_emails.rake
integration.rake
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
populate.thor DEV: Format .thor files (#23059) 2023-08-10 13:59:13 +02:00
posts.rake
profile.rake
qunit.rake DEV: Run QUnit tests for official Discourse themes (#24405) 2023-11-17 07:17:32 +08:00
redis.rake
release_note.rake DEV: Add link to PR when generating release notes 2023-09-12 09:26:46 +02:00
revisions.rake
rspec.rake
s3.rake
scheduler.rake
search.rake
site.rake FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
site_settings.rake DEV: Add rake command to help detect dead settings (#23300) 2023-08-29 09:42:52 -06:00
smoke_test.rake DEV: Drop `/theme-qunit` from smoke test (#23562) 2023-09-13 16:14:27 +01:00
svg_icons.rake
svg_sprites.rake
tags.rake
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
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