-
Notifications
You must be signed in to change notification settings - Fork 336
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
e2e-test: support ApisixRoute v2 #1103
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1103 +/- ##
==========================================
- Coverage 30.38% 30.34% -0.05%
==========================================
Files 81 81
Lines 9390 9403 +13
==========================================
Hits 2853 2853
- Misses 6222 6235 +13
Partials 315 315
Continue to review full report at Codecov.
|
8915486
to
0933f4d
Compare
d695ad1
to
8d9f798
Compare
074ae7f
to
bab9ca1
Compare
bdbb40a
to
d48a929
Compare
fc42fdf
to
40730de
Compare
40730de
to
7f743f0
Compare
suites(scaffold.NewScaffold(&scaffold.Options{ | ||
Name: "endpoints-port", | ||
Kubeconfig: scaffold.GetKubeconfig(), | ||
APISIXConfigPath: "testdata/apisix-gw-config.yaml", | ||
IngressAPISIXReplicas: 1, | ||
HTTPBinServicePort: 8080, | ||
ApisixResourceVersion: scaffold.ApisixResourceVersion().V2beta3, | ||
})) | ||
}) |
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.
how ablout using suites(scaffold.NewDefaultScaffold())
?
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.
how ablout using
suites(scaffold.NewDefaultScaffold())
?
Separate configuration item HTTPBinServicePort:8080
are used here.
ginkgo.Describe("suite-endpoints: scaffold v2", func() { | ||
suites(scaffold.NewScaffold(&scaffold.Options{ | ||
Name: "endpoints-port", | ||
Kubeconfig: scaffold.GetKubeconfig(), | ||
APISIXConfigPath: "testdata/apisix-gw-config.yaml", | ||
IngressAPISIXReplicas: 1, | ||
HTTPBinServicePort: 8080, | ||
ApisixResourceVersion: scaffold.ApisixResourceVersion().V2, | ||
})) |
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.
ditto
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.
Separate configuration item HTTPBinServicePort:8080
are used here.
suites(scaffold.NewScaffold(&scaffold.Options{ | ||
Name: "sync", | ||
Kubeconfig: scaffold.GetKubeconfig(), | ||
APISIXConfigPath: "testdata/apisix-gw-config.yaml", | ||
IngressAPISIXReplicas: 1, | ||
HTTPBinServicePort: 80, | ||
ApisixResourceVersion: scaffold.ApisixResourceVersion().V2beta3, | ||
ApisixResourceSyncInterval: "60s", | ||
})) |
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.
ditto
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.
Separate configuration item ApisixResourceSyncInterval: "60s"
are used here.
suites(scaffold.NewScaffold(&scaffold.Options{ | ||
Name: "sync", | ||
Kubeconfig: scaffold.GetKubeconfig(), | ||
APISIXConfigPath: "testdata/apisix-gw-config.yaml", | ||
IngressAPISIXReplicas: 1, | ||
HTTPBinServicePort: 80, | ||
ApisixResourceVersion: scaffold.ApisixResourceVersion().V2, | ||
ApisixResourceSyncInterval: "60s", | ||
})) |
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.
ditto
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.
Separate configuration item ApisixResourceSyncInterval: "60s"
are used here.
ginkgo.Describe("suite-ingress: scaffold v2beta3", func() { | ||
suites(scaffold.NewScaffold(&scaffold.Options{ | ||
Name: "webhook", | ||
Kubeconfig: scaffold.GetKubeconfig(), | ||
APISIXConfigPath: "testdata/apisix-gw-config.yaml", | ||
IngressAPISIXReplicas: 1, | ||
HTTPBinServicePort: 80, | ||
ApisixResourceVersion: scaffold.ApisixResourceVersion().V2beta3, | ||
EnableWebhooks: false, | ||
})) | ||
}) | ||
ginkgo.Describe("suite-ingress: scaffold v2", func() { | ||
suites(scaffold.NewScaffold(&scaffold.Options{ | ||
Name: "webhook", | ||
Kubeconfig: scaffold.GetKubeconfig(), | ||
APISIXConfigPath: "testdata/apisix-gw-config.yaml", | ||
IngressAPISIXReplicas: 1, | ||
HTTPBinServicePort: 80, | ||
ApisixResourceVersion: scaffold.ApisixResourceVersion().V2, | ||
EnableWebhooks: false, | ||
})) |
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.
ditto
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 is to identify enablewebhooks
.
return s.CreateResourceFromStringWithNamespace(apc, namespace) | ||
} | ||
errString := fmt.Sprint("the resource ", kindValue, " does not support") | ||
return errors.New(errString) |
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.
fmt.Errorf
) | ||
|
||
func (s *Scaffold) replaceApiVersion(yml, ver string) string { | ||
return versionRegex.ReplaceAllString(yml, "apiVersion: "+ver+"\n") | ||
} | ||
|
||
func (s *Scaffold) getKindValue(yml string) string { | ||
kind := strings.Replace(kindRegex.FindString(yml), "\n", "", -1) |
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.
Why not use capture groups?
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.
Didn't notice.
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.
How about a fix in a follow-up PR? @AlinsRan
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.
How about a fix in a follow-up PR? @AlinsRan
Sure.
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 PR is very big, basically LGTM
Let's merge first (I like the split of CI jobs in this PR, it can greatly reduce the time consuming of CI)
let's move forward. thanks |
Type of change:
What this PR does / why we need it:
fix: #1108
Pre-submission checklist: