Headless qunit integration tests?

AI 生成的摘要

rimian inquired about setting up headless QUnit integration tests via the command line using Gulp and PhantomJS to run subsets of the test suite for TDD. sam clarified that a rake qunit:test task already exists but noted that running single tests via CLI was not yet implemented, suggesting the web browser path /qunit as the current method. In response, rimian submitted a pull request to enable running single tests from the command line, which sam subsequently merged. rimian also opened a second PR to add a RETRY flag, addressing concerns about running tests multiple times. sam expressed a desire to integrate this functionality into rake autospec. However, eviltrout warned that previous attempts by zogstrip to integrate similar features resulted in significant performance slowdowns. zogstrip acknowledged the suggestion, emphasizing that a seamless integration would be ideal.

I’d like to run my integration tests via the command line with support for running a subset of the entire test suite. I’m thinking about setting up gulp and phantomjs to run the tests. Something like: https://www.npmjs.com/package/node-qunit-phantomjs

Has anyone set something like this up? Any pointers?

We already have a rake task for this…

rake qunit:test

Oh, of course! Thanks for that.

I’m trying to work out how to run single tests so I can be TDD.

In general we use the web browser to run single tests using /qunit path

It is doable using the CLI just not implemented yet.

Here’s a PR that implements that:

https://github.com/discourse/discourse/pull/4268

:slight_smile:

Merged it in :slight_smile: good idea,

My dream is somehow to integrate this stuff into rake autospec that would be mighty cool.

Anything that makes testing easier!

It wants to run the tests multiple times which doesn’t make a lot of sense if you’re running a subset via rake on the command line. I included a RETRY flag. I would say the default value should be false but I guess that will break other things.

https://github.com/discourse/discourse/pull/4269

I believe @zogstrip took a stab at this and it had many issues. In particular it seemed significantly slower than before.

I believe that’s what @sam is suggesting. Having it integrated nicely would be mighty cool :wink: