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

A test with the one example or data provider item by number parameter does not run when it is in a group and is run with the parameter --group #6660

Open
rossokhinDaniil opened this issue Apr 13, 2023 · 2 comments

Comments

@rossokhinDaniil
Copy link

What are you trying to achieve?

Hello! I'm trying to run one example or data provider item by number which belongs to a specific group, but I'm not getting it.

What do you get instead?

I have a group file paracept_test_1 which contains one example or data provider item by number - "tests\acceptance\reserve\NormalReserveCest.php:individualCashOffice#0"

When running the command C:\TestAutomation\testing\vendor\bin\codecept.bat run acceptance "tests\acceptance\reserve\NormalReserveCest.php:individualCashOffice#0" --html result_1.html everything works for me and the test is launched with certain parameters DataProvider.

But if I run the command C:\TestAutomation\testing\vendor\bin\codecept.bat run acceptance --group paracept_test_1 --html result_1.html then I get the error "No tests executed"

Provide console output if related. Use -vvv mode for more details.

# paste output here

Provide test source code if related

// paste test

Details

  • Codeception version: 5.0.10
  • PHP Version: 8.1
  • Operating System: Windows 11
  • Installation type: Composer
  • List of installed packages (composer show)

allure-framework/allure-codeception v2.1.0 Allure Codeception integration
allure-framework/allure-php-commons v2.2.0 Allure PHP commons
behat/gherkin v4.9.0 Gherkin DSL parser for PHP
brick/math 0.10.2 Arbitrary-precision arithmetic library
codeception/codeception 5.0.10 BDD-style testing framework
codeception/lib-asserts 2.1.0 Assertion methods used by Codeception core and Asserts module
codeception/lib-innerbrowser 3.1.3 Parent library for all Codeception framework modules and PhpBrowser
codeception/lib-web 1.0.1 Library containing files used by module-webdriver and lib-innerbrowser or module-phpbrowser
codeception/lib-xml 1.0.1 Files used by module-rest and module-soap
codeception/module-asserts 3.0.0 Codeception module containing various assertions
codeception/module-db 3.1.0 DB module for Codeception
codeception/module-mongodb 3.0.0 MongoDB module for Codeception
codeception/module-phpbrowser 2.5.0 Codeception module for testing web application over HTTP
codeception/module-rest 3.3.2 REST module for Codeception
codeception/module-webdriver 3.2.1 WebDriver module for Codeception
codeception/robo-paracept 3.1.0 Codeception Parallel Execution Tasks via Robo Task Runner
codeception/specify 2.0.0 BDD code blocks for PHPUnit and Codeception
codeception/stub 4.1.0 Flexible Stub wrapper for PHPUnit's Mock Builder
codeception/verify 3.0.0 BDD assertion library for PHPUnit
composer/pcre 3.1.0 PCRE wrapping library that offers type-safe preg_* replacements.
composer/semver 3.3.2 Semver library that offers utilities, version constraint parsing and validation.
composer/xdebug-handler 3.0.3 Restarts a process without Xdebug.
consolidation/annotated-command 4.8.2 Initialize Symfony Console commands from annotated command class methods.
consolidation/config 2.1.2 Provide configuration services for a commandline tool.
consolidation/log 3.0.0 Improved Psr-3 / Psr\Log logger based on Symfony Console components.
consolidation/output-formatters 4.2.4 Format text by applying transformations provided by plug-in formatters.
consolidation/robo 4.0.3 Modern task runner
consolidation/self-update 2.1.0 Provides a self:update command for Symfony Console applications.
dflydev/dot-access-data v3.0.2 Given a deep data structure, access data by dot notation.
doctrine/annotations 2.0.1 Docblock Annotations Parser
doctrine/instantiator 2.0.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer 3.0.0 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
ezyang/htmlpurifier v4.16.0 Standards compliant HTML filter written in PHP
friendsofphp/php-cs-fixer v3.16.0 A tool to automatically fix PHP code style
graham-campbell/result-type v1.1.1 An Implementation Of The Result Type
grasmash/expander 3.0.0 Expands internal property references in PHP arrays file.
guzzlehttp/guzzle 7.5.0 Guzzle is a PHP HTTP client library
guzzlehttp/promises 1.5.2 Guzzle promises library
guzzlehttp/psr7 2.4.4 PSR-7 message implementation that also provides common utility methods
jean85/pretty-package-versions 2.0.5 A library to get pretty versions strings of installed dependencies
justinrainbow/json-schema 5.2.12 A library to validate a json schema.
league/container 4.2.0 A fast and intuitive dependency injection container.
maennchen/zipstream-php v2.4.0 ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.
markbaker/complex 3.0.2 PHP Class for working with complex numbers
markbaker/matrix 3.0.1 PHP Class for working with matrices
mongodb/mongodb 1.15.0 MongoDB driver library
myclabs/deep-copy 1.11.1 Create deep copies (clones) of your objects
myclabs/php-enum 1.8.4 PHP Enum implementation
nikic/php-parser v4.15.4 A PHP parser written in PHP
phar-io/manifest 2.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 3.2.1 Library for handling version information and constraints
phootwork/collection v3.2.1 The phootwork library fills gaps in the php language and provides better solutions than the existing ones php offers.
phootwork/lang v3.2.1 Missing PHP language constructs
php-webdriver/webdriver 1.14.0 A PHP client for Selenium WebDriver. Previously facebook/webdriver.
phpoffice/phpspreadsheet 1.28.0 PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpoption/phpoption 1.9.1 Option Type for PHP
phpowermove/docblock v4.0 PHP Docblock parser and generator. An API to read and write Docblocks.
phpunit/php-code-coverage 9.2.26 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator 3.0.6 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker 3.1.1 Invoke callables with a timeout
phpunit/php-text-template 2.0.4 Simple template engine.
phpunit/php-timer 5.0.3 Utility class for timing
phpunit/phpunit 9.6.6 The PHP Unit Testing framework.
psr/cache 3.0.0 Common interface for caching libraries
psr/container 2.0.2 Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher 1.0.0 Standard interfaces for event handling.
psr/http-client 1.0.2 Common interface for HTTP clients
psr/http-factory 1.0.2 Common interfaces for PSR-7 HTTP message factories
psr/http-message 1.1 Common interface for HTTP messages
psr/log 3.0.0 Common interface for logging libraries
psr/simple-cache 3.0.0 Common interfaces for simple caching
psy/psysh v0.11.15 An interactive shell for modern PHP.
ralouphie/getallheaders 3.0.3 A polyfill for getallheaders.
ramsey/collection 2.0.0 A PHP library for representing and manipulating collections.
ramsey/uuid 4.7.3 A PHP library for generating and working with universally unique identifiers (UUIDs).
redcomponent/teststatistics dev-master 68a2ede Codeception Extension to measure the performance of your tests
sebastian/cli-parser 1.0.1 Library for parsing CLI options
sebastian/code-unit 1.0.8 Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup 2.0.3 Looks up which function or method a line of code belongs to
sebastian/comparator 4.0.8 Provides the functionality to compare PHP values for equality
sebastian/complexity 2.0.2 Library for calculating the complexity of PHP code units
sebastian/diff 4.0.4 Diff implementation
sebastian/environment 5.1.5 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 4.0.5 Provides the functionality to export PHP variables for visualization
sebastian/global-state 5.0.5 Snapshotting of global state
sebastian/lines-of-code 1.0.3 Library for counting the lines of code in PHP source code
sebastian/object-enumerator 4.0.4 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 2.0.4 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 4.0.5 Provides functionality to recursively process PHP variables
sebastian/resource-operations 3.0.3 Provides a list of PHP built-in functions that operate on resources
sebastian/type 3.2.1 Collection of value objects that represent the types of the PHP type system
sebastian/version 3.0.2 Library that helps with managing the version number of Git-hosted PHP projects
smalot/pdfparser v2.4.0 Pdf parser library. Can read and extract information from pdf file.
softcreatr/jsonpath 0.8.2 JSONPath implementation for parsing, searching and flattening arrays
symfony/browser-kit v4.4.44 Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically
symfony/console v6.2.8 Eases the creation of beautiful and testable command line interfaces
symfony/css-selector v6.2.7 Converts CSS selectors to XPath expressions
symfony/deprecation-contracts v3.2.1 A generic function and convention to trigger deprecation notices
symfony/dom-crawler v5.4.22 Eases DOM navigation for HTML and XML documents
symfony/event-dispatcher v6.2.8 Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts v3.2.1 Generic abstractions related to dispatching event
symfony/filesystem v6.2.7 Provides basic utilities for the filesystem
symfony/finder v6.2.7 Finds files and directories via an intuitive fluent interface
symfony/options-resolver v6.2.7 Provides an improved replacement for the array_replace PHP function
symfony/polyfill-ctype v1.27.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme v1.27.0 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-normalizer v1.27.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring v1.27.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php80 v1.27.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/polyfill-php81 v1.27.0 Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
symfony/process v6.2.8 Executes commands in sub-processes
symfony/service-contracts v3.2.1 Generic abstractions related to writing services
symfony/stopwatch v6.2.7 Provides a way to profile code
symfony/string v6.2.8 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
symfony/var-dumper v6.2.8 Provides mechanisms for walking through any arbitrary PHP variable
symfony/yaml v6.2.7 Loads and dumps YAML files
theseer/tokenizer 1.2.1 A small library for converting tokenized PHP source code into XML and potentially other formats
vlucas/phpdotenv v5.5.0 Loads environment variables from .env to getenv(), $_ENV and $_SERVER automagically.

  • Suite configuration:
# paste suite config here
@Naktibalda
Copy link
Member

It seems that test filter by command line parameter is not related to test filterby group settings.

Test filter by group settings is implemented at

foreach ($this->testsInGroups as $group => $tests) {
foreach ($tests as $testPattern) {
if ($filename == $testPattern) {
$groups[] = $group;
}
if (str_starts_with($filename . ':' . $testName, (string)$testPattern)) {
$groups[] = $group;
}
if (
$test instanceof Gherkin
&& mb_strtolower($filename . ':' . $test->getMetadata()->getFeature()) === mb_strtolower($testPattern)
) {
$groups[] = $group;
}
}
}
return array_unique($groups);

Test filter by command line parameter is implemented at https://github.com/Codeception/Codeception/blob/ed4af7fd4103cdd035916fbb8f35124edd2d018b/src/Codeception/Test/Filter.php

@rossokhinDaniil
Copy link
Author

No plans to add this to the groups filter too?

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

No branches or pull requests

2 participants