Skip to content

QOL: Should we create a project level config file? #138

@almasaeed2010

Description

@almasaeed2010

In multiple of my projects, I tend to change the structure of where my tests should go by default if no path has been specified. Since the majority of my tests go to tests/Feature, I want that to be the default path. However, there isn't currently a way to do this without messing with the script directly. Another use case would be to specify the base class. Since issue #135 is not backwards compatible, we could still make it happen without breaking anyone's tests by adding that as an option in the project level config file.

The file would simply be a JSON file:

.testsuite.json

{
  "base_class": "Tests\\TestCase",
  "base_path": "tests/Feature"
}

We could also easily allow for path options:

{
  "base_path": "tests/Feature",
  "paths": {
    "--unit": "tests/Unit",
    "--core": "tests/tripal",
    "--chado": "tests/tripal_chado"
  }
}

Then, for example, to create a chado importer test:

# Creates a test at tests/tripal_chado/importers/MyTest.php with the proper namespace
tripaltest make:test --chado importers/MyTest

The resulting class would have the namespace:

namespace Tests\tripal_chado\importers;

If no path option is specified, base_path is used as the default or, if not provided, simply use the base tests folder.

Any thoughts? Other options to consider?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions