D6 version has fair amount of simpletests implemented - at least we need to re-implement this tests in D7.

Comments

miro_dietiker’s picture

As we've seen with the recent results...

There's too less test coverage.
We've found results in which triggering a success condition in Test A triggers resulted in success counts for all other test case too...
The test cases should be extended by concurrent tests: Multiple test cases enabled to run in parallel. Triggering visits / success, checking stats.

pivica’s picture

Big problem here is that Drupal simpletest framework do not support cookies

http://groups.drupal.org/node/22176
#457804: Enable simpletest to manipulate cookies

And this is a problem for D6 and D7. D8 we will see...

But this means that we can not write full tests in simpletests - we can only test basics.

I am thinking of trying to use behat/mink combination here. Will know more when I write some basic tests and check how everything runs.

miro_dietiker’s picture

Oops, that's a real ugly thing...
And simulating this is even more ugly...

This is out of the scope of my research till now.
We really need that stuff or we're really far away from reliable testing.

miro_dietiker’s picture

I guess we should rewrite the architecture to follow the dependency injection and add clean interfaces. Then we can provide a lot of unit tests...

Additionally we can also add some user side testing with tools like casperJS / PhantomJS...

nonsie’s picture

Since both of you are going to Prague, perhaps there's enough interest for a BOF and possibly a code sprint?

Just my 2c

miro_dietiker’s picture

I won't be in prague, i'm sorry. Two of my team will be there.
In case there's a BOF, i can tell them to participate.

Our team primarily sprints for D8 core and contrib D8 conversion and they have a ton of (other) modules to convert...

pivica’s picture

I will be in Prague, BOF and code sprint, didn't think about this for multivariate, but it is maybe a cool idea. Need to think about this more.

@nonsie you have idea what areas need improvements - i mean all areas needs improvements, but what are the most important stuff we should do to bring multivariate on next level so more people start using it?

nonsie’s picture

miro_dietiker’s picture

Simpletest does environment isolation based on headers to allow running multiple tests in parallel (that finally interact with complete separate installs / drupal instances...)

A simpletest supports one session at a given time. As far as i know, there's no API to simulate multiple user sessions in parallel within one simpletest.
Either this needs manual header tweaking / session switches - that additionally need simpletest environment isolation preservation OR we go completely away from simpletest and write unittests (thus test our APIs only and improve our patterns by using dependency injection (meaning, all dependent objects are injected in constructor - and not rely on globals in any kind) and test whatever we can tests - without real web requests (aka integration / simple tests).

miro_dietiker’s picture

OK, agree, it is possible with a simpletest.
Simpletest uses the user-agent header to identify the right test instance.
We can implement own session switches and simulate multiple users, but we will need to "hack" some simpletest environments to use the regular drupalGet or similar with tweaked / switches sessions.

nonsie’s picture

You are right about parallel sessions - I was thinking about Session API module but it has a bit different use case. We could write tests from a single user point of view but it will not get full test coverage as the tests/combinations run will be specific to that user only.
There's also the possibility of writing simpletests for crud tasks and unit tests for the rest of the code...

pivica’s picture

Since both of you are going to Prague, perhaps there's enough interest for a BOF and possibly a code sprint?

So after recent new activity (most thanks to nonsie) I think it would be good that we make one BOF and then on BOF also see do we want to make a code sprint in Friday.

There are still free rooms for BOF registrations on https://prague2013.drupal.org/bofs/thursday. @nonsie any idea which day and time would be good?

pivica’s picture

Regarding auto testing, I don't know the state of this in D7 did something change and can we use it for multivariate. If somebody can put some light how we can do this for D7 please do.

For D8 I agree we could use unit test to test discrete stuff in multivariate but I still think we need real testing. Somebody know can we do full tests of multivariate in D8 (with session/cookie support).

If full tests are still not possible for D7/8 then +1 for casperJS / PhantomJS - I have used recently phantomjs and it is really nice tool and I guess writing tests with casperjs would be relatively easy.

nonsie’s picture

I'll be in Prague Monday through Friday and am quite flexible in terms of scheduling.

pivica’s picture

@nonsie I created BOF for multivariate, check https://prague2013.drupal.org/bof/multivariate-testing-drupal-0. If you wanna change or add some text please tell me and I will update BOF post.

I will be in Prague from Sunday to Saturday. I proposed code sprint for multivariate on Friday but if you want we can meet and start coding in Monday also.

Tell me what you think.

nonsie’s picture

Let's meet up at the BOF tomorrow and see where it goes. If there's not enough interest we can always start writing some code during the BOF

pivica’s picture

At least one more guy from Technocrat will come tomorrow, we will see.

But except coding I would also like that we first discuss a little bit about future plans, missing features and priorities - so we have some kind of a plan what should we do first.

Anyway see you tomorrow on BOF at 14:15.