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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve file path detection for groups #5609

Merged
merged 1 commit into from Aug 4, 2019
Merged

Improve file path detection for groups #5609

merged 1 commit into from Aug 4, 2019

Conversation

adaniloff
Copy link
Contributor

What are you trying to achieve?

Hi there,
I was trying to add some groups to my suites but I encountered a weird case: some groups were unable to load tests, and some were able to do.

After some investigation, I found out that this case occurs :

  • when you set your suite path to .
  • when you define groups directly in your suite config file

馃檲 no problem happens if you use annotation directly in your test files.

What do you get instead?

The binary does not run the tests.

application@356115a48d2a:/app$ php vendor/bin/codecept run -g api-package
Codeception PHP Testing Framework v3.0.0
Powered by PHPUnit 7.5.9 by Sebastian Bergmann and contributors.
Running with seed:

[Groups] api-package

Api Tests (0) -------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------

Time: 251 ms, Memory: 26.00 MB

No tests executed!

Details

  • Codeception version: 3.0.0
  • PHP Version: 7.2.15
  • Operating System: Debian
  • Installation type: Composer
  • Suite configuration:
suites:
    api:
        actor: ApiTester
        path: .
        modules:
            enabled:
                - Symfony:
                    app_path: 'app'
                    environment: 'test'
                    kernel_class: MicroKernel
                - REST:
                    depends: Symfony
                - Doctrine2:
                    depends: Symfony
                - \Helper\ILoveMyHelper
        error_level: "E_ALL & ~E_STRICT & !E_DEPRECATED"
paths:
    tests: tests
    output: tests/_output
    data: tests/_data
    support: tests/_support

settings:
    shuffle: false
    lint: true

groups:
    api: [tests/]
    api-package: [tests/./package] # this works fine
    api-package-2: [tests/package] # this does not work without the fix

#### What are you trying to achieve?

Hi there, 
I was trying to add some groups to my suites but I encountered a weird case: some groups were unable to load tests, and some were able to do.

After some investigation, I found out that this case occurs :
- when you set your suite path to `.`
- when you define groups directly in your suite config file

馃檲 no problem happens if you use annotation directly in your test files.

#### What do you get instead?

The binary does not run the tests.

```bash
application@356115a48d2a:/app$ php vendor/bin/codecept run -g api-package
Codeception PHP Testing Framework v3.0.0
Powered by PHPUnit 7.5.9 by Sebastian Bergmann and contributors.
Running with seed:

[Groups] api-package

Api Tests (0) -------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------

Time: 251 ms, Memory: 26.00 MB

No tests executed!
```

### Details

* Codeception version: 3.0.0
* PHP Version: 7.2.15
* Operating System: Debian
* Installation type: Composer
* Suite configuration:

```yml
suites:
    api:
        actor: ApiTester
        path: .
        modules:
            enabled:
                - Symfony:
                    app_path: 'app'
                    environment: 'test'
                    kernel_class: MicroKernel
                - REST:
                    depends: Symfony
                - Doctrine2:
                    depends: Symfony
                - \Helper\ILoveMyHelper
        error_level: "E_ALL & ~E_STRICT & !E_DEPRECATED"
paths:
    tests: tests
    output: tests/_output
    data: tests/_data
    support: tests/_support

settings:
    shuffle: false
    lint: true

groups:
    api: [tests/]
    api-package: [tests/./package] # this works fine
    api-package-2: [tests/package] # this does not work without the fix
```
Copy link
Member

@Naktibalda Naktibalda left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@Naktibalda Naktibalda merged commit 1dfda0a into Codeception:3.0 Aug 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants