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>
This commit is contained in:
Daniel Swarbrick 2023-08-15 11:38:13 +02:00 committed by GitHub
parent 3fb5f70b0c
commit 37ce0bab8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 51 additions and 4 deletions

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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"

View file

@ -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) {

View file

@ -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 (

View file

@ -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 (

View file

@ -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"

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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"
)

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (