Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #7621 - Add support for config_override.test.php #7808

Merged
merged 2 commits into from Oct 3, 2019

Conversation

Dillon-Brown
Copy link
Contributor

Description

Motivation and Context

Issue reference: #7621

How To Test This

  1. Check Travis
  2. Add a tests/config.test.php file and then give it a custom value like so:
$testConfig = [
    'imap_test' => true,
];
  1. Check that the custom config only runs during the test suite execution and overrides the config.php and config_override.php values.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@codecov-io
Copy link

codecov-io commented Sep 4, 2019

Codecov Report

❗ No coverage uploaded for pull request base (hotfix-7.10.x@38d2933). Click here to learn what that means.
The diff coverage is 0%.

@@               Coverage Diff                @@
##             hotfix-7.10.x    #7808   +/-   ##
================================================
  Coverage                 ?    7.28%           
================================================
  Files                    ?     3700           
  Lines                    ?   386196           
  Branches                 ?        0           
================================================
  Hits                     ?    28132           
  Misses                   ?   358064           
  Partials                 ?        0

@connorshea
Copy link
Contributor

We should probably have a config.test.example.php or config.test.dist.php file in the repo for users to copy from. :)

Just this should be fine? Maybe a comment explaining what it's for.

<?php
$testConfig = [
    'imap_test' => true,
];

This'll be great, thank you! ❤️

@cameronblaikie
Copy link
Contributor

Assessed 👍

@cameronblaikie cameronblaikie added Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status:Requires Updates Issues & PRs which requires input or update from the author labels Sep 18, 2019
@cameronblaikie
Copy link
Contributor

Needs input from @Dillon-Brown before merging :D.

@Dillon-Brown Dillon-Brown removed the Status:Requires Updates Issues & PRs which requires input or update from the author label Sep 23, 2019
@cameronblaikie
Copy link
Contributor

Assessed 👍

Copy link
Contributor

@connorshea connorshea left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@connorshea connorshea mentioned this pull request Sep 26, 2019
// Load up the config.test.php file. This is used to define configuration values for the test environment.
$testConfig = [];

if (is_file($root . 'tests/config.test.php')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

it occurs to me now, wouldn't this effect all the Robo tasks that use CliRunnerTrait?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also: when I run ./vendor/bin/robo tests:unit, at least on the StateChecker-removal branch, the config.php file is overwritten by the contents of the config.test.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants