I found simpletest much more pleasant to use when I created urls for each of my modules tests. That way I could just hit reload to instantly re-run the test, and I can book mark the ones that I need to run a lot, without needing to scroll through all the other tests that exist in the system.

Comments

moshe weitzman’s picture

Priority: Normal » Critical

Thats a brilliant idea. I'll be so bold as to mark it a critical feature.

boombatower’s picture

I'll mention it again. You can just press the refresh button and then press enter to re-submit post data thus running the test(s) again.

I see that the urls are pretty and all, but by no means critical. The only thing they do is eliminate one button press of two.

moshe weitzman’s picture

eliminating a button click or two is an important goal. testing needs all the grease it can get in order to catch on.

anyway, with urls you can have 3 windows with 3 tests open at once and just refresh whichever one you want without resorting to the mouse. pressing buttons is harder.

starbow’s picture

I see this one as the difference between possible to use and pleasant to use.

boombatower’s picture

That is fine, so someone needs to write a patch.

@moshe weitzman: You don't have to use the mouse at all.

press the refresh button and then press enter

Meaning in most browsers you press F5 or ctrl + r and then hit enter. I can do this in less than a second.

boombatower’s picture

Priority: Critical » Minor
Status: Active » Needs work

If this is a necessary feature will someone write a patch.

Since an easy workout around has been stated I will mark this minor.

starbow’s picture

Status: Needs work » Active

@boombatower - the "patch (code needs work)" status signifies that there is an existing patch, and that there are specific issues with that patch. Since there is no patch as of yet, the correct status is "active".

soxofaan’s picture

Priority: Minor » Normal
Status: Active » Needs review
FileSize
119.61 KB
3.09 KB



Meaning in most browsers you press F5 or ctrl + r and then hit enter. I can do this in less than a second.

The advantage of URL's is that you can bookmark them, put them in your menu, put them in custom blocks, whatever,
which is much handier than going through a form and struggling with POST data.
(The lower the barrier to use SimpleTest, the better IMHO, that's why I changed priority to normal.)

Anyway, here is a patch (for 6.x-1.x-dev).

It adds a overview page under the admin/reports/simpletest (I think this is a better place than the current admin/build/simpletest), see screenshot
The URL's on that page link to things like admin/reports/simpletest/run/FooTest for running single tests and admin/reports/simpletest/run/FooTest,BarTest for running multiple tests.

It's still a bit in proof of concept phase, so feedback and ideas are welcome

boombatower’s picture

Project: SimpleTest » Drupal core
Version: 6.x-1.x-dev » 7.x-dev
Component: User interface » simpletest.module
Status: Needs review » Needs work

Since the plan is to back-port the new 7.x UI this will no longer apply in terms of the modified UI. The URL concept could still be applied, but you can also run tests from command line.

I think this should be written for 7.x and then back-ported if written at all. I still don't see it as very useful.

soxofaan’s picture

Status: Needs work » Needs review
FileSize
3.07 KB

Here is a first try of porting the patch from #8 to Drupal 7.x-dev. It's a basic version with still room for some jquery juice and other UI tweaks.

Note: This patch adds an testing overview page in the admin > reports section. (The original testing page is in admin > build.)
As this UI it's not directly intended to replace the existing UI, I decided to put it there for now. This is up for debate of course.

In defense for its usefulness: as a contrib module developer/maintainer who tries to use simpletest in the dev-cycle, I prefer a "bookmarkable" testing callback above a clicky-clicky-form ;)

Dries’s picture

I think this would be valuable. As we now have a simpletest.test (SimpleTests for SimpleTest), we'll want to write a test case for this?

Looking at the patch, it looks like this would create a different entry point for testing? Wouldn't it make sense to group everything a bit? I think we'll want to brainstorm a bit more about where these links should show up. I'd be inclined to say that they should show be used on the current test page.

soxofaan’s picture

Looking at the patch, it looks like this would create a different entry point for testing?

Indeed, the menu path for this is open for debate. The patch of #10 is mainly a proof of concept.

Actually, I tried to ignite a discussion on where to put the simpletest menu items in #263616: Move SimpleTest out of "Site building"

boombatower’s picture

Could add a column to the current UI table and see what that looks like.

Dries’s picture

Status: Needs review » Needs work

soxofaan: I think everything should be under one menu item. By definition, that means that this patch needs work. ;-)

boombatower’s picture

Status: Needs work » Needs review
FileSize
1.71 KB

This is a somewhat different approach and doesn't come with an interface to provide links since that seems to be the most disputed. This can get committed while we decide how we want to display the links, if we do.

I think this is a good approach and will allow for the form validation already written to be used.

soxofaan’s picture

about the patch from #15: isn't it overly complicated to pipe everything trough form processing (building a $form_state, calling drupal_execute()), when you just need to call one simple function (simpletest_run_tests($test_classes))?

And what do you mean with the 'form validation already written'? I can't find any validation handlers for the simpletest_overview_form form.

boombatower’s picture

Meaning it won't try to run a test case that doesn't exist. That is because the form API deals with that based on the form that was generated.

Susurrus’s picture

Status: Needs review » Needs work

This patch no longer applies cleanly and I can't seem to get it to work.

The Batch API-ed version of SimpleTest is now in use, so this probably needs to be modified slightly to account for that.

Also, given that there's no UI, there should be documentation on what "name" should be passed as the URL. For people not familiar with the internals of SimpleTest (like me), there's no way to use this feature as of now without knowing what a name is. Is it the name of the class of tests you want to run?

Susurrus’s picture

Status: Needs work » Needs review
FileSize
1.88 KB

So here's an updated version of the patch. It works for URLs that are /admin/build/testing/run/FULL_TEST_CLASS_NAME. FULL_TEST_CLASS_NAME are the full names of the test classes you wish to run, comma-separated. You can also use 'all' here to run all tests.

I wouldn't mind actually seeing the results page separated from the test-selection page. So the first page you select your tests. That forwards you to the results page. Now the results page is either the URL that is currently being used for tests in this patch (/admin/build/testing/run/FULL_TEST_CLASS_NAME) or it displays a bookmarking link like when you use advanced search. There would also be a link back to select different tests.

I think this offers a few advantages over the current system as I believe users don't change the tests they're running that much. I know I don't, but I'm not a major core hacker. It exposes the URL for running individual tests to users without a heavy UI burden. It also simplifies the UI on the testing page, as when they're results and Drupal messages as well as this huge multi-checkbox form, the interface looks incredibly cluttered.

lilou’s picture

Title: Generate urls for running tests directly » Running tests directly via URL
FileSize
1.8 KB

Reroll patch against HEAD with change in description menu link.

* Work this a single test via URL admin/build/testing/run/BlockTestCase
* White screen with multiple tests via URL admin/build/testing/run/HelpTestCase,TrackerTest
* Not tested with admin/build/testing/run/all URL.

lilou’s picture

Status: Needs review » Needs work
soxofaan’s picture

as a remainder: note that this issue depends on #263616: Move SimpleTest out of "Site building" as already noted in #12
the simpletest menu items will move from admin/build/testing/ to simething like admin/development/testing

lilou’s picture

#263616 is postponed.

boombatower’s picture

Status: Needs work » Postponed

It is waiting on another issue: #296693: Hide empty admin categories

boombatower’s picture

Status: Postponed » Closed (won't fix)

Seems like with the new interface and such this is not as relevant, and has completely list interest.

Please re-open if new patch and interest.