At the moment we do not have a good way to switch between minor version of php.
there is the DCI_PHPInterpreter variable, but this is not being used consistently.

With the current option we can either use phpenv like so
phpenv global 5.5.23
or set
DCI_PHPInterpreter='/opt/phpenv/versions/5.5.23/bin/php'

There have been some concerns with using phpenv #2567241: get rid of phpenv

Either way, we should probably consistently use the DCI_PHPInterpreter variable in the drupalci.yml

Comments

isntall created an issue. See original summary.

isntall’s picture

Issue summary: View changes

  • jthorson committed 88500ae on 2568299-use-DCI_PHPInterpreter
    Issue #2568299 by jthorson: Use DCI_PHPInterpreter
    
jthorson’s picture

Status: Active » Needs review

Pushed branch 2568299-use-DCI_PHPInterpreter to the repo

jthorson’s picture

Needs review for the PHP Interpreter change, which is step 1.

Then should go back to active for the actual switching versions functionality.

isntall’s picture

Status: Needs review » Reviewed & tested by the community

looks good.

  • jthorson committed 60e460a on 2568299-support-multiple-minor-php-versions
    Issue #2568299 by jthorson: use phpenv to switch betwen multiple minor...
  • jthorson committed 88500ae on 2568299-support-multiple-minor-php-versions
    Issue #2568299 by jthorson: Use DCI_PHPInterpreter
    
jthorson’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +D8 Accelerate, +Barcelona2015

Back to 'needs review' for the actual implementation (versus earlier 'pre-requisite' work).

  • jthorson committed ea74362 on 2568299-support-multiple-minor-php-versions
    Issue #2568299 by jthorson: Use DCI_PHPInterpreter
    
jthorson’s picture

Up-to-date with dev as of March 12th ...

mile23’s picture

Status: Needs review » Needs work

Trying to rebase for dev.. It looks like this removes the testcommand step and adds the run-tests.sh command back to the command step. Also removes the phantomJS work.

It also introduces DCI_PHPInterpreter which needs some coverage from functional tests.

So it needs a functional test where you run a test specifying a minimum version using DCI_PHPInterpreter, and another test with another minimum version. Probably using php 5.5.9 and 5.5.MAX since that's the minimum for Drupal 8.1.x.

jthorson’s picture

Trying to rebase for dev.. It looks like this removes the testcommand step and adds the run-tests.sh command back to the command step. Also removes the phantomJS work.

Nope ... you must have fouled up your rebase:
phantomJS: http://cgit.drupalcode.org/drupalci_testbot/tree/src/DrupalCI/Plugin/Job...
testcommand: http://cgit.drupalcode.org/drupalci_testbot/tree/src/DrupalCI/Plugin/Job...

It also introduces DCI_PHPInterpreter which needs some coverage from functional tests.

Suggested by, manually demonstrated to, and RTBC'd by Archie in Barcelona, as per comment #6. Adding a functional end-to-end test run to prove that abstraction of the php binary via variable substitution works is severe overkill ... the test run either finds PHP or it doesn't. There is no risk of 'subtle' breakage here.

So it needs a functional test where you run a test specifying a minimum version using DCI_PHPInterpreter, and another test with another minimum version. Probably using php 5.5.9 and 5.5.MAX since that's the minimum for Drupal 8.1.x.

The only 'functional test' we can do right now is an end-to-end test run. If we require a new automated end-to-end test run for every variable substitution scenario we come up with, then it won't be long before it takes six hours to run the test suite. :/ In any case, see the attached files (search for php -v).

jthorson’s picture

Status: Needs work » Needs review

Updated branch (again).

mile23’s picture

Status: Needs review » Needs work

Adding a functional end-to-end test run to prove that abstraction of the php binary via variable substitution works is severe overkill ... the test run either finds PHP or it doesn't. There is no risk of 'subtle' breakage here.

That's not what I mean.

You have to prove that it works, and the way to do that is to write a test so that we can continue to prove that it works when we change it and change things around it.

There's this line in the definition: - %DCI_PHPInterpreter% -v so you can write a functional test that looks for the PHP version in the command display and verify that it changed.

jthorson’s picture

I proved the DCI_PHPInterpreter addition (along with the rest of the changes) works via the attached log files. I'm opposed to adding a new functional test for every variable substitution, because each of those requires a new test run ... quickly bloating the time it takes to execute the full test suite.

The counter that we need these automated so that we can prevent 'hidden' regressions doesn't hold a lot of weight here, specifically; the only potential break with the DCI_PHPInterpreter substitution commit here (which is what the quoted comment was directed at) is 'PHP not found'. Yes, this substitution needs to be tested, along with every other job definition plugin ... but only to the extent that it proves the variable substitution occurs - a new 'functional' test for every one of these definition preprocessor plugins is what I'm saying is overkill.

In the absence of a framework that enables the definition pre-processor plugin tests today, we should not be encouraging adding minutes to our test suite execution time for every two-line patch; when manual proof has been provided and the risk of 'subtle' regressions is, as it is in this case, essentially zero. (Again, I'm talking specifically about the addition of DCI_PHPInterpreter here.)

  • jthorson committed 66a01b6 on 2568299-support-multiple-minor-php-versions
    Issue #2568299 by jthorson: Use DCI_PHPInterpreter
    
  • jthorson committed a2c33a1 on 2568299-support-multiple-minor-php-versions authored by Mixologic
    Revert "Issue #2568299 by jthorson: Use DCI_PHPInterpreter"
    
    This...

  • Mixologic committed 9c3bea8 on 2568299-support-multiple-minor-php-versions
    Revert "Issue #2568299 by jthorson: Use DCI_PHPInterpreter"
    
    This...
  • jthorson committed ac9ff63 on 2568299-support-multiple-minor-php-versions
    Issue #2568299 by jthorson: Use DCI_PHPInterpreter
    
  • jthorson committed fe2a365 on 2568299-support-multiple-minor-php-versions authored by Mixologic
    Revert "Issue #2568299 by jthorson: Use DCI_PHPInterpreter"
    
    This...
drunken monkey’s picture

Title: switching between minor versions » Switching between minor versions of PHP

Clarifying the title.

Mixologic’s picture

Component: DrupalCI console script » Environments
elachlan’s picture

Project: DrupalCI: Test Runner » DrupalCI: Environments
Component: Environments » Code

Moved to DrupalCI Environments.

Mixologic’s picture

Component: Code » PHP Containers
Status: Needs work » Closed (won't fix)

We've removed both PHPInterpreter and phpenv, and have individual containers per php version.