Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add extra equipment installation checks #2151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions tests/antennas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ var antennaChecks = map[string]func(*meta.Set) func(t *testing.T){
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.InstalledAntennas() {
if i.End.After(i.Start) {
continue
}
t.Errorf("installed antenna is removed before it has been installed: %s", i.String())
}
}
},

"check for antenna installation mark overlaps": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
installs := make(map[string]meta.InstalledAntennaList)
Expand Down
11 changes: 11 additions & 0 deletions tests/cameras_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ var cameraChecks = map[string]func(*meta.Set) func(t *testing.T){
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.InstalledCameras() {
if i.End.After(i.Start) {
continue
}
t.Errorf("installed camera is removed before it has been installed: %s", i.String())
}
}
},

"check for cameras installation mount overlaps": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
keys := make(map[string]interface{})
Expand Down
11 changes: 11 additions & 0 deletions tests/dataloggers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ var dataloggerChecks = map[string]func(*meta.Set) func(t *testing.T){
}
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.DeployedDataloggers() {
if i.End.After(i.Start) {
continue
}
t.Errorf("deployed datalogger is removed before it has been installed: %s", i.String())
}
}
},
}

func TestDataloggers(t *testing.T) {
Expand Down
11 changes: 11 additions & 0 deletions tests/doases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ var doasChecks = map[string]func(*meta.Set) func(t *testing.T){
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.Doases() {
if i.End.After(i.Start) {
continue
}
t.Errorf("installed doas is removed before it has been installed: %s", i.String())
}
}
},

"check for doases installation mount overlaps": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
keys := make(map[string]interface{})
Expand Down
10 changes: 10 additions & 0 deletions tests/metsensors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ var metSensorChecks = map[string]func(*meta.Set) func(t *testing.T){
}
}
},
"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.InstalledMetSensors() {
if i.End.After(i.Start) {
continue
}
t.Errorf("installed metsensor is removed before it has been installed: %s", i.String())
}
}
},
"check for missing metsensor marks": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
keys := make(map[string]interface{})
Expand Down
12 changes: 11 additions & 1 deletion tests/radomes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var installedRadomeChecks = map[string]func(*meta.Set) func(t *testing.T){
}
}
},

"check for overlapping radomes installations": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
installs := make(map[string]meta.InstalledRadomeList)
Expand Down Expand Up @@ -63,6 +62,17 @@ var installedRadomeChecks = map[string]func(*meta.Set) func(t *testing.T){
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.InstalledRadomes() {
if i.End.After(i.Start) {
continue
}
t.Errorf("installed radome is removed before it has been installed: %s", i.String())
}
}
},

"check for missing radome marks": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {

Expand Down
11 changes: 11 additions & 0 deletions tests/receivers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ var deployedReceiverChecks = map[string]func(*meta.Set) func(t *testing.T){
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.DeployedReceivers() {
if i.End.After(i.Start) {
continue
}
t.Errorf("deployed receiver is removed before it has been installed: %s", i.String())
}
}
},

"check for missing receiver marks": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {

Expand Down
11 changes: 11 additions & 0 deletions tests/recorders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ var installedRecorderChecks = map[string]func(*meta.Set) func(t *testing.T){
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.InstalledRecorders() {
if i.End.After(i.Start) {
continue
}
t.Errorf("installed recorder is removed before it has been installed: %s", i.String())
}
}
},

"check for invalid sensor azimuth": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {

Expand Down
11 changes: 11 additions & 0 deletions tests/sensors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@ var installedSensorChecks = map[string]func(*meta.Set) func(t *testing.T){
}
},

"check for invalid installation dates": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {
for _, i := range set.InstalledSensors() {
if i.End.After(i.Start) {
continue
}
t.Errorf("installed sensor is removed before it has been installed: %s", i.String())
}
}
},

"check for invalid sensor azimuth": func(set *meta.Set) func(t *testing.T) {
return func(t *testing.T) {

Expand Down
Loading