Skip to content

Capture environment details when running the test suite#26

Merged
danielbachhuber merged 2 commits intoWordPress:masterfrom
danielbachhuber:19-env-details
Jul 26, 2017
Merged

Capture environment details when running the test suite#26
danielbachhuber merged 2 commits intoWordPress:masterfrom
danielbachhuber:19-env-details

Conversation

@danielbachhuber
Copy link
Copy Markdown
Member

Fixes #19

@danielbachhuber
Copy link
Copy Markdown
Member Author

@octalmage Produces output like this:

$ cat wp-test-runner/tests/phpunit/build/logs/env.json
{
    "php_version": "5.6.29",
    "php_modules": {
        "imagick": "3.4.3",
        "filter": "0.11.0",
        "xml": false,
        "pcre": false,
        "mod_xml": false,
        "bcmath": false
    },
    "system_utils": {
        "imagemagick": "6.7.7-10",
        "ghostscript": "9.05"
    }
}

@danielbachhuber danielbachhuber mentioned this pull request Jul 19, 2017
@danielbachhuber
Copy link
Copy Markdown
Member Author

For the record, I put the system reporting mechanism in wp-tests-config.php so we didn't have to make an extra SSH call in test.php. It will run automatically when the test suite is run.

Comment thread prepare.php
\$env['system_utils']['ghostscript'] = shell_exec( 'gs --version' );
file_put_contents( __DIR__ . '/tests/phpunit/build/logs/env.json', json_encode( \$env, JSON_PRETTY_PRINT ) );
EOT;
$logger_replace_string = '// wordpress/wp-config.php will be ignored.' . PHP_EOL;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this cause an issue if it's ran on Windows and the wp-tests-config has a unix newline?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if the file was saved on Windows. Is this a use-case we need to solve for?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not! Lets get this merged so I can pull the changes into the report branch.

@danielbachhuber danielbachhuber merged commit 1e0d36a into WordPress:master Jul 26, 2017
@danielbachhuber danielbachhuber deleted the 19-env-details branch July 26, 2017 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants