cleans up comments, adds short testing options to more tests

This commit is contained in:
Tai Groot
2021-05-16 23:19:59 -07:00
parent 54b77122a5
commit 125e4771dd
3 changed files with 12 additions and 18 deletions

View File

@@ -17,6 +17,9 @@ import (
// - your user doesn't have a PolKit rule allowing access to configure nginx
func TestGetStartTime(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
testCases := []struct {
unit string
err error
@@ -132,6 +135,9 @@ func TestGetNumRestarts(t *testing.T) {
}
// Prove restart count increases by one after a restart
t.Run(fmt.Sprintf("prove restart count increases by one after a restart"), func(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
if userString != "root" && userString != "system" {
t.Skip("skipping superuser test while running as user")
}
@@ -268,6 +274,9 @@ func TestGetPID(t *testing.T) {
})
}
t.Run(fmt.Sprintf("prove pid changes"), func(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
if userString != "root" && userString != "system" {
t.Skip("skipping superuser test while running as user")
}