Skip to content

Commit

Permalink
[check-log] skip few tests on Windows
Browse files Browse the repository at this point in the history
On GitHub Actions, pagefile.sys can be read.
So we couldn't found the file that occurs access denied when read it.
  • Loading branch information
lufia committed May 28, 2020
1 parent 11aa98f commit a4525c7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions check-log/lib/check-log_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ func TestLoadStateIfFileNotExist(t *testing.T) {
}

func TestLoadStateIfAccessDenied(t *testing.T) {
var file string
switch runtime.GOOS {
case "windows":
file = `C:\pagefile.sys`
default:
file = "testdata/plain.txt/file"
t.Skip()
}
file := "testdata/plain.txt/file"
s, err := loadState(file)
if err == nil {
t.Errorf("loadState(%q) = %v; want an error", file, s)
Expand Down Expand Up @@ -192,13 +190,11 @@ func TestGetBytesToSkipOldIfFileNotExist(t *testing.T) {
}

func TestGetBytesToSkipOldErr(t *testing.T) {
var file string
switch runtime.GOOS {
case "windows":
file = `C:\pagefile.sys`
default:
file = "testdata/plain.txt/file"
t.Skip()
}
file := "testdata/plain.txt/file"
n, err := getBytesToSkipOld(file)
if err == nil {
t.Errorf("getBytesToSkip(%s) = %d; but want an error", file, n)
Expand Down

0 comments on commit a4525c7

Please sign in to comment.