Skip to content

Fix broken intermittent CI failures#4855

Merged
lukaszgryglicki merged 1 commit intodevfrom
unicron-test-coverage-fix-broken-ci
Nov 5, 2025
Merged

Fix broken intermittent CI failures#4855
lukaszgryglicki merged 1 commit intodevfrom
unicron-test-coverage-fix-broken-ci

Conversation

@lukaszgryglicki
Copy link
Member

Fix intermittent CI failures.

Signed-off-by: Lukasz Gryglicki lgryglicki@cncf.io

Assisted by OpenAI

Assisted by GitHub Copilot

Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io>

Assisted by [OpenAI](https://platform.openai.com/)

Assisted by [GitHub Copilot](https://github.com/features/copilot)
@coderabbitai
Copy link

coderabbitai bot commented Nov 5, 2025

Walkthrough

Two project-info endpoint tests were removed from the Cypress test suite. Logging statements were added to helper commands for token and header retrieval. Usage documentation comments and environment variable cleanup logic were added to test runner scripts.

Changes

Cohort / File(s) Change Summary
Test removal
tests/functional/cypress/e2e/v4/projects.cy.ts
Removed two test cases validating GET /project-info/{projectSFID} endpoint with malformed and valid projectSFID inputs
Logging enhancements
tests/functional/cypress/support/commands.js
Added runtime log statements in getXACLHeader (for retrieved X-ACL from environment) and getTokenKey (for token retrieval attempt)
Documentation comments
tests/functional/utils/run-single-test-local.sh, tests/functional/utils/run-single-test-remote.sh
Added usage comment lines documenting typical script invocation
Environment variable cleanup
tests/functional/utils/run-single-test.sh
Added logic to unset TOKEN and XACL environment variables when not provided or set to "-", preventing stale values from propagating to Cypress

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Environment variable cleanup logic in run-single-test.sh should be verified to ensure TOKEN and XACL unsetting does not introduce unintended side effects
  • Verify that removed project-info tests are intentionally deprecated and not needed for backward compatibility

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix broken intermittent CI failures' directly relates to the changeset, which includes test cleanup, environment variable handling fixes, and logging improvements aimed at addressing CI reliability issues.
Description check ✅ Passed The description 'Fix intermittent CI failures' is related to the changeset, which addresses CI issues through test modifications, environment variable cleanup, and logging enhancements.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch unicron-test-coverage-fix-broken-ci

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bb63d7d and d93718b.

📒 Files selected for processing (5)
  • tests/functional/cypress/e2e/v4/projects.cy.ts (0 hunks)
  • tests/functional/cypress/support/commands.js (2 hunks)
  • tests/functional/utils/run-single-test-local.sh (1 hunks)
  • tests/functional/utils/run-single-test-remote.sh (1 hunks)
  • tests/functional/utils/run-single-test.sh (1 hunks)
💤 Files with no reviewable changes (1)
  • tests/functional/cypress/e2e/v4/projects.cy.ts
🔇 Additional comments (5)
tests/functional/utils/run-single-test-remote.sh (1)

2-3: LGTM! Helpful usage documentation.

These comments document typical invocation patterns, making it easier for developers to run the script correctly.

tests/functional/utils/run-single-test-local.sh (1)

2-2: LGTM! Consistent usage documentation.

The usage comment aligns with the remote script's documentation and helps developers understand the typical invocation pattern.

tests/functional/cypress/support/commands.js (2)

263-263: LGTM! Improved debugging visibility.

This logging helps diagnose authentication-related intermittent failures by making X-ACL header retrieval visible in test output. The use of shortenMiddle() appropriately protects sensitive token data.


295-295: LGTM! Consistent logging pattern.

Adding this initial log statement provides visibility into when token retrieval starts, which helps trace authentication flow during test execution.

tests/functional/utils/run-single-test.sh (1)

68-70: LGTM! Proper environment hygiene to prevent test pollution.

These unset commands prevent stale TOKEN and XACL values from the parent environment from leaking into test execution when not explicitly provided. This improves test isolation and could resolve intermittent CI failures caused by environment variable pollution.

The logic correctly handles the case where TOKEN or XACL is set to "-" (meaning "don't use") by cleaning up the environment.

Also applies to: 75-77

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

@lukaszgryglicki lukaszgryglicki merged commit 0f3fb78 into dev Nov 5, 2025
4 of 8 checks passed
@lukaszgryglicki lukaszgryglicki deleted the unicron-test-coverage-fix-broken-ci branch November 5, 2025 16:00
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.

2 participants