Skip to content
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

Add test to enforce critical jobs run on k8s-infra-prow-build #18576

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions config/tests/jobs/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,42 @@ func TestKubernetesReleaseBlockingJobsShouldHavePodQOSGuaranteed(t *testing.T) {
}
}

// TODO: may need to rewrite to handle nodepools or handle jobs that can't be
// migrated over for a while
// TODO: s/Should/Must and s/Logf/Errorf when all jobs pass
func TestKubernetesMergeBlockingJobsShouldRunOnK8sInfraProwBuild(t *testing.T) {
repo := "kubernetes/kubernetes"
jobs := c.AllStaticPresubmits([]string{repo})
sort.Slice(jobs, func(i, j int) bool {
return jobs[i].Name < jobs[j].Name
})
for _, job := range jobs {
// Only consider Pods that are merge-blocking
if job.Spec == nil || !isMergeBlocking(job) {
continue
}
branches := job.Branches
if job.Cluster != "k8s-infra-prow-build" {
t.Logf("%v (%v): should run on cluster: k8s-infra-prow-build, found: %v", job.Name, branches, job.Cluster)
}
}
}

// TODO: may need to rewrite to handle nodepools or handle jobs that can't be
// migrated over for a while
// TODO: s/Should/Must and s/Logf/Errorf when all jobs pass
func TestKubernetesReleaseBlockingJobsShouldRunOnK8sInfraProwBuild(t *testing.T) {
for _, job := range allStaticJobs() {
// Only consider Pods that are release-blocking
if job.Spec == nil || !isKubernetesReleaseBlocking(job) {
continue
}
if job.Cluster != "k8s-infra-prow-build" {
t.Logf("%v: should run on cluster: k8s-infra-prow-build, found: %v", job.Name, job.Cluster)
}
}
}

func TestK8sInfraProwBuildJobsMustHavePodQOSGuaranteed(t *testing.T) {
jobs := allStaticJobs()
for _, job := range jobs {
Expand Down