Skip to content

Allow docker test rake task to be used for single plugins - #4973

Merged
tgxworld merged 6 commits into
discourse:masterfrom
davidtaylorhq:docker-single-plugin
Jul 21, 2017
Merged

Allow docker test rake task to be used for single plugins#4973
tgxworld merged 6 commits into
discourse:masterfrom
davidtaylorhq:docker-single-plugin

Conversation

@davidtaylorhq

Copy link
Copy Markdown
Member

This is useful for adding continuous integration to individual plugin repositories. For example, I've just set up discourse-chat-integration to run its tests on travis automatically. (Currently it applies this patch manually).

This change adds support for a SINGLE_PLUGIN environment variable. If set, it only runs rspec tests for that specific plugin. If left unset, everything continues to function as it currently does.

(Specific qunit tests can already be run using the MODULE or FILTER environment variables)

example travis file making use of this feature

working test

This is useful for adding continuous integration to individual plugin repositories
@discoursebot

Copy link
Copy Markdown
Contributor

You've signed the CLA, davidtaylorhq. Thank you! This pull request is ready for review.

@SamSaffron

Copy link
Copy Markdown
Member

This is fine, but let's add some documentation for this somewhere first.

@davidtaylorhq

davidtaylorhq commented Jul 13, 2017

Copy link
Copy Markdown
Member Author

Where would you like the documentation? As a comment at the top of the file? I think a list of all the possible environment variables is probably a bit long to fit in the description line

desc 'Run all tests (JS and code in a standalone environment)'

 

@davidtaylorhq

Copy link
Copy Markdown
Member Author

@SamSaffron I've added some documentation as comments, but maybe there's a better place for them to go?

Once this is merged I'll also update my meta topic on plugin CI testing with the details.

@davidtaylorhq

Copy link
Copy Markdown
Member Author

@SamSaffron I've updated this so it works with your new SKIP_CORE env variable, and also added the new ENV variables to the documentation at the top

Comment thread lib/tasks/docker.rake Outdated
# running it anywhere else will likely fail
#
# Environment Variables (specific to this rake task)
# => SKIP CORE set to 1 to skip core rspec tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing underscore here?

@tgxworld
tgxworld merged commit 62604e9 into discourse:master Jul 21, 2017
@tgxworld

Copy link
Copy Markdown
Contributor

Thank you for all your work so far 👍 @davidtaylorhq

@SamSaffron

Copy link
Copy Markdown
Member

@davidtaylorhq awesome! a big one missing is the ability to run all qunit tests for ALL plugins (without core) can you swing adding that?

@davidtaylorhq

Copy link
Copy Markdown
Member Author

I'm not sure how to detect which qunit tests are for plugins or for core - as far as I can see qunit offers filtering by "Module" or keyword... nothing for test file path.

Any ideas?

@SamSaffron

Copy link
Copy Markdown
Member

yeah ... that has been my conundrum here as well :)

I have no idea how to swing this but totally need it, maybe core can be hacked somehow to allow this?

@davidtaylorhq

Copy link
Copy Markdown
Member Author

Ok cool, I'll have a look in more detail next week.

@davidtaylorhq

Copy link
Copy Markdown
Member Author

For reference: second PR is here #4985

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants