Skip to content

fix: changed integration tests to save logs instead of dumping them#1991

Merged
lucaseduoli merged 11 commits into
mainfrom
fix/tests_integration_e2e
Jun 30, 2026
Merged

fix: changed integration tests to save logs instead of dumping them#1991
lucaseduoli merged 11 commits into
mainfrom
fix/tests_integration_e2e

Conversation

@lucaseduoli

@lucaseduoli lucaseduoli commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

This pull request improves how test failure logs are handled and makes them more accessible for debugging, especially in CI environments. Instead of just dumping service logs to the console on test failures, logs are now saved to a service-logs/ directory and uploaded as artifacts in GitHub Actions, making it easier to review logs after a failed run.

CI/CD improvements:

  • .github/workflows/test-ci.yml: Added a step to upload the service-logs/ directory as a GitHub Actions artifact when tests fail, with a retention period of 7 days.

Test log handling improvements:

  • Makefile: Changed the test failure handling to save logs from all main services (langflow, openrag-backend, openrag-frontend, os) to individual files in the service-logs/ directory instead of printing them to the console.
  • scripts/ci/run_integration_suite.sh: Updated the dump_logs function to save logs for each service to separate files in service-logs/ rather than echoing the last N lines to the console.

Summary by CodeRabbit

  • Bug Fixes
    • Improved CI/test failure reporting by capturing complete container logs into service-logs/, redacting sensitive values, and persisting per-suite pytest logs.
    • Test runs now emit JUnit XML and generate a consolidated Markdown test-failure report from service-logs/ for easier diagnosis.
  • Chores
    • CI reliability/performance updates: disabled single-node readiness checking, broadened change-detection matching, parallelized Docker image builds, stopped aggressive Docker cache pruning, and reduced dev sync/install verbosity.
    • Updated local integration test logging and report generation to match CI behavior.

@lucaseduoli lucaseduoli self-assigned this Jun 30, 2026
@github-actions github-actions Bot added the ci ⬛ CI/CD, build, and infrastructure issues label Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)

Walkthrough

This PR updates CI trigger filters, Docker cleanup, build parallelism, and failure log handling across the workflow, Makefile, and integration script.

Changes

CI workflow and log handling

Layer / File(s) Summary
Triggers, readiness, and cleanup
.github/workflows/test-ci.yml
The workflow adds the OpenSearch node-count check flag, rewrites e2e and integration path filters to wildcard matching with docs and markdown exclusions, and removes Docker prune commands from build-images, test-suite, and e2e-run cleanup steps.
Parallel CI image builds
Makefile
The ci-build-images target starts the OpenSearch, backend, frontend, and langflow Docker builds in parallel and waits for each build to finish.
Persistent test logs and artifacts
Makefile, scripts/ci/run_integration_suite.sh, .github/workflows/test-ci.yml
The Makefile and integration script switch pytest output to service-logs/pytest-core.log and service-logs/pytest-sdk.log, make dependency sync quieter, save redacted container logs into service-logs/, and upload service-logs/ as a failure artifact from test-suite.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

tests

Suggested reviewers

  • edwinjosechittilappilly
🚥 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 clearly matches the main change: integration tests now save logs instead of dumping them to the console.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/tests_integration_e2e

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.

@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
Makefile (1)

810-933: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

test-ci target missing the same failure log-saving logic added to test-ci-local.

The new service-logs/ capture block (mkdir + per-service logs redirection) was only added to test-ci-local (Lines 1053-1060). The near-identical test-ci target ends at Line 933 with exit $$TEST_RESULT and still has no failure-log capture at all, so manual/local runs of make test-ci get no log artifacts on failure while test-ci-local does.

♻️ Suggested fix: mirror the block before `test-ci`'s exit
+	if [ $$TEST_RESULT -ne 0 ]; then \
+		echo "$(RED)=== Tests failed, saving container logs to service-logs/ ===$(NC)"; \
+		mkdir -p service-logs; \
+		$(CONTAINER_RUNTIME) logs langflow > service-logs/langflow.log 2>&1 || echo "$(RED)Could not get Langflow logs$(NC)"; \
+		$(CONTAINER_RUNTIME) logs openrag-backend > service-logs/backend.log 2>&1 || echo "$(RED)Could not get backend logs$(NC)"; \
+		$(CONTAINER_RUNTIME) logs openrag-frontend > service-logs/frontend.log 2>&1 || echo "$(RED)Could not get frontend logs$(NC)"; \
+		$(CONTAINER_RUNTIME) logs os > service-logs/opensearch.log 2>&1 || echo "$(RED)Could not get OpenSearch logs$(NC)"; \
+	fi; \
 	($(call test_jwt_opensearch)) || TEST_RESULT=1; \

Also applies to: 1053-1060

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 810 - 933, The test-ci target is missing the same
failure log-saving behavior already added in test-ci-local, so failing runs
don’t preserve service logs. Mirror the existing service-logs capture block from
test-ci-local into test-ci near the end of the recipe, before exit
$$TEST_RESULT, and make it save per-service logs only when the overall test
result is non-zero. Use the existing test-ci and test-ci-local targets plus the
service-logs redirection pattern to keep both targets consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ci/run_integration_suite.sh`:
- Around line 70-77: The dump_logs function in run_integration_suite.sh is
writing full container logs for langflow, openrag-backend, openrag-frontend, and
os straight into service-logs files, which are then uploaded as CI artifacts.
Update this flow to redact known sensitive patterns before the logs are
persisted, or otherwise limit what gets written by the dump_logs helper and the
related artifact upload path, so the saved logs do not expose secrets or tokens.

---

Nitpick comments:
In `@Makefile`:
- Around line 810-933: The test-ci target is missing the same failure log-saving
behavior already added in test-ci-local, so failing runs don’t preserve service
logs. Mirror the existing service-logs capture block from test-ci-local into
test-ci near the end of the recipe, before exit $$TEST_RESULT, and make it save
per-service logs only when the overall test result is non-zero. Use the existing
test-ci and test-ci-local targets plus the service-logs redirection pattern to
keep both targets consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3746d206-60bd-4e6c-a9a6-e7da12083f9e

📥 Commits

Reviewing files that changed from the base of the PR and between 6d8a4b4 and 1909be5.

📒 Files selected for processing (3)
  • .github/workflows/test-ci.yml
  • Makefile
  • scripts/ci/run_integration_suite.sh

Comment thread scripts/ci/run_integration_suite.sh
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/test-ci.yml (1)

41-63: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Pin the workflow token permissions. Add job-level permissions here with at least contents: read and pull-requests: read so actions/checkout and dorny/paths-filter don’t inherit broader repo defaults.

Suggested change
   changes:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      pull-requests: read
     outputs:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-ci.yml around lines 41 - 63, The changes job in the
test-ci workflow currently inherits broader default token scopes; add an
explicit job-level permissions block for the changes job with at least contents:
read and pull-requests: read so actions/checkout and dorny/paths-filter run with
least privilege. Locate the job by its changes key and keep the permission scope
limited to that job only.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test-ci.yml:
- Around line 59-63: The integration path filter is excluding frontend changes,
which prevents frontend updates from triggering suites that depend on the
frontend app. Update the workflow’s path rules in the integration job so
`frontend/**` is included for integration runs, while keeping the other
exclusions if needed. Use the existing `integration` paths block in the CI
workflow to adjust the matching behavior so changes that affect
`scripts/ci/run_integration_suite.sh`’s frontend-backed tests still run.

---

Outside diff comments:
In @.github/workflows/test-ci.yml:
- Around line 41-63: The changes job in the test-ci workflow currently inherits
broader default token scopes; add an explicit job-level permissions block for
the changes job with at least contents: read and pull-requests: read so
actions/checkout and dorny/paths-filter run with least privilege. Locate the job
by its changes key and keep the permission scope limited to that job only.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3a1b0c4d-d45f-4afb-976e-a9d3e3dd98b5

📥 Commits

Reviewing files that changed from the base of the PR and between 1909be5 and 3990e95.

📒 Files selected for processing (1)
  • .github/workflows/test-ci.yml

Comment thread .github/workflows/test-ci.yml
@lucaseduoli
lucaseduoli force-pushed the fix/tests_integration_e2e branch from 3990e95 to b7cae96 Compare June 30, 2026 19:14
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026
@edwinjosechittilappilly

edwinjosechittilappilly commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Good One! I would also see if we can generate a error report also Like which test was failing and etc not the full log may be that can help for more effective debug.

Like a Test Failure Report.

@coderabbitai create a plan for the above comment and your suggestions too.

@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026
@github-actions github-actions Bot added the bug 🔴 Something isn't working. label Jun 30, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026
…on suite (#1992)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026

@edwinjosechittilappilly edwinjosechittilappilly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, awaiting test in current PR.

@github-actions github-actions Bot added the lgtm label Jun 30, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
Makefile (2)

1073-1075: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Same non-best-effort report generation in test-ci-local.

Line 1074 is unguarded; under set -e a generator failure skips teardown (1077-1079) and exit $$TEST_RESULT. Apply || true as in the test-ci fix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 1073 - 1075, The test failure report generation in
test-ci-local is still unguarded, so a failure in generate_test_report.py can
abort the target before teardown and exit handling run. Update the test-ci-local
recipe to match the test-ci fix by making the service-logs report generation
non-fatal, using the same guard pattern around the generate_test_report.py call
so the cleanup and exit $$TEST_RESULT steps still execute. Reference the
test-ci-local Makefile target and the generate_test_report.py invocation when
applying the change.

1030-1039: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Same set -e core-pytest scoping bug in test-ci-local.

Identical to the test-ci core step: Line 1038 runs uv run pytest unguarded and Line 1039 captures $?. Under set -e a core failure aborts before the SDK suites, container-log capture (1065-1072), report generation, and teardown. Apply the same TEST_RESULT=0; ... || TEST_RESULT=$$? fix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Makefile` around lines 1030 - 1039, The `test-ci-local` core pytest step has
the same `set -e` scoping bug as `test-ci`: `uv run pytest` in the core block
can abort the shell before `TEST_RESULT=$$?` is assigned, which skips later SDK
runs, log collection, report generation, and teardown. Update the core test
block in the Makefile to initialize `TEST_RESULT=0` and capture failures with
`|| TEST_RESULT=$$?` around the `uv run pytest tests/integration/core`
invocation, matching the existing `test-ci` fix so `TEST_RESULT` is always set
before the script continues.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Makefile`:
- Around line 900-909: The core pytest step in the Makefile recipe is not
guarded, so under set -e a failure exits before TEST_RESULT can be captured and
the remaining SDK suites, reports, and teardown run. Update the core integration
test invocation around the pytest command to use the same failure-capture
pattern as the later test steps, keeping TEST_RESULT assigned even when tests
fail; use the existing surrounding recipe block and the pytest/core test command
as the anchor points.
- Around line 935-937: The test report generation step in the Makefile is not
best-effort, so a failure in the report generator can abort the recipe under set
-e and prevent teardown and the final test exit from running. Update the
report-generation block around the Test Failure Report echo/uv run sequence to
ignore generator failures, following the same best-effort pattern used in
run_integration_suite.sh, so the remaining cleanup and exit logic still
executes.

---

Duplicate comments:
In `@Makefile`:
- Around line 1073-1075: The test failure report generation in test-ci-local is
still unguarded, so a failure in generate_test_report.py can abort the target
before teardown and exit handling run. Update the test-ci-local recipe to match
the test-ci fix by making the service-logs report generation non-fatal, using
the same guard pattern around the generate_test_report.py call so the cleanup
and exit $$TEST_RESULT steps still execute. Reference the test-ci-local Makefile
target and the generate_test_report.py invocation when applying the change.
- Around line 1030-1039: The `test-ci-local` core pytest step has the same `set
-e` scoping bug as `test-ci`: `uv run pytest` in the core block can abort the
shell before `TEST_RESULT=$$?` is assigned, which skips later SDK runs, log
collection, report generation, and teardown. Update the core test block in the
Makefile to initialize `TEST_RESULT=0` and capture failures with `||
TEST_RESULT=$$?` around the `uv run pytest tests/integration/core` invocation,
matching the existing `test-ci` fix so `TEST_RESULT` is always set before the
script continues.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 599ea375-7ec6-42b9-9b06-63d67fb472dd

📥 Commits

Reviewing files that changed from the base of the PR and between 1ddd754 and 780470a.

📒 Files selected for processing (3)
  • Makefile
  • scripts/ci/generate_test_report.py
  • scripts/ci/run_integration_suite.sh
✅ Files skipped from review due to trivial changes (1)
  • scripts/ci/generate_test_report.py

Comment thread Makefile Outdated
Comment thread Makefile
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 2 unresolved review comments.

Files modified:

  • Makefile

Commit: fd876c37623c48ce554e3c6a8344344a4a5b4d73

The changes have been pushed to the fix/tests_integration_e2e branch.

Time taken: 4m 22s

Fixed 1 file(s) based on 2 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026
@lucaseduoli
lucaseduoli force-pushed the fix/tests_integration_e2e branch from db70b47 to fd876c3 Compare June 30, 2026 21:44
@github-actions github-actions Bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Jun 30, 2026
@lucaseduoli
lucaseduoli merged commit 724c85b into main Jun 30, 2026
28 of 30 checks passed
@github-actions
github-actions Bot deleted the fix/tests_integration_e2e branch June 30, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔴 Something isn't working. ci ⬛ CI/CD, build, and infrastructure issues lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants