Skip to content

Commit

Permalink
switch test-infra bazel canary to config=unit, create lint job
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTheElder committed Feb 27, 2018
1 parent 579aca3 commit 51c56f9
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 6 deletions.
31 changes: 31 additions & 0 deletions hack/build-then-unit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# used in presubmits / CI testing
# bazel build then unit test, exiting non-zero if either failed

local res=0

bazel build //...
if [[ $? -ne 0 ]]; then
res=1
fi

bazel test //... --config=unit
if [[ $? -ne 0 ]]; then
res=1
fi

exit $res
44 changes: 38 additions & 6 deletions prow/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4800,8 +4800,6 @@ presubmits:
- name: pull-test-infra-bazel-canary
agent: kubernetes
context: pull-test-infra-bazel-canary
branches:
- master
always_run: false
rerun_command: "/test pull-test-infra-bazel-canary"
trigger: "(?m)^/test pull-test-infra-bazel-canary,?(\\s+|$)"
Expand All @@ -4818,11 +4816,9 @@ presubmits:
- "--repo=k8s.io/$(REPO_NAME)=$(PULL_REFS)"
- "--service-account=/etc/service-account/service-account.json"
- "--upload=gs://kubernetes-jenkins/pr-logs"
- "--scenario=kubernetes_execute_bazel"
- "--" # end bootstrap args, scenario args below
- "--build=//..."
- "--install=gubernator/test_requirements.txt"
- "--test=//..."
- "--test-args=--test_output=errors"
- "hack/build-then-unit.sh"
env:
- name: BAZEL_REMOTE_CACHE_ENABLED
value: "true"
Expand Down Expand Up @@ -4863,6 +4859,42 @@ presubmits:
hostPath:
path: /mnt/disks/ssd0

- name: pull-test-infra-lint
agent: kubernetes
context: pull-test-infra-lint
# TODO(bentheelder): set always_run once we've switched over to use --config=unit for the bazel job
always_run: false
rerun_command: "/test pull-test-infra-lint-canary"
trigger: "(?m)^/test pull-test-infra-lint-canary,?(\\s+|$)"
labels:
preset-service-account: true
preset-bazel-scratch-dir: true
spec:
containers:
- image: gcr.io/k8s-testimages/kubekins-e2e:latest-experimental
imagePullPolicy: Always
args:
- "--clean"
- "--job=$(JOB_NAME)"
- "--repo=k8s.io/$(REPO_NAME)=$(PULL_REFS)"
- "--service-account=/etc/service-account/service-account.json"
- "--upload=gs://kubernetes-jenkins/pr-logs"
- "--scenario=kubernetes_"
- "--" # end bootstrap args, scenario args below
- "--install=gubernator/test_requirements.txt"
- "--test=//..."
- "--test-args=--config=lint"
env:
- name: BAZEL_REMOTE_CACHE_ENABLED
value: "true"
# Bazel needs privileged mode in order to sandbox builds.
securityContext:
privileged: true
volumeMounts:
resources:
requests:
memory: "2Gi"

- name: pull-test-infra-verify-bazel
agent: kubernetes
context: pull-test-infra-verify-bazel
Expand Down
9 changes: 9 additions & 0 deletions testgrid/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,10 @@ test_groups:
gcs_prefix: kubernetes-jenkins/pr-logs/directory/pull-test-infra-bazel-canary
days_of_results: 1
num_columns_recent: 20
- name: pull-test-infra-lint
gcs_prefix: kubernetes-jenkins/pr-logs/directory/pull-test-infra-lint
days_of_results: 1
num_columns_recent: 20
- name: pull-test-infra-gubernator
gcs_prefix: kubernetes-jenkins/pr-logs/directory/pull-test-infra-gubernator
days_of_results: 1
Expand Down Expand Up @@ -5079,6 +5083,11 @@ dashboards:
base_options: 'width=10'
alerts_options:
alert_mail_to_addresses: '[email protected]'
- name: lint
test_group_name: pull-test-infra-lint
base_options: 'width=10'
alerts_options:
alert_mail_to_addresses: '[email protected]'
- name: bazel-canary
test_group_name: pull-test-infra-bazel-canary
base_options: 'width=10'
Expand Down

0 comments on commit 51c56f9

Please sign in to comment.