Visitar URL original
Highlight that configuration file did not define any suites · Issue #6955 · Codeception/Codeception · GitHub
Skip to content

Highlight that configuration file did not define any suites #6955

Description

@llaville

Today, I've upgraded one of my project (not yet public) that define a basic configuration template file codeception.yml as follow :

bootstrap: bootstrap.php
namespace: Tests
support_namespace: Support
paths:
    tests: ../../tests
    output: ../../tests/_output
    data: ../../tests/Support/Data
    support: ../../tests/Support
    envs: ../../tests/_envs
actor_suffix: Tester
extensions:
    enabled:
        - Codeception\Extension\RunFailed

As my project is a PHP Package Template, there is nothing really concrete inside.

The current tests folder contents is :

tests/
├── bootstrap.php
└── _output

2 directories, 1 file

The bootstrap.php file is used only to load the Composer autoloader

When I run following command :

vendor/bin/codecept config:validate --config .github/linters/codeception.yml

It gave me :

Validating global config... Ok
------------------------------

Codeception Config:

Array
(
    bootstrap => bootstrap.php
    namespace => Tests
    support_namespace => Support
    paths => Array
        (
            tests => ../../tests
            output => ../../tests/_output
            data => ../../tests/Support/Data
            support => ../../tests/Support
            envs => ../../tests/_envs
        )

    actor_suffix => Tester
    extensions => Array
        (
            enabled => Array
                (
                    0 => Codeception\Extension\RunFailed
                )

            config => Array
                (
                )

            commands => Array
                (
                )

        )

    include => Array
        (
        )

    extends =>
    suites => Array
        (
        )

    modules => Array
        (
        )

    groups => Array
        (
        )

    settings => Array
        (
            colors => 1
            bootstrap =>
            strict_xml =>
            lint => 1
            backup_globals => 1
            report_useless_tests =>
            be_strict_about_changes_to_global_state =>
            shuffle =>
        )

    coverage => Array
        (
        )

    params => Array
        (
        )

    gherkin => Array
        (
        )

)

Directories:
codecept_root_dir()   /shared/backups/bartlett/harmony-package-template/.github/linters/
codecept_output_dir() /shared/backups/bartlett/harmony-package-template/.github/linters/../../tests/_output/
codecept_data_dir()   /shared/backups/bartlett/harmony-package-template/.github/linters/../../tests/Support/Data/

Available suites:
Execute codecept config:validate [<suite>] to see config for a suite

Works as expected, but I'd like to have a warning if none suite defined.

Perharps something like

Image

What do you think about it ?

Activity

  1. llaville commented on Oct 7, 2026

    @llaville
    ContributorAuthor

    The patch to see it, is

    diff --git a/src/Codeception/Command/ConfigValidate.php b/src/Codeception/Command/ConfigValidate.php
    index 770ea6382..f82e01363 100644
    --- a/src/Codeception/Command/ConfigValidate.php
    +++ b/src/Codeception/Command/ConfigValidate.php
    @@ -12,6 +12,7 @@
     use Symfony\Component\Console\Input\InputOption;
     use Symfony\Component\Console\Output\OutputInterface;
    
    +use Symfony\Component\Console\Style\SymfonyStyle;
     use function codecept_data_dir;
     use function codecept_output_dir;
     use function codecept_root_dir;
    @@ -90,6 +91,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
    
             $output->writeln("<info>Available suites</info>: " . implode(', ', $suites));
    
    +        if (\count($suites) === 0) {
    +            $io = new SymfonyStyle($input, $output);
    +            $io->warning("No suites configured");
    +        }
    +
             foreach ($suites as $suite) {
                 $output->write("Validating suite <bold>{$suite}</bold>... ");
                 $this->getSuiteConfig($suite);
    
  2. llaville commented on Oct 7, 2026

    @llaville
    ContributorAuthor

    More easy to quickly understand that no suites are defined, when you run and got this

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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