-
Notifications
You must be signed in to change notification settings - Fork 75
[WIP] Feature: run upstream serving operator tests #32
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
Closed
cardil
wants to merge
2
commits into
openshift-knative:master
from
cardil:feature/run-upstream-serving-tests
Closed
Changes from all commits
Commits
Show all changes
2 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
| catalogsource-ci.yaml | ||
| user*.kubeconfig | ||
| users.htpasswd | ||
| .idea | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,36 @@ | ||
| package e2e | ||
|
|
||
| import ( | ||
| "github.com/openshift-knative/serverless-operator/test" | ||
| "os" | ||
| "testing" | ||
| ) | ||
|
|
||
| func createSubscriptionAndWaitForCSVtoSucceed(t *testing.T, ctx *test.Context) { | ||
| t.Run("create subscription and wait for CSV to succeed", func(t *testing.T) { | ||
| _, err := test.WithOperatorReady(ctx, "serverless-operator-subscription") | ||
| if err != nil { | ||
| t.Fatal("Failed", err) | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| func undeployServerlessOperatorAndCheckDependentOperatorsRemoved(t *testing.T, ctx *test.Context) { | ||
| if t.Failed() && runsOnCiOperator() { | ||
| t.Log("Skipping updeployment of serverless as tests failed and we are running on Openshift CI") | ||
| return | ||
| } | ||
| t.Run("undeploy serverless operator and check dependent operators removed", func(t *testing.T) { | ||
| ctx.Cleanup() | ||
| err := test.WaitForOperatorDepsDeleted(ctx) | ||
| if err != nil { | ||
| t.Fatalf("Operators still running: %v", err) | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| func runsOnCiOperator() bool { | ||
| _, ok := os.LookupEnv("OPENSHIFT_BUILD_NAMESPACE") | ||
| return ok | ||
| } | ||
|
|
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,33 @@ | ||
| // +build e2e | ||
|
|
||
| package e2e | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/openshift-knative/serverless-operator/test" | ||
| upstreame2e "knative.dev/serving-operator/test/e2e" | ||
| upstreamtest "knative.dev/serving-operator/test" | ||
| ) | ||
|
|
||
| func TestUpstreamKnativeServingOperator(t *testing.T) { | ||
| upstreamtest.ServingOperatorNamespace = "knative-serving" | ||
| suite := upstreame2e.ComplianceSuite() | ||
| ctx := test.SetupClusterAdmin(t) | ||
|
|
||
| defer test.CleanupAll(ctx) | ||
| test.CleanupOnInterrupt(t, func() { test.CleanupAll(ctx) }) | ||
|
|
||
| createSubscriptionAndWaitForCSVtoSucceed(t, ctx) | ||
|
|
||
| skipConfigureSubTest := upstreamtest.Skip( | ||
| "TestKnativeServingDeployment/configure", | ||
| "Skip due to SRVKS-241") | ||
|
|
||
| upstreamtest. | ||
| NewContext(t). | ||
| WithOverride(skipConfigureSubTest). | ||
| RunSuite(suite) | ||
|
|
||
| undeployServerlessOperatorAndCheckDependentOperatorsRemoved(t, ctx) | ||
| } | ||
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.
This looks elegant but hasn't been proposed upstream. I'm not sure it would even be acceptable. Any reason why we're not just running
go teston the upstream test and make them configurable to the extent we need?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.
In that way I was able to fine tune what is executed and what isn't - I needed to skip
configuresubtest due to SRVKS-241