Testing a Discourse API client on Travis-CI

What’s the best or fastest way to get Discourse installed on Travis for testing a client for the Discourse API ?

It appears as though the discourse_api gem uses webmock so I think does not use a real Discourse installation.

It would be nice to install Discourse on Travis and test against it for my test suite. Any example travis files for that?

Can you explain what you are trying to do and why you need Discourse installed with a specific example of type of test you are trying to run?

I have a R client for the Discourse API at https://github.com/sckott/discgolf

My test suite currently uses a Discourse installation I maintain. I’d prefer to test against a Discourse installation setup each time Travis is run (or cached if possible on Travis).

I could test against stored JSON blobs - but I’d like to see if I can test against a running Discourse installation if possible, and not a real installation with real users - that’s why I want one installed for testing.

As far as examples, it’s the entire test suite I want to run, but here is an example testing against the /posts route https://github.com/sckott/discgolf/blob/master/tests/testthat/test-posts.R

Interesting, I guess this is a question of cost, ideally you just run a Digital Ocean droplet with Discourse, keep it up to date and test against that.

But that would cost you a minimum of 5-10 bucks a month. I am not sure how you would wrangle an install of Discourse into travis without incurring a massive upfront delay.


Right, I’ll just stub out some json instead. Thanks for the help!