Skip to content

Commit 0aacecd

Browse files
authored
Merge pull request #8755 from jackfrancis/dedicated-ut-files
ci: CA and VPA specific UT scripts
2 parents fa05190 + 96ab55a commit 0aacecd

File tree

5 files changed

+59
-59
lines changed

5 files changed

+59
-59
lines changed

.github/workflows/ca-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Test
3838
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler
39-
run: hack/for-go-proj.sh cluster-autoscaler
39+
run: hack/go-unit-tests-ca.sh
4040
env:
4141
GO111MODULE: auto
4242
PROJECT_NAMES: ""

.github/workflows/vpa-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Test
3939
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler
40-
run: hack/for-go-proj.sh vertical-pod-autoscaler
40+
run: hack/go-unit-tests-vpa.sh
4141
env:
4242
GO111MODULE: auto
4343
PROJECT_NAMES: ""

hack/for-go-proj.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

hack/go-unit-tests-ca.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/bash
2+
3+
# Copyright 2014 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o pipefail
19+
set -o nounset
20+
21+
CONTRIB_ROOT="$(dirname ${BASH_SOURCE})/.."
22+
23+
pushd ${CONTRIB_ROOT}/cluster-autoscaler/
24+
# TODO: #8127 - Use default analyzers set by `go test` to include `printf` analyzer.
25+
# Default analyzers that go test runs according to https://github.com/golang/go/blob/52624e533fe52329da5ba6ebb9c37712048168e0/src/cmd/go/internal/test/test.go#L649
26+
# This doesn't include the `printf` analyzer until cluster-autoscaler libraries are updated.
27+
ANALYZERS="atomic,bool,buildtags,directive,errorsas,ifaceassert,nilfunc,slog,stringintconv,tests"
28+
go test -count=1 ./... -vet="${ANALYZERS}"
29+
popd

hack/go-unit-tests-vpa.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /bin/bash
2+
3+
# Copyright 2014 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o pipefail
19+
set -o nounset
20+
21+
CONTRIB_ROOT="$(dirname ${BASH_SOURCE})/.."
22+
23+
pushd ${CONTRIB_ROOT}/vertical-pod-autoscaler
24+
go test -count=1 -race $(go list ./... | grep -v /vendor/ | grep -v vertical-pod-autoscaler/e2e)
25+
popd
26+
pushd ${CONTRIB_ROOT}/vertical-pod-autoscaler/e2e
27+
go test -run=None ./...
28+
popd

0 commit comments

Comments
 (0)