Skip to content

Commit

Permalink
Update sensors/sensors_test.go
Browse files Browse the repository at this point in the history
Co-authored-by: shirou <[email protected]>
  • Loading branch information
sni and shirou authored Oct 14, 2024
1 parent 25d60f8 commit b339e38
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions sensors/sensors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,24 @@ func TestTemperatureStat_String(t *testing.T) {
}
}

func skipIfNotImplementedErr(t *testing.T, err error) {
if errors.Is(err, common.ErrNotImplementedError) {

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: errors (typecheck)

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-22.04)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-22.04)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-24.04)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-24.04)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-20.04)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-20.04)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-22.04)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-22.04)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / build_test (1.22.8)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / build_test (1.22.8)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-20.04)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-20.04)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-14)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-14)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / build_test (1.23.2)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / build_test (1.23.2)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-13)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-13)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-24.04)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-24.04)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-13)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-13)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, windows-2022)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, windows-2022)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-14)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-14)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-12)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-12)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-12)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-12)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, windows-2022)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, windows-2022)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, windows-2019)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, windows-2019)

undefined: common

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, windows-2019)

undefined: errors

Check failure on line 25 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, windows-2019)

undefined: common
t.Skip("not implemented")
}
}

func TestTemperatures(t *testing.T) {
// make sure it does not segfault
sensors.TemperaturesWithContext(context.TODO())
if os.Getenv("CI") != "" {

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: os (typecheck)

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-22.04)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-24.04)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-20.04)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, ubuntu-22.04)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / build_test (1.22.8)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-20.04)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-14)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / build_test (1.23.2)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-13)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, ubuntu-24.04)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-13)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, windows-2022)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-14)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, macos-12)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, macos-12)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, windows-2022)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.8, windows-2019)

undefined: os

Check failure on line 31 in sensors/sensors_test.go

View workflow job for this annotation

GitHub Actions / test (1.23.2, windows-2019)

undefined: os
t.Skip("Skip CI")
}

v, err := SensorsTemperatures()
skipIfNotImplementedErr(t, err)
if err != nil {
t.Errorf("error %v", err)
}
if len(v) == 0 {
t.Errorf("Could not get temperature %v", v)
}
t.Log(v)
}

0 comments on commit b339e38

Please sign in to comment.