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

Exception in one formatter prevents other formatters from working #803

Closed
alemak opened this issue Nov 25, 2014 · 1 comment · Fixed by #842
Closed

Exception in one formatter prevents other formatters from working #803

alemak opened this issue Nov 25, 2014 · 1 comment · Fixed by #842

Comments

@alemak
Copy link

alemak commented Nov 25, 2014

I have encountered this when trying to run RerunFormatter in cucumber-jvm 1.2.0 together with IntelliJ's org.jetbrains.plugins.cucumber.java.run.CucumberJvmSMFormatter. If the IntelliJ formatter is added before the RerunFormatter, the RerunFormatter does not work. The problem is that CucumberJvmSMFormatter does not support new Formatter methods like startOfScenarioLifeCycle and endOfScenarioLifeCycle. These methods are invoked in a loop for each plugin (formatter) by the pluginProxy method in RuntimeOptions so if one plugin throws an exception - the code exits from the loop and the methods of plugins after the offending one are not called.
Also in the CucumberScenario class's 'run' method the exception from startOfScenarioLifeCycle and endOfScenarioLifeCycle are caught silently which makes it very difficult to understand what is happening and why other plugins are not working:

cucumber.runtime.model.CucumberSenario

try {
        formatter.startOfScenarioLifeCycle((Scenario) getGherkinModel());
    } catch (Throwable ignore) {
        // IntelliJ has its own formatter which doesn't yet implement this.
    }

The solution would probably be to catch the exceptions in pluginProxy loop so that all plugins have their methods invoked, or at least provide the output from the exception so that the problem could be detected more easily.

brasmusson added a commit to brasmusson/cucumber-jvm that referenced this issue Mar 15, 2015
The IntelliJ formatter does not implement the startOfScenarioLifeCycle
and the endOfScenarioLifeCycle methods. Also when it is throwing an
exception on these methods, all other formatters used need to be called
on these methods.
brasmusson added a commit to brasmusson/cucumber-jvm that referenced this issue Mar 15, 2015
The IntelliJ formatter does not implement the startOfScenarioLifeCycle
and the endOfScenarioLifeCycle methods. Also when it is throwing an
exception on these methods, all other formatters used need to be called
on these methods.
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant