Skip to content

Commit

Permalink
Merge pull request #521 from andyzhangx/windows-ut-pipeline
Browse files Browse the repository at this point in the history
test: add Windows unit test pipeline
  • Loading branch information
andyzhangx authored Sep 6, 2020
2 parents f6950cd + 887e4ff commit dd9ecf7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/window → .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ jobs:
go build -a -o _output/azurediskplugin.exe ./pkg/azurediskplugin
- name: Run Windows Unit Tests
run: |
go test -v -race ./pkg/... ./test/utils/credentials
go test -v -race ./pkg/mounter/...
go test -v -race ./pkg/util/...
go test -v -race ./pkg/csi-common/...
7 changes: 4 additions & 3 deletions pkg/azuredisk/azure_common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ package azuredisk

import (
"fmt"
api "k8s.io/kubernetes/pkg/apis/core"
"os"
"runtime"
"strings"
"testing"
"time"

api "k8s.io/kubernetes/pkg/apis/core"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
"github.com/stretchr/testify/assert"

Expand Down Expand Up @@ -122,8 +123,8 @@ func (handler *fakeIOHandler) ReadFile(filename string) ([]byte, error) {
}

func TestIoHandler(t *testing.T) {
if runtime.GOOS != "windows" && runtime.GOOS != "linux" {
t.Skipf("TestIoHandler not supported on GOOS=%s", runtime.GOOS)
if runtime.GOOS == "windows" {
t.Skipf("skip test on GOOS=%s", runtime.GOOS)
}
disk, err := findDiskByLun(lun, &fakeIOHandler{}, nil)
if runtime.GOOS == "windows" {
Expand Down
7 changes: 6 additions & 1 deletion pkg/azuredisk/nodeserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"os"
"reflect"
"runtime"
"syscall"
"testing"

Expand All @@ -30,7 +31,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"k8s.io/utils/exec/testing"
testingexec "k8s.io/utils/exec/testing"
"k8s.io/utils/mount"

"sigs.k8s.io/azuredisk-csi-driver/pkg/mounter"
Expand Down Expand Up @@ -232,6 +233,10 @@ func TestNodeGetVolumeStats(t *testing.T) {
}

func TestNodeStageVolume(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skipf("skip test on GOOS=%s", runtime.GOOS)
}

stdVolCap := &csi.VolumeCapability_Mount{
Mount: &csi.VolumeCapability_MountVolume{
FsType: defaultLinuxFsType,
Expand Down

0 comments on commit dd9ecf7

Please sign in to comment.