I'd like to start adding some automated tests to the module to aid in ongoing new development. There's certainly more than enough complexity and moving parts in the code to justify that now. I just wanted to open an issue here to remind myself about this task and track progress.

Comments

  • Commit cca58a0 on 7.x-2.x by rjacobs:
    Issue #2215229 by rjacobs: Add numerous automated tests.
    
rjacobs’s picture

Status: Active » Needs review
StatusFileSize
new376 bytes

It looks like drupal.org automatically links commits with the issue queues, neat.

The commit adds a whole bunch of tests. These all pass fine in a dev space, but the drupal.org testbots may be a whole other story. Adding a bogus patch here to test the new tests.

rjacobs’s picture

Hummm, it looks like the tests were actually triggered on the commit (https://qa.drupal.org/pifr/test/664058). There were a few failures, but the bulk of the test structures seem to be alright. The failures may related to the image style handling or maybe something to do with URL structures.... I'll need to look into that.

The "test patch" will probably be postponed for testing until that's worked out.

  • Commit ac28f9d on 7.x-2.x by rjacobs:
    Issue #2215229 by rjacobs: Fix automated tests to remove clean URL...
rjacobs’s picture

Status: Needs review » Active

This turned out to be an issue with clean URLs. Some assumptions were set to detect clean URL structures (or unencoded attributes), which worked locally but not with the testbot. Everything passes now.

The only pending issue is that it looks like one of the tests cases is getting skipped (JuiceboxFileEntityCase). According to the logs (https://qa.drupal.org/pifr/test/664058), that test case is "found", but it's not run... no explanation why. That test case does have a file_entity dependency, so there might be something odd with the handling of that.

rjacobs’s picture

Status: Active » Needs review
StatusFileSize
new487 bytes

Here's a patch which removes the 'dependencies' key from the getInfo() details for the test that uses file_entity. My guess is that this could what keeps testbot from even trying this test case. It's seems that testbot must have some awareness of the file_entity project because that projects own tests get run on drupal.org.

This is just for experimentation to see if the test logs come back any different.

Status: Needs review » Needs work

The last submitted patch, 7: test_check_file_entity_restriction-2215229-7.patch, failed testing.

rjacobs’s picture

Status: Needs work » Active

Well, that got it to try the test case, so that's useful. Of course it failed to install file_entity, so the test died in a streak of blue flames.

This makes me wonder how it is that file_entity's own test manage to run.

rjacobs’s picture

Status: Active » Needs review
StatusFileSize
new376 bytes

I think the issue with file_entity is fixed now. It turn out that adding 'dependencies' => array('file_entity') to getInfo() is not enough. It looks like that does make the dependency available, it just deactivates the test if the dependency is not available.

To truly make the dependency available one needs to either enable a helper test module that declares the dependency in its .info file, or use the test_dependencies[] line in the main module's .info file. I just added this to juicebox.info:

test_dependencies[] = file_entity

And thing seem to work.

Re-submitting the bogus patch to confirm 100%

rjacobs’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev
Status: Needs review » Active

516 passes > 464 passes... so that now accounts for the file_entity case. Finally.

Ok, now this needs attention in 8.x-2.x

rjacobs’s picture

Status: Active » Needs review
StatusFileSize
new15.39 KB

Here's a partial port of the D8 tests for the field formatter. I just want to see how these behave with the testbot.

Status: Needs review » Needs work

The last submitted patch, 12: juicebox_temp_testbot_test.patch, failed testing.

rjacobs’s picture

Status: Needs work » Needs review
StatusFileSize
new15.43 KB

Hummm, here's another with just setup logic.

Status: Needs review » Needs work

The last submitted patch, 14: juicebox_temp_testbot_test2.patch, failed testing.

rjacobs’s picture

Status: Needs work » Needs review
StatusFileSize
new15.43 KB

Status: Needs review » Needs work

The last submitted patch, 16: juicebox_temp_testbot_test3.patch, failed testing.

rjacobs’s picture

Status: Needs work » Active

Due to the libraries API dependency, it's possible that this won't work with D8 testbots until #2047557: Support Drupal 8-style *.info.yml files is addressed. This needs more investigation I guess.

rjacobs’s picture

Status: Active » Needs review
StatusFileSize
new15.93 KB

Actually, it looks like I had a case issue with a class name (totally unrelated to the actual test logic) which somehow was swallowed by my local php. Trying again.

rjacobs’s picture

Status: Needs review » Active

Ok, finally, the base test port works with testbots. Now I just have to finish porting the rest of the tests.

rjacobs’s picture

Status: Active » Needs review
StatusFileSize
new19.11 KB

About 2/3 ported. Here's another one to test the testbot.

rjacobs’s picture

StatusFileSize
new32.51 KB

Missed a file....

rjacobs’s picture

StatusFileSize
new32.12 KB

Here's a complete set of tests for the global features and field formatter.

  • rjacobs committed 5fd59af on 8.x-2.x
    Issue #2215229 by rjacobs: Add test coverage for global features and the...
rjacobs’s picture

Status: Needs review » Fixed

Ok, that's finally committed. Tests for views are pending because views support has not been ported yet. Those tests can be added as part of #2188157: D8 port views style plugin.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.