-
Notifications
You must be signed in to change notification settings - Fork 47
OPRUN-4587: Make OTE local output easier to read #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
camilamacedo86
wants to merge
1
commit into
openshift:main
Choose a base branch
from
camilamacedo86:ote-improve-output
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Local Dev Output Commands | ||
|
|
||
| Developer-friendly test commands with clean, human-readable output for local execution. | ||
|
|
||
| ## Structure | ||
|
|
||
| ```text | ||
| localdevoutput/ | ||
| ├── cmd/ # Cobra commands for local development | ||
| │ ├── register.go # Returns nil (production build) | ||
| │ ├── register_local_dev.go # Registers local dev commands (with -tags dev) | ||
| │ ├── run_suite_local_dev.go # run-suite-dev command | ||
| │ └── run_test_local_dev.go # run-test-dev command | ||
| └── pkg/output/ # Output formatting | ||
| ├── formatter.go # ANSI colors, progress, summaries | ||
| └── writer.go # OTE ResultWriter implementation | ||
| ``` | ||
|
|
||
| ## Purpose | ||
|
|
||
| These commands are **for local execution only**. They provide human-readable output when testing against OCP clusters locally. | ||
|
|
||
| ## Build Separation | ||
|
|
||
| - **Production build**: `make build` → Excludes local dev commands (ships to OCP payload) | ||
| - **Local dev build**: `make build-local-dev` → Includes local dev commands (for developers) | ||
|
|
||
| Build tags (`//go:build dev`) ensure dev commands are only compiled when explicitly requested with `-tags dev`. | ||
|
|
||
| ### Output Flow | ||
|
|
||
| ```text | ||
| Test Run → ResultWriter.Write(result) → Formatter → Colored Terminal Output | ||
| ``` | ||
|
|
||
| The `CleanResultWriter` implements OTE's `ResultWriter` interface to intercept test results and format them with colors and progress indicators. | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| # Run test suite with clean output | ||
| make test-local SUITE=olmv1/all | ||
|
|
||
| # Run single test | ||
| make test-local-single TEST="[sig-olmv1] test name" | ||
|
|
||
| # Direct binary usage | ||
| ./bin/olmv1-tests-ext run-suite-dev olmv1/all | ||
| ./bin/olmv1-tests-ext run-test-dev -n "test name" | ||
| ``` | ||
|
|
||
| ## Why Separate Directory? | ||
|
|
||
| Isolated in `localdevoutput/` to keep local development tools separate from the core test framework that ships to production. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| //go:build !dev | ||
|
|
||
| package cmd | ||
|
|
||
| import ( | ||
| "github.com/openshift-eng/openshift-tests-extension/pkg/extension" | ||
| "github.com/spf13/cobra" | ||
| ) | ||
|
|
||
| func RegisterLocalDevCommands(registry *extension.Registry) []*cobra.Command { | ||
| return nil | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.