Browse Source

Sync build tags in *_test.go (#2767)

Ensure that unwanted tests are correctly excluded when various build
tags are specified, i.e. when the code that they test would be excluded
from compilation.

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
pull/2780/head
Daniel Swarbrick 1 year ago committed by GitHub
parent
commit
37ce0bab8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      collector/bonding_linux_test.go
  2. 3
      collector/diskstats_linux_test.go
  3. 3
      collector/ethtool_linux_test.go
  4. 3
      collector/filefd_linux_test.go
  5. 5
      collector/filesystem_linux_test.go
  6. 3
      collector/interrupts_linux_test.go
  7. 3
      collector/ipvs_linux_test.go
  8. 3
      collector/loadavg_linux_test.go
  9. 3
      collector/logind_linux_test.go
  10. 3
      collector/meminfo_linux_test.go
  11. 3
      collector/meminfo_numa_linux_test.go
  12. 3
      collector/netdev_linux_test.go
  13. 3
      collector/netstat_linux_test.go
  14. 5
      collector/perf_linux_test.go
  15. 3
      collector/systemd_linux_test.go
  16. 3
      collector/tcpstat_linux_test.go
  17. 3
      collector/textfile_test.go

3
collector/bonding_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nobonding
// +build !nobonding
package collector
import (

3
collector/diskstats_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodiskstats
// +build !nodiskstats
package collector
import (

3
collector/ethtool_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noethtool
// +build !noethtool
package collector
import (

3
collector/filefd_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nofilefd
// +build !nofilefd
package collector
import "testing"

5
collector/filesystem_linux_test.go

@ -11,14 +11,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nofilesystem
// +build !nofilesystem
package collector
import (
"github.com/go-kit/log"
"strings"
"testing"
"github.com/alecthomas/kingpin/v2"
"github.com/go-kit/log"
)
func Test_parseFilesystemLabelsError(t *testing.T) {

3
collector/interrupts_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nointerrupts
// +build !nointerrupts
package collector
import (

3
collector/ipvs_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noipvs
// +build !noipvs
package collector
import (

3
collector/loadavg_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noloadavg
// +build !noloadavg
package collector
import "testing"

3
collector/logind_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nologind
// +build !nologind
package collector
import (

3
collector/meminfo_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomeminfo
// +build !nomeminfo
package collector
import (

3
collector/meminfo_numa_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomeminfo_numa
// +build !nomeminfo_numa
package collector
import (

3
collector/netdev_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetdev
// +build !nonetdev
package collector
import (

3
collector/netstat_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetstat
// +build !nonetstat
package collector
import (

5
collector/perf_linux_test.go

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noprocesses
// +build !noprocesses
//go:build !noperf
// +build !noperf
package collector
@ -24,7 +24,6 @@ import (
"testing"
"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

3
collector/systemd_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nosystemd
// +build !nosystemd
package collector
import (

3
collector/tcpstat_linux_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !notcpstat
// +build !notcpstat
package collector
import (

3
collector/textfile_test.go

@ -11,6 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !notextfile
// +build !notextfile
package collector
import (

Loading…
Cancel
Save