Skip to content

Redundant "runtime" directory generated on test execution #6

@Faheem-maker

Description

@Faheem-maker

Task Description

When we run tests using composer test, it automatically generates a directory called protected/runtime. The directory doesn't serve any purposes and should not be generated during testing.

Steps to Reproduce

  1. Clone the repository and run composer install
  2. Run composer test to run the tests
  3. Check tests folder to find a new subfolder, called runtime

Implementation Guidance

When instantiating the \framework\components\Logger component, a FileLogger instance is generated, which is responsible for creating the directory.

These are the steps we can take to safely resolve it:

  1. Create a new interface (e.g. LogDriver) and implement it for FileLogger.
  2. Remove the log driver from helpers.php and register it within the test directory
  3. Allow the Logger component to accept an optional driver parameter
  4. Modify the test to mock an implementation of the interface, then inject it within the component

Acceptance Criteria

Please test the following before making a pull request:

  1. Run composer test to ensure that all tests are passing
  2. Make sure that no tests are removed or added, and Logger component remains above 90% coverage
  3. Ensure that FileLogger class is not changed, unless you have a valid reason

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions