Skip to content

Fix flaky OrchestrationTutorialTest: Update orchestration tutorial to use fruitshop#2940

Closed
christiangoerdes wants to merge 2 commits into
masterfrom
unflaky-tutorial-test
Closed

Fix flaky OrchestrationTutorialTest: Update orchestration tutorial to use fruitshop#2940
christiangoerdes wants to merge 2 commits into
masterfrom
unflaky-tutorial-test

Conversation

@christiangoerdes
Copy link
Copy Markdown
Collaborator

@christiangoerdes christiangoerdes commented May 11, 2026

Summary by CodeRabbit

  • Documentation

    • Rewrote orchestration tutorial from a library/books example to a product catalog workflow that creates a copied product via /products/latest/copy; the flow now builds a new product with name suffixed "Copy" and a fixed price of 5, returning HTTP 201.
  • Tests

    • Updated tests to remove the old books checks and verify the new copy endpoint returns 201, non-null id/name, exact price 5, and that name contains "Copy".

Review Change Stack

Review Change Stack

… fetch latest product details instead of books
@christiangoerdes
Copy link
Copy Markdown
Collaborator Author

/ok-to-test

@membrane-ci-server
Copy link
Copy Markdown

This pull request needs "/ok-to-test" from an authorized committer.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8d2b9169-89b8-4ee6-bd6f-dd476ac5d930

📥 Commits

Reviewing files that changed from the base of the PR and between a368894 and fb6e1bb.

📒 Files selected for processing (2)
  • distribution/src/test/java/com/predic8/membrane/tutorials/orchestration/OrchestrationTutorialTest.java
  • distribution/tutorials/orchestration/30-Orchestration.yaml
✅ Files skipped from review due to trivial changes (1)
  • distribution/tutorials/orchestration/30-Orchestration.yaml

📝 Walkthrough

Walkthrough

The PR rewrites the orchestration tutorial from a books-by-ID example to a product copy workflow: the YAML now GETs the Fruitshop listing for the newest product, builds a copy payload (name + "Copy", price 5), POSTs to create it, and returns 201. The Java test was updated to POST /products/latest/copy and assert 201 with created product fields.

Changes

Orchestration Tutorial Example Modernization

Layer / File(s) Summary
Tutorial Specification
distribution/tutorials/orchestration/30-Orchestration.yaml
Endpoint changed to /products/latest/copy. Orchestration flow replaced: single Fruitshop GET for newest product, JSONPath-based payload template (copy name + "Copy", fixed price: 5), POST to create product, response status set to 201. Curl example and tutorial text updated.
Test Validation
distribution/src/test/java/com/predic8/membrane/tutorials/orchestration/OrchestrationTutorialTest.java
Hamcrest imports expanded (containsString, greaterThan, notNullValue). Removed books_areReturnedById test. Added latestProductCopy_isCreatedWithFixedPrice test that POSTs /products/latest/copy and asserts HTTP 201, non-null id/name, price == 5, and name contains "Copy".

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • predic8

Poem

🐰 A tiny rabbit hops in cheer,
Found the latest fruit so dear.
Copied the name, set price to five,
A brand-new product comes alive.
Hop, deploy, the test says "OK"—hurray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix flaky OrchestrationTutorialTest: Update orchestration tutorial to use fruitshop' accurately reflects the main objectives: fixing the flaky test and updating the tutorial to use fruitshop instead of OpenLibrary.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch unflaky-tutorial-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@christiangoerdes christiangoerdes linked an issue May 11, 2026 that may be closed by this pull request
@predic8
Copy link
Copy Markdown
Member

predic8 commented May 11, 2026

I'd like to keep the book example as it is something different than the fruitstore.

# 1) Fetch a book by id.
# 2) Use the author key from the book payload to fetch the author.
# Shows how to create an API that combines multiple backend calls into one API.
# 1) Fetch the newest product from fruitshop.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd like to keep the book example

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How flaky is it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It fails sometimes due to a wrong status code

@predic8 predic8 closed this May 22, 2026
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.

OrchestrationTutorialTest.books_areReturnedById is flaky

2 participants