diff --git a/BUILD.bazel b/BUILD.bazel index 1561664..568ca74 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") load("@bazel_gazelle//:def.bzl", "gazelle") # load(":rules.bzl", "foo_binary") @@ -103,3 +103,10 @@ go_binary( goos = "linux", visibility = ["//visibility:public"], ) + +go_test( + name = "osquery-extension_test", + srcs = ["main_test.go"], + embed = [":osquery-extension_lib"], + deps = ["@com_github_stretchr_testify//assert"], +) diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..fc74855 --- /dev/null +++ b/main_test.go @@ -0,0 +1,12 @@ +package main + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestVersionIsValid(t *testing.T) { + assert.NotEmpty(t, Version) + assert.NotEqual(t, "0", Version) +} diff --git a/tables/sofa/client_test.go b/tables/sofa/client_test.go index 04d5c24..4ff20c2 100644 --- a/tables/sofa/client_test.go +++ b/tables/sofa/client_test.go @@ -62,6 +62,7 @@ func TestDownloadFile(t *testing.T) { client, err := NewSofaClient( WithURL(server.URL), WithCacheDir(cwd), + WithUserAgent("test"), ) assert.NoError(t, err)