Skip to content

Commit dcbbf77

Browse files
test: remove v1 binary commands from GitHub actions and Makefile
1 parent 2810c45 commit dcbbf77

File tree

6 files changed

+6
-150
lines changed

6 files changed

+6
-150
lines changed

.github/workflows/windows.yml

-10
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,8 @@ jobs:
1414
go-version: ${{ matrix.go-version }}
1515
- name: Checkout code
1616
uses: actions/checkout@v2
17-
- name: Build
18-
run: |
19-
go build -v -a -o ./bin/csi-proxy.exe ./cmd/csi-proxy
2017
- name: Run Windows Integration Tests
2118
run: |
22-
# start the CSI Proxy before running tests on windows
23-
Start-Job -Name CSIProxy -ScriptBlock {
24-
.\bin\csi-proxy.exe
25-
};
26-
Start-Sleep -Seconds 30;
27-
Write-Output "getting named pipes"
28-
[System.IO.Directory]::GetFiles("\\.\\pipe\\")
2919
$env:CSI_PROXY_GH_ACTIONS="TRUE"
3020
go test -v -race ./integrationtests/...
3121
unit_tests:

Makefile

+4-44
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
CMDS=csi-proxy
2-
all: build test
1+
all: test
32

43
# include release tools for building binary and testing targets
54
include release-tools/build.make
@@ -10,42 +9,6 @@ REPO_ROOT = $(CURDIR)
109
BUILD_DIR = bin
1110
BUILD_TOOLS_DIR = $(BUILD_DIR)/tools
1211
GO_ENV_VARS = GO111MODULE=on GOOS=windows
13-
CSI_PROXY_API_GEN = $(BUILD_DIR)/csi-proxy-api-gen
14-
15-
.PHONY: compile-csi-proxy-api-gen
16-
compile-csi-proxy-api-gen:
17-
GO111MODULE=on go build -o $(CSI_PROXY_API_GEN) ./cmd/csi-proxy-api-gen
18-
19-
.PHONY: generate
20-
generate: generate-protobuf generate-csi-proxy-api-gen
21-
22-
# using xargs instead of -exec since the latter doesn't propagate exit statuses
23-
.PHONY: generate-protobuf
24-
generate-protobuf:
25-
@ if ! which protoc > /dev/null 2>&1; then echo 'Unable to find protoc binary' ; exit 1; fi
26-
@ generate_protobuf_for() { \
27-
local FILE="$$1"; \
28-
local FILE_DIR="$$(dirname "$(GOPATH)/$$FILE")"; \
29-
echo "Generating protobuf file from $$FILE in $$FILE_DIR"; \
30-
protoc -I "$(GOPATH)/src/" -I '$(REPO_ROOT)/client/api' "$$FILE" --go_out=plugins="grpc:$(GOPATH)/src"; \
31-
} ; \
32-
export -f generate_protobuf_for; \
33-
find '$(REPO_ROOT)' -not -path './vendor/*' -name '*.proto' | sed -e "s|$(GOPATH)/src/||g" | xargs -n1 '$(SHELL)' -c 'generate_protobuf_for "$$0"'
34-
35-
.PHONY: generate-csi-proxy-api-gen
36-
generate-csi-proxy-api-gen: compile-csi-proxy-api-gen
37-
$(CSI_PROXY_API_GEN) -i github.com/kubernetes-csi/csi-proxy/client/api,github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/api/dummy --v=8
38-
39-
.PHONY: clean
40-
clean: clean-protobuf clean-generated
41-
42-
.PHONY: clean-protobuf
43-
clean-protobuf:
44-
find '$(REPO_ROOT)' -name '*.proto' -exec '$(SHELL)' -c 'rm -vf "$$(dirname {})/$$(basename {} .proto).pb.go"' \;
45-
46-
.PHONY: clean-generated
47-
clean-generated:
48-
find '$(REPO_ROOT)' -name '*_generated.go' -exec '$(SHELL)' -c '[[ "$$(head -n 1 "{}")" == "// Code generated by csi-proxy-api-gen"* ]] && rm -v {}' \;
4912

5013
# see https://github.com/golangci/golangci-lint/releases
5114
GOLANGCI_LINT_VERSION = v1.21.0
@@ -60,17 +23,14 @@ lint: $(GOLANGCI_LINT)
6023
test: test-go
6124
test-go:
6225
@ echo; echo "### $@:"
63-
# TODO: After issue https://github.com/microsoft/go-winio/pull/169 is resolved, remove the filter on the test path.
64-
GO111MODULE=on go test `find ./internal/server/ -type d -not -name server`;\
65-
cd client && GO111MODULE=on go test `go list ./... | grep -v group` && cd ../
26+
GO111MODULE=on go test ./pkg/...
6627

6728
.PHONY: test-vet
6829
test: test-vet
6930
test-vet:
7031
@ echo; echo "### $@:"
71-
# TODO: After issue https://github.com/microsoft/go-winio/pull/169 is resolved, remove the filter on the test path.
72-
# GO111MODULE=on go vet `find ./internal/server/ -type d -not -name server`;\
73-
cd client && GO111MODULE=on go vet `go list ./... | grep -v group` && cd ../
32+
GO111MODULE=on go vet ./pkg/...
33+
7434
# see https://github.com/golangci/golangci-lint#binary-release
7535
$(GOLANGCI_LINT):
7636
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$$(dirname '$(GOLANGCI_LINT)')" '$(GOLANGCI_LINT_VERSION)'

scripts/run-integration.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# - a kubernetes cluster with a Windows nodepool
88
#
99
# Steps:
10-
# - cross compile the csi-proxy binary and the integration tests
10+
# - cross compile the csi-proxy integration tests
1111
# - copy to the VM using scp
12-
# - restart the CSI Proxy binary process with a helper powershell script
1312
# - run the integration tests
1413

1514
set -euxo pipefail
@@ -18,12 +17,8 @@ pkgdir=${GOPATH}/src/github.com/kubernetes-csi/csi-proxy
1817
source $pkgdir/scripts/utils.sh
1918

2019
main() {
21-
compile_csi_proxy
2220
compile_csi_proxy_integration_tests
23-
sync_csi_proxy
2421
sync_csi_proxy_integration_tests
25-
sync_powershell_utils
26-
restart_csi_proxy
2722
run_csi_proxy_integration_tests
2823
}
2924

scripts/sync-csi-proxy.sh

-26
This file was deleted.

scripts/utils.psm1

-41
This file was deleted.

scripts/utils.sh

+1-23
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,23 @@ sync_file_to_vm() {
1919
gcloud compute scp $@ $windows_node:"C:\\Users\\${current_account}"
2020
}
2121

22-
compile_csi_proxy() {
23-
echo "Compiling CSI Proxy"
24-
make -C $pkgdir build
25-
}
26-
2722
compile_csi_proxy_integration_tests() {
2823
echo "Compiling CSI Proxy integration tests"
2924
GOOS=windows GOARCH=amd64 go test -c $pkgdir/integrationtests -o $pkgdir/bin/integrationtests.test.exe
3025
}
3126

32-
sync_csi_proxy() {
33-
echo "Sync the csi-proxy.exe binary"
34-
local csi_proxy_bin_path="$pkgdir/bin/csi-proxy.exe"
35-
sync_file_to_vm $csi_proxy_bin_path
36-
}
37-
3827
sync_csi_proxy_integration_tests() {
3928
echo "Sync the integrationtests.exe binary"
4029
local integration_bin_path="$pkgdir/bin/integrationtests.test.exe"
4130
sync_file_to_vm $integration_bin_path
4231
}
4332

44-
sync_powershell_utils() {
45-
local utils_psm1="$pkgdir/scripts/utils.psm1"
46-
sync_file_to_vm $utils_psm1
47-
}
48-
49-
restart_csi_proxy() {
50-
echo "Restart csi-proxy service"
51-
gcloud compute ssh $windows_node --command='powershell -c "& { $ErrorActionPreference = \"Stop\"; Import-Module (Resolve-Path(\"utils.psm1\")); Restart-CSIProxy; }"'
52-
}
53-
5433
run_csi_proxy_integration_tests() {
5534
echo "Run integration tests"
5635
local ps1=$(cat << 'EOF'
5736
"& {
5837
$ErrorActionPreference = \"Stop\";
59-
Import-Module (Resolve-Path(\"utils.psm1\"));
60-
Run-CSIProxyIntegrationTests -test_args \"--test.v\";
38+
.\integrationtests.test.exe --test.v
6139
}"
6240
EOF
6341
);

0 commit comments

Comments
 (0)