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

New feature - Add basic support for JUnit reports #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

scyzoryck
Copy link
Contributor

Hello!
I would like to add some basic support for JUnit reports - that becomes a nice standard for the showing reports from tests in tools like gitlab or junit. Here is some MVP PR for the basic support to show basic information about failed or passed tests.
Supported features:

  • amount of executed scenarios (test suites) and steps (test cases)
  • failure and error messages in report
    Result has been checked agains Jenkins schema.

Features that can be added in the future:

  • better naming - right now it shows raw scenario names - without resolved variables.
  • add time to the results

@lolautruche
Copy link
Contributor

Thanks @scyzoryck !
LGTM

Copy link
Contributor

@iamluc iamluc left a comment

Choose a reason for hiding this comment

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

Looks like a nice improvement!
Thanks @scyzoryck

@@ -60,6 +61,8 @@ protected function configure()
new InputOption('sandbox', '', InputOption::VALUE_NONE, 'Enable the sandbox mode', null),
new InputOption('ssl-no-verify', '', InputOption::VALUE_NONE, 'Disable SSL certificate verification', null),
new InputOption('blackfire-env', '', InputOption::VALUE_REQUIRED, 'The blackfire environment to use'),
new InputOption('junit', '', InputOption::VALUE_REQUIRED, 'Save output execution report as JUnit to file'),

Copy link
Contributor

Choose a reason for hiding this comment

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

extra line

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the description should mention that the value is the path to the file where the the output will be written.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code formatted, description improved.

Player/Console/PlayerCommand.php Outdated Show resolved Hide resolved
@@ -114,6 +118,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($input->getOption('disable-internal-network')) {
$player->addExtension(new DisableInternalNetworkExtension());
}
if ($junit) {
$junitExtension = new JUnitExtension();
Copy link
Contributor

Choose a reason for hiding this comment

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

As the XML extension is currently not a requirement of the player, we should add a runtime check and display a nice warning/error message if the extension is missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check added in line 86.

Copy link
Contributor

@iamluc iamluc left a comment

Choose a reason for hiding this comment

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

LGTM

Player/Console/PlayerCommand.php Outdated Show resolved Hide resolved
Co-authored-by: Jérôme Vieilledent <[email protected]>
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.

3 participants