Skip to content

Commit fc8bb7a

Browse files
authored
Merge pull request #51 from ZeroMagic/skip
chore: skip unnecessary sanity tests
2 parents a1cd700 + e4b316f commit fc8bb7a

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ jobs:
2424
- go test -covermode=count -coverprofile=profile.cov ./pkg/...
2525
- stage: test
2626
name: "sanity test"
27-
script: make sanity-test
28-
after_failure: TRAVIS_TEST_RESULT=0
27+
script:
28+
- make blobfuse
29+
- make sanity-test
2930
- stage: test
3031
name: "integration test"
3132
install:

test/sanity/run-test.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
18+
set -euo pipefail
19+
20+
if [ -v GOPATH ]; then
21+
mkdir $GOPATH/src/github.com/kubernetes-csi
22+
pushd $GOPATH/src/github.com/kubernetes-csi
23+
git clone https://github.com/kubernetes-csi/csi-test.git -b v1.1.0
24+
pushd $GOPATH/src/github.com/kubernetes-csi/csi-test/cmd/csi-sanity
25+
make && make install
26+
popd
27+
popd
28+
fi
29+
30+
endpoint="unix:///tmp/csi.sock"
31+
32+
echo "being to run sanity test ..."
33+
34+
sudo _output/blobfuseplugin --endpoint $endpoint --nodeid CSINode -v=5 &
35+
36+
sudo $GOPATH/src/github.com/kubernetes-csi/csi-test/cmd/csi-sanity/csi-sanity --ginkgo.v --csi.endpoint=$endpoint -ginkgo.skip='should fail when requesting to create a volume with already existing name and different capacity'
37+
38+
retcode=$?
39+
40+
if [ $retcode -ne 0 ]; then
41+
exit $retcode
42+
fi
43+
44+
# kill blobfuseplugin first
45+
echo "pkill -f blobfuseplugin"
46+
sudo /usr/bin/pkill -f blobfuseplugin
47+
48+
echo "sanity test is completed."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if [ -v aadClientSecret ]; then
3737
sed -i "s/resourceGroup-input/$resourceGroup/g" $AZURE_CREDENTIAL_FILE
3838
sed -i "s/location-input/$location/g" $AZURE_CREDENTIAL_FILE
3939

40-
sudo ${GO_BIN_PATH} test -v ./test/sanity/...
40+
test/sanity/run-test.sh
4141
else
4242
if [ -v subscriptionId ]; then
4343
echo "skip sanity test in CI env"

0 commit comments

Comments
 (0)