Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Windows Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
go-versions: [1.13.x]
platform: [windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run Windows Unit Tests
run: |
go test -v -race ./pkg/...
13 changes: 10 additions & 3 deletions pkg/blob/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 Down Expand Up @@ -125,7 +126,13 @@ func TestEnsureMountPoint(t *testing.T) {

func TestNodePublishVolume(t *testing.T) {
volumeCap := csi.VolumeCapability_AccessMode{Mode: csi.VolumeCapability_AccessMode_MULTI_NODE_MULTI_WRITER}

createDirError := status.Errorf(codes.Internal,
"Could not mount target \"./azure.go\": mkdir ./azure.go: not a directory")
if runtime.GOOS == "windows" {
createDirError = status.Errorf(codes.Internal,
"Could not mount target \"./azure.go\": mkdir ./azure.go: "+
"The system cannot find the path specified.")
}
tests := []struct {
desc string
req csi.NodePublishVolumeRequest
Expand Down Expand Up @@ -170,7 +177,7 @@ func TestNodePublishVolume(t *testing.T) {
TargetPath: "./azure.go",
StagingTargetPath: sourceTest,
Readonly: true},
expectedErr: status.Errorf(codes.Internal, "Could not mount target \"./azure.go\": mkdir ./azure.go: not a directory"),
expectedErr: createDirError,
},
{
desc: "Error mounting resource busy",
Expand Down Expand Up @@ -198,7 +205,7 @@ func TestNodePublishVolume(t *testing.T) {
_, err := d.NodePublishVolume(context.Background(), &test.req)

if !reflect.DeepEqual(err, test.expectedErr) {
t.Errorf("Unexpected error: %v", err)
t.Errorf("Desc: %s - Unexpected error: %v - Expected: %v", test.desc, err, test.expectedErr)
}
}

Expand Down