Repository navigation
🌱 OPRUN-4784: Split E2E features into component suites #3135
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
Merged
openshift-merge-bot
merged 3 commits into
operator-framework:main
from
fao89:OPRUN-4784-pr2-component-suites
Nov 10, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,21 @@ | ||
| package e2e | ||
|
|
||
| import ( | ||
| "os" | ||
| "testing" | ||
|
|
||
| "github.com/cucumber/godog" | ||
|
|
||
| "github.com/operator-framework/operator-controller/test/internal/e2e" | ||
| "github.com/operator-framework/operator-controller/test/internal/e2e/steps" | ||
| ) | ||
|
|
||
| func TestMain(m *testing.M) { | ||
| os.Exit(e2e.Run("features", func(tc *godog.TestSuiteContext) { | ||
| tc.BeforeSuite(steps.BeforeSuite) | ||
| }, func(sc *godog.ScenarioContext) { | ||
| steps.RegisterSteps(sc) | ||
| steps.RegisterDemoSteps(sc) | ||
| steps.RegisterHooks(sc) | ||
| })) | ||
| } |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,21 @@ | ||
| package e2e | ||
|
|
||
| import ( | ||
| "os" | ||
| "testing" | ||
|
|
||
| "github.com/cucumber/godog" | ||
|
|
||
| "github.com/operator-framework/operator-controller/test/internal/e2e" | ||
| "github.com/operator-framework/operator-controller/test/internal/e2e/steps" | ||
| ) | ||
|
|
||
| func TestMain(m *testing.M) { | ||
| os.Exit(e2e.Run("features", func(tc *godog.TestSuiteContext) { | ||
| tc.BeforeSuite(steps.BeforeSuite) | ||
| }, func(sc *godog.ScenarioContext) { | ||
| steps.RegisterSteps(sc) | ||
| steps.RegisterDemoSteps(sc) | ||
| steps.RegisterHooks(sc) | ||
| })) | ||
| } |
File renamed without changes.
File renamed without changes.
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,21 @@ | ||
| package e2e | ||
|
|
||
| import ( | ||
| "os" | ||
| "testing" | ||
|
|
||
| "github.com/cucumber/godog" | ||
|
|
||
| "github.com/operator-framework/operator-controller/test/internal/e2e" | ||
| "github.com/operator-framework/operator-controller/test/internal/e2e/steps" | ||
| ) | ||
|
|
||
| func TestMain(m *testing.M) { | ||
| os.Exit(e2e.Run("features", func(tc *godog.TestSuiteContext) { | ||
| tc.BeforeSuite(steps.BeforeSuite) | ||
| }, func(sc *godog.ScenarioContext) { | ||
| steps.RegisterSteps(sc) | ||
| steps.RegisterDemoSteps(sc) | ||
| steps.RegisterHooks(sc) | ||
| })) | ||
| } |
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,50 @@ | ||
| package steps_test | ||
|
|
||
| import ( | ||
| "context" | ||
| "os" | ||
| "path/filepath" | ||
| "testing" | ||
|
|
||
| "github.com/cucumber/godog" | ||
| "github.com/spf13/pflag" | ||
| "github.com/stretchr/testify/require" | ||
| "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" | ||
| "sigs.k8s.io/yaml" | ||
|
|
||
| "github.com/operator-framework/operator-controller/test/internal/e2e/steps" | ||
| ) | ||
|
|
||
| func TestScenarioResourceIsolationAcrossSuites(t *testing.T) { | ||
| // Exercise substitution through the real apply step using a CLI that records | ||
| // its input. No cluster is needed to reproduce Godog IDs restarting at 1. | ||
| dir := t.TempDir() | ||
| cli := filepath.Join(dir, "kubectl") | ||
| require.NoError(t, os.WriteFile(cli, []byte("#!/bin/sh\ncat > \"$E2E_APPLIED_RESOURCE\"\n"), 0o700)) //nolint:gosec // The test CLI must be executable. | ||
| original := pflag.Lookup("k8s.cli").Value.String() | ||
| require.NoError(t, pflag.Set("k8s.cli", cli)) | ||
| t.Cleanup(func() { require.NoError(t, pflag.Set("k8s.cli", original)) }) | ||
| output := filepath.Join(dir, "applied.yaml") | ||
| t.Setenv("E2E_APPLIED_RESOURCE", output) | ||
| names := make([]string, 0, 3) | ||
| for _, uri := range []string{"features/install.feature", "features/revision.feature", "object-controller/features/revision.feature"} { | ||
| ctx, err := steps.CreateScenarioContext(context.Background(), &godog.Scenario{Id: "1", Name: "Stable scenario name", Uri: uri}) | ||
| require.NoError(t, err) | ||
| require.NoError(t, steps.ResourceIsApplied(ctx, &godog.DocString{Content: `apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| name: ${TEST_NAMESPACE} | ||
| labels: | ||
| scenario-id: ${SCENARIO_ID} | ||
| `})) | ||
| data, err := os.ReadFile(output) | ||
| require.NoError(t, err) | ||
| var obj unstructured.Unstructured | ||
| require.NoError(t, yaml.Unmarshal(data, &obj.Object)) | ||
| names = append(names, obj.GetName()) | ||
| require.Equal(t, "Stable scenario name", obj.GetAnnotations()["e2e.olm.operatorframework.io/scenario"]) | ||
| require.Equal(t, "ns-"+obj.GetLabels()["scenario-id"], obj.GetName()) | ||
| } | ||
| require.NotEqual(t, names[0], names[1], "different features with the same Godog ID need distinct resources") | ||
| require.Equal(t, names[1], names[2], "moving a feature must preserve its resource identity") | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: operator-framework/operator-controller
Length of output: 176
Script executed:
Repository: operator-framework/operator-controller
Length of output: 6845
Script executed:
Repository: operator-framework/operator-controller
Length of output: 33012
Script executed:
Repository: operator-framework/operator-controller
Length of output: 22232
Script executed:
Repository: operator-framework/operator-controller
Length of output: 9726
Enforce unique feature basenames across suites.
If two component features have the same basename and Godog ID, they receive the same resource names. Concurrent scenarios can then delete each other's namespace. Enforce basename uniqueness when features are added. This preserves identity when a feature moves; hashing the path would not.