Skip to content

add integration tests for genericProcessService#52

Merged
SirSimon04 merged 7 commits intomainfrom
generic-service-integration-tests
Mar 24, 2026
Merged

add integration tests for genericProcessService#52
SirSimon04 merged 7 commits intomainfrom
generic-service-integration-tests

Conversation

@two-Gee
Copy link
Contributor

@two-Gee two-Gee commented Mar 23, 2026

Have you...

  • Added relevant entry to the change log?

Copy link
Contributor

@hyperspace-insights hyperspace-insights bot left a comment

Choose a reason for hiding this comment

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

The PR adds generic ProcessService integration and hybrid tests alongside the corresponding service handlers and CDS action definitions. There are several correctness issues worth addressing: the genericStart handler uses emit (fire-and-forget) and passes businessKey as a data payload rather than as a CDS header, which misaligns with how both the local and BTP ProcessService implementations read it; the integration tests for lifecycle operations do not poll for intermediate states before asserting final status, making them prone to race conditions; and the getOutputs integration test queries outputs from a process that is still RUNNING, causing the property assertions to fail. These should be fixed before the tests can be considered reliable.

PR Bot Information

Version: 1.19.1 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.opened
  • Correlation ID: fc85d2c0-2694-11f1-8618-7016bba7ccdc

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 you dont need any hybrid test with process binding at all since we already test the same functionality with the specific process.

The integration tests are enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay

@two-Gee two-Gee marked this pull request as ready for review March 23, 2026 09:12
@two-Gee two-Gee requested a review from a team as a code owner March 23, 2026 09:12
@two-Gee two-Gee requested a review from Kronprinz03 March 23, 2026 09:13
@hyperspace-insights
Copy link
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


Add Integration Tests for genericProcessService

New Features

✨ Introduced integration tests for the generic ProcessService approach, covering the full process lifecycle (start, cancel, suspend, resume) as well as instance querying, attribute retrieval, and output retrieval via cds.connect.to('ProcessService').

Changes

  • tests/bookshop/srv/programmatic-service.cds: Added new CDS action declarations for the generic ProcessService interface — genericStart, genericCancel, genericSuspend, genericResume, genericGetInstancesByBusinessKey, genericGetAttributes, and genericGetOutputs.

  • tests/bookshop/srv/programmatic-service.ts: Implemented request handlers for all newly declared generic actions. Each handler connects to ProcessService via cds.connect.to('ProcessService') and delegates to the appropriate emit or send call (e.g., start, cancel, suspend, resume, getInstancesByBusinessKey, getAttributes, getOutputs).

  • tests/integration/genericProgrammaticApproach.test.ts: New integration test file covering:

    • Process Start: Verifies a process starts with RUNNING status, includes the correct businessKey, and supports independent concurrent processes.
    • Process Cancel: Verifies a running process transitions to CANCELED, and that cancelling a non-existent process does not fail.
    • Process Suspend/Resume: Verifies status transitions to SUSPENDED and back to RUNNING.
    • Sequential Lifecycle: End-to-end scenarios such as start → suspend → resume, start → cancel, and start → suspend → resume → cancel.
    • getInstancesByBusinessKey: Validates filtering by status and handling of unknown keys.
    • getAttributes: Confirms attribute data is returned for a running instance.
    • getOutputs: Confirms output data (including processedBy and completionStatus) is returned for a process instance.

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.19.1 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Summary Prompt: Default Prompt
  • Output Template: Default Template
  • Correlation ID: 79e7e0c0-2698-11f1-94ff-47f78f8f9712
  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.ready_for_review

💌 Have ideas or want to contribute? Create an issue and share your thoughts with us!
📑 Check out the documentation for more information.
📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

Made with ❤️ by Hyperspace.

Copy link
Contributor

@hyperspace-insights hyperspace-insights bot left a comment

Choose a reason for hiding this comment

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

The PR adds generic ProcessService handlers and integration tests, but has significant correctness issues: all four lifecycle event handlers (genericStart, genericCancel, genericSuspend, genericResume) bypass the CDS outbox by using bare emit instead of cds.queued(...).emit, which is inconsistent with the production implementation and risks silent message loss. Additionally, the integration tests assert on live remote process state immediately after fire-and-forget events, which will produce flaky results, and the JSON.parse call in genericStart lacks error handling.

PR Bot Information

Version: 1.19.1 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Correlation ID: 79e7e0c0-2698-11f1-94ff-47f78f8f9712
  • Event Trigger: pull_request.ready_for_review
  • LLM: anthropic--claude-4.6-sonnet

Comment on lines +249 to +250
describe('getAttributes', () => {
it('should return attributes for a running process instance', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

only one test in describe => only test

Copy link
Contributor

@SirSimon04 SirSimon04 left a comment

Choose a reason for hiding this comment

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

Can we generally also run these tests in hybrid mode? i.e. bound against hana and process? Is that process modelled in SBPA and we could call against it?

Copy link
Contributor

@SirSimon04 SirSimon04 left a comment

Choose a reason for hiding this comment

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

Great, thank you

@SirSimon04 SirSimon04 merged commit bdebc53 into main Mar 24, 2026
11 checks passed
@two-Gee two-Gee deleted the generic-service-integration-tests branch March 24, 2026 14:03
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