Testing a Discourse API client on Travis-CI

AI 生成的摘要

The discussion revolves around testing a Discourse API client on Travis-CI. sckott is looking for the best way to install Discourse on Travis for testing, but currently uses a maintained Discourse installation for their test suite. sam requests clarification on the goal and type of tests being run, to which sckott explains that they want to test against a running Discourse installation on Travis, rather than a real installation or stored JSON blobs. They provide an example of a test against the /posts route.

sam suggests running a Digital Ocean droplet with Discourse, but notes the associated cost. Installing Discourse on Travis would likely incur a significant upfront delay. sckott ultimately decides to stub out JSON instead, thanking sam for their help.

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 GitHub - sckott/discgolf: Discourse API R client · GitHub

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 discgolf/tests/testthat/test-posts.R at master · sckott/discgolf · GitHub

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!