cucumber-eclipse icon indicating copy to clipboard operation
cucumber-eclipse copied to clipboard

Add remote test execution support for Python/Behave backend with generic message endpoint

Open Copilot opened this issue 4 months ago • 3 comments

Final Refactoring Updates

Renamed Java Implementation

  • Renamed MessageEndpointProcess to JavaMessageEndpointProcess to prevent name clash with the generic base class
  • Updated all references in CucumberFeatureLocalApplicationLaunchConfigurationDelegate

Moved Common Code to Base Class

  • Moved deserializeEnvelope() implementation to the base class since both Java and Python use identical Jackson-based deserialization
  • Both backends now only need to override getLabel() and provide backend-specific argument injection
  • Added dependency on io.cucumber.eclipse.java.plugins to editor bundle for Jackson access

Backend-Specific Code

  • Java: Implements addArguments() to inject -p plugin argument
  • Python: Already uses BehaveProcessLauncher.withRemoteConnection() for argument injection

Code Reduction

  • Java: ~25 lines (down from ~33)
  • Python: ~25 lines (down from ~33)
  • Base: ~240 lines including shared deserialization logic

The refactoring demonstrates maximum code reuse while maintaining clean separation of backend-specific concerns.

Original prompt

This section details on the original issue you should resolve

<issue_title>[bheave] Add support to watch the remote code execution of cucumber/behave tests</issue_title> <issue_description>In java we have a cumber-java-plugin that opens a socket connection to the host running the process to watch the test execution and getting results.

We need to investigate if behave (source here https://github.com/behave/behave ) support something similar in general we want the following:

  1. Users should usually not need to modify their code in any way but we may inject additional commandline arguments
  2. Our code should be a python script that plugs into a suitable extension point in behave, (e.g. using the report facility)
  3. it must then somehow read a port as a parameter, this can be an ENV variable or whatever else might be possible (e.g. in java we can pass it directly as a plugin parameter)
  4. Then it should open a socket connection and send encoded cucumber messages we can read again by java code for this we should use https://github.com/cucumber/messages/tree/main/python
  5. For the protocol we want to use something similar to what https://github.com/cucumber/cucumber-eclipse/blob/main/io.cucumber.eclipse.java.plugins/src/io/cucumber/eclipse/java/plugins/MessageEndpoint.java does (so we can possibly even reuse that on the receiver side)
  6. This messages should then be read and redirected to the unittest view as we do for the java backend
  7. The copilote instructions need to be updated to reflect this new thing wen implementing new backends</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes cucumber/cucumber-eclipse#578

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Oct 26 '25 14:10 Copilot