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

All CI runs are using the sqlite fallback connection instead of the expected driver #8532

Merged
merged 3 commits into from Mar 17, 2021

Commits on Mar 17, 2021

  1. Fix unit test and CI database driver / credential configuration

    Builds using the github actions phpunit.xml files were not properly
    recognising driver-specific configuration values, so were all
    falling back to use the in-memory sqlite database instead of the
    expected driver. This also meant a number of tests were skipped
    as they rely on functionality not available in sqlite.
    
    This commit addresses that by:
    
    * REMOVING the automatic fallback to the sqlite memory database -
      phpunit.xml must now always specify explicit parameters for the
      desired connection.
    
    * Displaying the active driver in the build output for visibility
      and debugging.
    
    * Changing the way TestUtil loads the database config in line
      with the equivalent logic in doctrine/dbal, and to support the
      way that the config is/was specified in the phpunit.xml files
      for CI.
    
    Note that this means a couple of the expected config variable names
    have changed. Developers that are using customised phpunit.xml files
    locally will need to update them to provide:
    
    * Database config variables if they want to use the sqlite/memory
      driver - see phpunit.xml.dist for details.
    * `db_driver` instead of `db_type`
    * `db_user` instead of `db_username`
    * `db_dbname` instead of `db_name`
    * And, if in use, the equivalent changes to the `tmpdb_` values
    
    The other change is that now if you provide any value for
    `db_driver` we will attempt to create that connection type and
    that will throw if other details (username / password / etc as
    required by the driver) are not provided. Previously providing
    partial configuration would cause TestUtil to silently fall back
    to the in-memory sqlite driver.
    acoulton committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    3e21c50 View commit details
    Browse the repository at this point in the history
  2. Upgrade previously-skipped tests to phpunit 9

    These tests had not been running in CI so missed the previous
    phpunit upgrade.
    
    Note that assertions in decimal/floaty values in GH7941Test have
    been changed to compare numerically with a reasonable level of
    precision, instead of using regex. This is because the types
    returned by the different drivers are inconsistent, and phpunit
    now only allows regex comparisons on strings.
    acoulton committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    dd34bca View commit details
    Browse the repository at this point in the history
  3. Rename tmpdb_ to privileged_db in test config and TestUtil

    To avoid confusion, the `tmpdb_` test config values are now named
    `privileged_db_` and better documented in the phpunit.xml.dist.
    
    The TestUtil class has been refactored to more closely mirror the
    structure and method / variable naming of the equivalent in
    doctrine/dbal. This does not introduce any significant functional
    changes. The only real difference is that the test output now prints
    the selected database driver the first time it is referenced,
    rather than repeating this through the test run.
    acoulton committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    61c4a5d View commit details
    Browse the repository at this point in the history