The golang test mechanism is used to validate delta information.
Related groups of checks are split into different files with the golang
naming
scheme of xxxx_test.go
. Each test should be in a function called TestXXX
.
There is a helper function loadListFile
which can reduce the amount of code needed to
load a csv
formatted List
file. This is only used inside the testing framework.
Generally the layout of the tests will be along the lines of:
func TestStations(t *testing.T) {
var stations meta.StationList
loadListFile(t, "../network/stations.csv", &stations)
t.Run("check for duplicated stations", func(t *testing.T) {
// actual test
}
...
}
Tests can be run using go test
in the directory containing the test files.
These checks will produce error messages which will generally mean the data will not be allowed to be merged into the repository.
antennas_test.go
- check for antenna installation equipment overlaps
antennas_test.go
- check for antenna installation mark overlaps
- check for missing antenna marks
- check for missing antenna assets
- check for missing antenna sessions
assets_test.go
- check for duplicate asset numbers
- check for duplicate equipment
cameras_test.go
- check for cameras installation equipment overlaps
- check for missing camera mounts
- Load camera assets file
combined_test.go
- check for sensor/recorder installation location overlaps
connections_test.go
- check for connection overlaps
- check for missing connection stations
- check for missing connection sites
- check for missing connection locations
- check for connection span mismatch
- check for missing connection places
- check for missing sensor connections
- check for missing datalogger connections
consistency_test.go
- check file consistency
constituents_test.go
- check for constituent duplications
- check for missing constituent gauges
dataloggers_test.go
- check for datalogger installation place overlaps
- check for datalogger installation equipment overlaps
- check for missing datalogger assets
firmware_test.go
- check for firmware history overlaps
- check for firmware receiver assets
- check for latest installed receiver firmware
gauges_test.go
- check for gauge duplication
- check for missing gauge stations
marks_test.go
- check for duplicated marks
metsensors_test.go
- check for metsensors installation equipment overlaps
- check for missing metsensor marks
- check for missing metsensor assets
monuments_test.go
- check for monument duplication
- check for monument ground relationships
- check for monument types
networks_test.go
- check for network duplication
radomes_test.go
- check for radomes installation equipment overlaps
- check for overlapping radomes installations
- check for missing radome marks
- check for missing radome assets
receivers_test.go
- check for particular receiver installation overlaps
- check for receiver installation equipment overlaps
- check for missing receiver marks
- check for missing receiver assets
recorders_test.go
- check for recorder installation equipment overlaps
- check for missing recorder stations
- check for recorder assets
sensors_test.go
- check for missing sensors
- check for sensor installation overlaps
- check for missing sensor stations
- check for missing sensor sites
- check for invalid sensor azimuth
- check for invalid sensor dip
- check for missing sensor assets
sessions_test.go
- check for session overlaps
- check for missing session marks
- check for session span mismatches
- check for unknown session satellite systems
sites_test.go
- check for duplicated sites
- check for invalid dates: site within station
stations_test.go
- check for duplicated stations
streams_test.go
- check for invalid stream sample rates
- check for invalid stream spans
- check for invalid stream stations
- check for invalid stream sites
- check for invalid stream locations
- check for invalid stream spans
- check for missing recorder streams
- check for missing sensor streams
There are a number of checks which are non-enforcing and will only produce
warning messages when the verbose flag is used (-v
) or when an unrelated
error is encountered in which case these warnings will be bundled into the
output.
Once these checks pass without error it is intended that they become enforcing checks.
sites_test.go
- check for duplicated sites
- check for invalid dates: site within station
streams_test.go
- check for invalid dates: stream within station
- check for invalid dates: stream within site