Skip to content

Commit 7e73b49

Browse files
committed
chore: enable sanity test in CI
enable sanity test config
1 parent a30ebb5 commit 7e73b49

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ script:
1818
- hack/verify-all.sh
1919
- go test -covermode=count -coverprofile=profile.cov ./pkg/...
2020
- make blobfuse
21+
- make sanity-test
2122
- make integration-test
2223
- make blobfuse-windows

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ test:
3131
$GOPATH/bin/goveralls -coverprofile=profile.cov -service=travis-ci
3232
integration-test:
3333
sudo test/integration/run-tests-all-clouds.sh
34-
test-sanity:
35-
go test -v ./test/sanity/...
34+
sanity-test:
35+
test/sanity/run-tests-all-clouds.sh
3636
blobfuse:
3737
if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi
3838
CGO_ENABLED=0 GOOS=linux go build -a -ldflags ${LDFLAGS} -o _output/blobfuseplugin ./pkg/blobfuseplugin

test/sanity/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export set AZURE_CREDENTIAL_FILE=
1313

1414
### Run integration tests
1515
```
16-
make test-sanity
16+
make sanity-test
1717
```
1818

test/sanity/run-tests-all-clouds.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# Copyright 2019 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 -euo pipefail
18+
19+
export set AZURE_CREDENTIAL_FILE=/tmp/azure.json
20+
21+
# run test on AzurePublicCloud
22+
if [ -v aadClientSecret ]; then
23+
cp test/integration/azure.json $AZURE_CREDENTIAL_FILE
24+
25+
sed -i "s/tenantId-input/$tenantId/g" $AZURE_CREDENTIAL_FILE
26+
sed -i "s/subscriptionId-input/$subscriptionId/g" $AZURE_CREDENTIAL_FILE
27+
sed -i "s/aadClientId-input/$aadClientId/g" $AZURE_CREDENTIAL_FILE
28+
sed -i "s#aadClientSecret-input#$aadClientSecret#g" $AZURE_CREDENTIAL_FILE
29+
sed -i "s/resourceGroup-input/$resourceGroup/g" $AZURE_CREDENTIAL_FILE
30+
sed -i "s/location-input/$location/g" $AZURE_CREDENTIAL_FILE
31+
32+
go test -v ./test/sanity/...
33+
fi
34+
35+
# run test on AzureChinaCloud
36+
if [ -v aadClientSecret_china ]; then
37+
cp test/integration/azure.json $AZURE_CREDENTIAL_FILE
38+
39+
sed -i "s/AzurePublicCloud/AzureChinaCloud/g" $AZURE_CREDENTIAL_FILE
40+
sed -i "s/tenantId-input/${tenantId_china}/g" $AZURE_CREDENTIAL_FILE
41+
sed -i "s/subscriptionId-input/${subscriptionId_china}/g" $AZURE_CREDENTIAL_FILE
42+
sed -i "s/aadClientId-input/${aadClientId_china}/g" $AZURE_CREDENTIAL_FILE
43+
sed -i "s#aadClientSecret-input#${aadClientSecret_china}#g" $AZURE_CREDENTIAL_FILE
44+
sed -i "s/resourceGroup-input/${resourceGroup_china}/g" $AZURE_CREDENTIAL_FILE
45+
sed -i "s/location-input/${location_china}/g" $AZURE_CREDENTIAL_FILE
46+
47+
go test -v ./test/sanity/...
48+
fi
49+
50+
# make it always succeed for now
51+
exit 0

0 commit comments

Comments
 (0)