Skip to content

Conversation

@rhrmo
Copy link

@rhrmo rhrmo commented Dec 8, 2025

This command finds e2e tests in the repository, prepares a Docker file for them to run in and prints out a command on how to run them. It can also run the tests for us.

This command is useful mostly for arm users developing Openshift where running e2e tests on macOS can prove difficult or impossible sometimes.

Summary by CodeRabbit

  • Documentation
    • Added documentation for the openshift:run-e2e-tests-in-container command, covering the workflow for running end-to-end tests in containers with automatic runtime detection (podman/docker), test directory discovery, Dockerfile handling, container image building, kubeconfig mounting, and environment variable configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

The command finds the e2e tests in the repository, creates a Dockerfile and provides a command on how to run them.
@openshift-ci openshift-ci bot requested review from bentito and mrunalp December 8, 2025 14:31
@openshift-ci
Copy link

openshift-ci bot commented Dec 8, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rhrmo
Once this PR has been reviewed and has the lgtm label, please assign zaneb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 8, 2025
@openshift-ci
Copy link

openshift-ci bot commented Dec 8, 2025

Hi @rhrmo. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Walkthrough

A new documentation file is added describing the openshift:run-e2e-tests-in-container command. The doc specifies the command's workflow (container runtime detection, e2e test directory location, Dockerfile handling, container build and execution), container behavior and environment setup, prerequisites, and shell script examples for implementation.

Changes

Cohort / File(s) Summary
Documentation
plugins/openshift/commands/run-e2e-tests-in-container.md
Adds comprehensive command documentation including synopsis, description, workflow steps, container specifications, prerequisites, common patterns, shell snippets, and a detailed 6-step user interaction workflow

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Review scope is limited to a single documentation file with no functional code logic
  • Verification needed: command specification accuracy, workflow completeness, shell script correctness, and alignment with intended behavior

Pre-merge checks and finishing touches

✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add command for running e2e tests in a container' accurately and clearly summarizes the main change: a new command that runs e2e tests in containers, matching the documentation file added and the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
No Real People Names In Style References ✅ Passed The pull request adds documentation for an OpenShift command without including references to real people's names in style references, example prompts, or other contexts.
No Assumed Git Remote Names ✅ Passed Repository search found no hardcoded git remote names like 'origin' or 'upstream' in the new e2e test documentation or related code.
Git Push Safety Rules ✅ Passed The PR adds documentation for an OpenShift e2e test command with no git push operations or instructions to push to protected branches.
No Untrusted Mcp Servers ✅ Passed Pull request only adds documentation for running e2e tests in containers using standard runtimes; no MCP server installations or untrusted dependencies introduced.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 59ba74c and 3c8bac6.

📒 Files selected for processing (1)
  • plugins/openshift/commands/run-e2e-tests-in-container.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
plugins/openshift/commands/run-e2e-tests-in-container.md

9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (4)
plugins/openshift/commands/run-e2e-tests-in-container.md (4)

17-31: Workflow section is well-structured and clear.

The workflow description clearly outlines the command's execution steps, container behavior, and environment setup. The distinction between what the command does and what the container does is helpful for users.


33-40: Prerequisites and patterns are clearly documented.

The prerequisite section effectively communicates required environment setup (KUBECONFIG and TEST_OPERATOR_NAMESPACE), and the common patterns section provides helpful context for OpenShift e2e testing conventions.


42-106: Shell script examples are comprehensive and follow best practices.

The documentation provides well-commented examples for container runtime detection, image building, and test execution across both podman and docker. The runtime detection script (lines 94–106) properly handles missing runtimes with clear error messages, and the conditional SELinux flag handling (:Z for podman, omitted for docker) is correctly implemented.


108-119: Workflow section provides actionable implementation guidance.

The detailed 7-step workflow effectively maps user interactions to command execution, including the use of AskUserQuestion for interactive prompts and clear handling of manual vs. automated execution paths. This aligns well with the AI-assistant context of the tool.

Comment on lines +9 to +11
```
/openshift:run-e2e-tests-in-container
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language identifier to code block.

Line 9 starts a code block without specifying a language. Per markdownlint rule MD040, code blocks should have a language identifier.

 ## Synopsis
-```
+```bash
 /openshift:run-e2e-tests-in-container

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

In plugins/openshift/commands/run-e2e-tests-in-container.md around lines 9 to
11, the fenced code block is missing a language identifier; update the opening
fence to include a language (e.g., bash) so markdownlint MD040 is satisfied by
changing the triple backticks to ```bash and keep the block content unchanged.


</details>

<!-- fingerprinting:phantom:triton:mongoose -->

<!-- This is an auto-generated comment by CodeRabbit -->

Comment on lines +13 to +15
## Description

The `/openshift:run-e2e-tests-in-container` command finds e2e tests in the current repository and prepare them to run in a container using podman or docker.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix verb agreement in description.

Line 15 has a grammatical error: "finds e2e tests... and prepare them" uses inconsistent verb forms. The second verb should be "prepares" to match the parallel structure with "finds".

-The `/openshift:run-e2e-tests-in-container` command finds e2e tests in the current repository and prepare them to run in a container using podman or docker.
+The `/openshift:run-e2e-tests-in-container` command finds e2e tests in the current repository and prepares them to run in a container using podman or docker.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Description
The `/openshift:run-e2e-tests-in-container` command finds e2e tests in the current repository and prepare them to run in a container using podman or docker.
## Description
The `/openshift:run-e2e-tests-in-container` command finds e2e tests in the current repository and prepares them to run in a container using podman or docker.
🤖 Prompt for AI Agents
In plugins/openshift/commands/run-e2e-tests-in-container.md around lines 13 to
15, the sentence "finds e2e tests in the current repository and prepare them to
run in a container using podman or docker." has mismatched verb agreement;
change "prepare" to "prepares" so both verbs are singular and parallel: "finds
... and prepares ...". Ensure the updated sentence preserves existing wording
and punctuation.

Copy link

@smith-xyz smith-xyz left a comment

Choose a reason for hiding this comment

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

Hey, great addition! I have a keen interest in observing our e2e testing for openshift so thought I'd hop in and help with a review. Take my comments with a grain of salt but hopefully they give some help for improvements 😄

- Kubeconfig: mounted at /kubeconfig/config
- Test command: `go test -timeout 0 ./test/e2e/... -kubeconfig=/kubeconfig/config -v`

Container runtime detection:

Choose a reason for hiding this comment

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

any chance some of this can be split into skills? I'm seeing the openshift commands here are growing but no reusable skills. I would imagine container setup could be a consistent skill leveraged within other commands.

Copy link
Author

Choose a reason for hiding this comment

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

I agree with this approach, I will take a look

```

WORKFLOW:
1. Detect the container runtime (podman or docker)

Choose a reason for hiding this comment

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

this is sort of duplicate, adding more token overhead maybe - does this craft out a better todo than the base instructions above?

Copy link
Author

Choose a reason for hiding this comment

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

I will try it with / without this part, compare the results and update you on it after.

This command will:
1. Auto-detect whether podman or docker is available (prefers podman if both exist)
2. Search for e2e test directories in common OpenShift repository locations (test/e2e, tests/e2e, e2e, pkg/e2e)
3. Look for an existing Dockerfile.e2e or create a generic one if needed

Choose a reason for hiding this comment

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

is the convention? I know of one other (albeit layered product) that uses Dockerfile.ci for their e2e tests - will this cause some pollution to local repos?

Copy link
Author

Choose a reason for hiding this comment

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

I am not sure if this is the convention, I will do a quick search and change to Dockerfile.ci if needed

2. Search for e2e test directories in common OpenShift repository locations (test/e2e, tests/e2e, e2e, pkg/e2e)
3. Look for an existing Dockerfile.e2e or create a generic one if needed
4. Build a container image with the e2e tests
5. Show the user the command to run the tests and ask if they would like Claude to run them or if they will run them themselves

Choose a reason for hiding this comment

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

"Claude" maybe shoudl generically be the "agent", could be improved for conciseness and less thinking from the llm

Copy link
Author

Choose a reason for hiding this comment

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

Agreed, I will update it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants