1

This questions is specifically about my sandbox project. I have PHPUnit running on other full projects that I maintain.

I have created a sandbox project, fully uploaded to drupal.org, for 8.x and 9.x testing. But there is no "Automated testing" tab on the project page, like there is with full projects. What has to be done to enable testing on drupal.org?

The project has a composer.json, .info.yml and drupalci.yml. My phpunit tests run locally. Everything looks fine. I have searched drupal.org docs https://www.drupal.org/node/1011196 and it does not say that phpunit testing is not available for sandbox projects.

0

1 Answer 1

3

Given the following comment I found on Can enable tests for sandbox projects, testing is disabled on sandbox projects, which means you cannot enable automatic tests on sandbox projects.

From pift_project_visibility():

if (!empty($node->field_project_has_releases[LANGUAGE_NONE][0]['value'])) {
// Ensure user has the 'access project testing tab' permission
if (user_access('access pift project testing tab')) {
  return TRUE;
}

}

So as long as the releases piece is taken care of, the 'enable' checkbox should never appear (and thus users will not be able to enable testing).

The issue has been created in the project that handles the automatic testing for projects hosted on drupal.org. The comment says that the automatic tests are enabled for the projects with enabled releases. Sandbox projects don't have releases enabled, so also the automatic tests are disabled.

As Drupal.org Git administrator I can confirm that none of the sandbox projects has the Automated testing tab, which I instead see on full projects. (It's not a matter of permissions, as my role on Drupal.org allows me to set automatic tests for any project.)

To answer How did you enable automated testing on this sandbox project? that project has automatic tests enabled because it's a full project, despite the project name. I can say that because the path alias automatically set for a sandbox project is similar to https://www.drupal.org/sandbox/grayside/1876908, the path alias for the #Heading module. Furthermore, a sandbox project has a Promote tab as in the following screenshot.

screenshot

For the other project, this is what I see.

screenshot

3
  • Thanks @kiamlaluno I presume there is no plan to allow automated testing on sandbox projects? It would really help at the moment for D9 testing where I don't want to confuse the real module code with temporary commits, but some patches need to patch composer.json to allow the D9 tests to even run (such as removing require-dev for modules which cannot be installed on 9.x) Commented Apr 6, 2020 at 17:16
  • 1
    The idea behind sandbox projects was allowing users to create projects before they applied to be able to create full projects. Now that every user is able to create full projects, there are very few reasons for enabling testing on sandbox projects. I am not sure it would be technically possible; probably, automatic testing requires releases, which will never be enabled for sandbox projects.
    – avpaderno
    Commented Apr 6, 2020 at 18:15
  • Thanks. kiamlaluno has also posted useful info on drupal.org/project/captchasandbox/issues/3125275 Commented Apr 7, 2020 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.