Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No execution result available via api #171

Open
ajoecker opened this issue Jul 24, 2018 · 2 comments
Open

No execution result available via api #171

ajoecker opened this issue Jul 24, 2018 · 2 comments

Comments

@ajoecker
Copy link
Contributor

Expected behavior

When using the api, I expect to be able to retrieve result information such as the reason of failure.

Actual behavior

No result information is available

Steps to reproduce

When creating a Java report plugin, the code listens to messages dispatched from gauge, like

if (message.getMessageType() == Messages.Message.MessageType.ScenarioExecutionEnding) {
    String stacktrace = message.getExecutionEndingRequest().getCurrentExecutionInfo().getStacktrace(); // this is empty
    Spec.ProtoExecutionResult executionResult = message.getExecutionStatusResponse().getExecutionResult(); // this is empty
    // executionResult would contain information about reason of failure or execution time
    Messages.ScenarioInfo scenario = message.getScenarioExecutionEndingRequest().getCurrentExecutionInfo().getCurrentScenario();
    boolean isFailed = scenario.getIsFailed(); // is the only information available

 } else if(message.getMessageType() == Messages.Message.MessageType.ExecutionStatusResponse) {
       // this is never called
 }

Gauge version

$ gauge -v
Gauge version: 1.0.0
Commit Hash: 5a99965

Plugins
-------
flash (0.0.1)
html-report (4.0.4)
java (0.6.8)
screenshot (0.0.1)
spectacle (0.1.2)
xml-report (0.2.0).
@ajoecker
Copy link
Contributor Author

I do get all information that I would need, when listening to ExecuteStep, there the message carries the failure information.

But this does not help me to know on scenario level

@ajoecker
Copy link
Contributor Author

ajoecker commented Jul 30, 2018

when switching on --machine-readable i get

{"type":"scenarioEnd","id":"C:\\Users\\ajoecker\\dev\\gauge-init\\specs\\example.spec:4","parentId":"C:\\Users\\ajoecker\\dev\\gauge-init\\specs\\example.spec","name":"A scenario","filename":"C:\\Users\\ajoecker\\dev\\gauge-init\\specs\\example.spec","line":4,"result":{"status":"fail","time":1,"errors":[{"text":"Do that","filename":"C:\\Users\\ajoecker\\dev\\gauge-init\\specs\\example.spec","message":"java.lang.NullPointerException: This is null","lineNo":"7","stackTrace":"StepImplementation.verifyVowelsCountInWord(StepImplementation.java:22)\njava.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\njava.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\njava.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.base/java.lang.reflect.Method.invoke(Method.java:564)\ncom.thoughtworks.gauge.execution.MethodExecutor.execute(MethodExecutor.java:38)\ncom.thoughtworks.gauge.execution.StepExecutionStage.executeStepMethod(StepExecutionStage.java:74)\ncom.thoughtworks.gauge.execution.StepExecutionStage.executeStep(StepExecutionStage.java:67)\ncom.thoughtworks.gauge.execution.StepExecutionStage.execute(StepExecutionStage.java:49)\ncom.thoughtworks.gauge.execution.AbstractExecutionStage.executeNext(AbstractExecutionStage.java:24)\ncom.thoughtworks.gauge.execution.HookExecutionStage.execute(HookExecutionStage.java:43)\ncom.thoughtworks.gauge.execution.ExecutionPipeline.start(ExecutionPipeline.java:29)\ncom.thoughtworks.gauge.processor.ExecuteStepProcessor.process(ExecuteStepProcessor.java:45)\ncom.thoughtworks.gauge.connection.MessageDispatcher.dispatchMessages(MessageDispatcher.java:92)\ncom.thoughtworks.gauge.GaugeRuntime.dispatchMessages(GaugeRuntime.java:96)\ncom.thoughtworks.gauge.GaugeRuntime.lambda$connectSynchronously$1(GaugeRuntime.java:79)\njava.base/java.lang.Thread.run(Thread.java:844)\n"}]}}

assuming scenarioEnd == Messages.Message.MessageType.ScenarioExecutionEnding there is a discrepancy between the apis... the json format has information, whereas in java, I only get a ExecutionInfo, which does not contain the information at all

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

1 participant