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

Emit error when (configured) test directory does not exist #4493

Closed
bytestream opened this issue Oct 25, 2020 · 4 comments
Closed

Emit error when (configured) test directory does not exist #4493

bytestream opened this issue Oct 25, 2020 · 4 comments
Assignees
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Milestone

Comments

@bytestream
Copy link

Q A
PHPUnit version 8.5.8
PHP version 7.3.21
Installation Method Composer

Summary

--testsuite does not error when directory does not exist.

Current behavior

PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

No tests executed!

How to reproduce

phpunit.xml

<testsuite name="cache">
    <directory>test/cache</directory>
</testsuite>

Create test/Cache - note difference in capitalisation, and run:
./vendor/bin/phpunit --testsuite=cache --stop-on-failure

Expected behavior

phpunit should error:

Suite path test/cache could not be found 
@bytestream bytestream added the type/bug Something is broken label Oct 25, 2020
@bytestream
Copy link
Author

See https://github.com/bytestream/phpunit-4493 for minimal repository.

@sebastianbergmann
Copy link
Owner

This is consistent with what happens when --testsuite is not used.

@sebastianbergmann sebastianbergmann changed the title testsuite does not error when directory doesn't exist Emit error when (configured) test directory does not exist Oct 26, 2020
@sebastianbergmann sebastianbergmann added feature/test-runner CLI test runner type/enhancement A new idea that should be implemented and removed type/bug Something is broken labels Oct 26, 2020
@bytestream
Copy link
Author

It makes sense to error if an argument is invalid - otherwise it's difficult for people to debug. Paratest for example, throws a configuration exception in this case.

@bytestream
Copy link
Author

Thanks! 🎉

stronk7 added a commit to stronk7/moodle that referenced this issue Feb 28, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 3, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 3, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 5, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 5, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 5, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 5, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 6, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 6, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 6, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 6, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 9, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 9, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 11, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 11, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
stronk7 added a commit to stronk7/moodle that referenced this issue Mar 11, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed
with PHPUnit 10.

Since PHPUnit 8.5 custom autoloaders don't do much because that
version removed the ability to launch unit tests by class name
and that's exactly the reason we had a custom autoloader (to map
class names to files within our tests). See MDL-67673 about
when direct use of classes was deprecated (8.5), now removed (9.5).

So, as far as it's unused, removing it now, test still can be
selectively using any of:

- a relative path to file (although there are some restrictions comming
  with PHPUnit 9, see sebastianbergmann/phpunit#4105
- using --filter, to point to any classname[::method]
- using --testsuite to run a complete suite
- using --config to point to custom components.

Also, commented out the lib/ajax/tests directory because it doesn't
exist / is empty and PHPUnit 9 emits error when a configured test
directory does not exist. See
sebastianbergmann/phpunit#4493.

Alternative was to completely remove the configuration line, but
decided to keep it around in case some day we want to add some
test there.
This was referenced Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

2 participants