Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 21, 2017

Conversation

davidtaylorhq
Copy link
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

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

@SamSaffron
Copy link
Member

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

@davidtaylorhq
Copy link
Member Author

davidtaylorhq commented Jul 13, 2017

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
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
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

# 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
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
Contributor

Thank you for all your work so far 👍 @davidtaylorhq

@SamSaffron
Copy link
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
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
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
Member Author

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

@davidtaylorhq
Copy link
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