integrate pod churn tests into CI (#23)

This commit is contained in:
Jack Francis 2021-10-18 17:03:52 -07:00 коммит произвёл GitHub
Родитель d5ce4c6b16
Коммит e7b829445e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 42 добавлений и 2 удалений

6
.github/workflows/ci-e2e.yaml поставляемый
Просмотреть файл

@ -31,6 +31,12 @@ jobs:
sudo chmod +x ./sonobuoy
sudo mv ./sonobuoy /usr/local/bin/sonobuoy
sudo rm ./sonobuoy_0.54.0_linux_amd64.tar.gz
- name: checkout perf-tests
uses: actions/checkout@v2
with:
repository: kubernetes/perf-tests
path: perf-tests
ref: release-1.20
- name: run E2E
env:
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

Просмотреть файл

@ -129,6 +129,13 @@ var _ = Describe("Workload cluster creation", func() {
})
})
Context("Running pod churn tests against workload cluster", func() {
specs.RunPodChurnTest(ctx, specs.ClusterTestInput{
BootstrapClusterProxy: bootstrapClusterProxy,
Cluster: result.Cluster,
})
})
Context("Running conformance tests against workload cluster", func() {
specs.RunConformance(ctx, specs.ClusterTestInput{
BootstrapClusterProxy: bootstrapClusterProxy,
@ -137,7 +144,7 @@ var _ = Describe("Workload cluster creation", func() {
})
})
It("With the aks flavor", func() {
/*It("With the aks flavor", func() {
clusterName = utils.GetClusterName(clusterNamePrefix, "aks")
clusterctl.ApplyClusterTemplateAndWait(ctx, clusterctl.ApplyClusterTemplateAndWaitInput{
ClusterProxy: bootstrapClusterProxy,
@ -169,12 +176,19 @@ var _ = Describe("Workload cluster creation", func() {
})
})
Context("Running pod churn tests against workload cluster", func() {
specs.RunPodChurnTest(ctx, specs.ClusterTestInput{
BootstrapClusterProxy: bootstrapClusterProxy,
Cluster: result.Cluster,
})
})
Context("Running conformance tests against workload cluster", func() {
specs.RunConformance(ctx, specs.ClusterTestInput{
BootstrapClusterProxy: bootstrapClusterProxy,
Cluster: result.Cluster,
})
})
})
})*/
})

Просмотреть файл

@ -44,3 +44,23 @@ func RunConformance(ctx context.Context, input ClusterTestInput) {
Expect(err).ToNot(HaveOccurred())
utils.Logf("%s\n", out)
}
func RunPodChurnTest(ctx context.Context, input ClusterTestInput) {
specName := "run-pod-churn-tests"
Expect(input.BootstrapClusterProxy).NotTo(BeNil(), "Invalid argument. input.BootstrapClusterProxy can't be nil when calling %s spec", specName)
Expect(input.Cluster).NotTo(BeNil(), "Invalid argument. input.Cluster can't be nil when calling %s spec", specName)
clusterProxy := input.BootstrapClusterProxy.GetWorkloadCluster(ctx, input.Cluster.Namespace, input.Cluster.Name)
kubeConfigPath := clusterProxy.GetKubeconfigPath()
clusterloader2Command := exec.Command("go", "run", "cmd/clusterloader.go", "--testconfig=../../test/workloads/deployment-churn/config.yaml", "--provider=aks", fmt.Sprintf("--kubeconfig=%s", kubeConfigPath), "--v=2", "--enable-exec-service=false")
clusterloader2Command.Env = append(os.Environ(), fmt.Sprintf("CL2_NS_COUNT=%d", 15),
fmt.Sprintf("CL2_CLEANUP=%d", 0),
fmt.Sprintf("CL2_REPEATS=%d", 4),
fmt.Sprintf("CL2_POD_START_TIMEOUT_MINS=%d", 20),
fmt.Sprintf("CL2_PODS_PER_NODE=%d", 5),
fmt.Sprintf("CL2_TARGET_POD_CHURN=%d", 75),
fmt.Sprintf("CL2_PODS_PER_DEPLOYMENT=%d", 32))
clusterloader2Command.Dir = "perf-tests/clusterloader2"
out, err := clusterloader2Command.CombinedOutput()
Expect(err).ToNot(HaveOccurred())
utils.Logf("%s\n", out)
}