Skip to content

Commit

Permalink
Add integration build tag (#258)
Browse files Browse the repository at this point in the history
The test TestSyslogOutputCanBeClosed requires no syslog running
on the host and root privileges to execute. Most Linux distros
already have a syslog daemon running, causing test failures
during development. These failures make it difficult to identify
real issues with the tests.

Given this, introduce an integration build tag
and run this test only by default on CI.

The integration build tag was previously used only for negative
matches in certain tests, which is not meaningful. Remove the
!integration annotations.
  • Loading branch information
mauri870 authored Dec 24, 2024
1 parent 4486532 commit b7b4628
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Write-Host "--- Run test"
$ErrorActionPreference = "Continue" # set +e
mkdir -p build
$OUT_FILE="output-report.out"
go test "./..." -v > $OUT_FILE
go test -tags integration "./..." -v > $OUT_FILE
$EXITCODE=$LASTEXITCODE
$ErrorActionPreference = "Stop"

Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with_go_junit_report

echo "--- Go Test"
set +e
go test -race -v ./... > tests-report.txt
go test -tags integration -race -v ./... > tests-report.txt
exit_code=$?
set -e

Expand Down
2 changes: 0 additions & 2 deletions file/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package file

import (
Expand Down
2 changes: 0 additions & 2 deletions kibana/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package kibana

import (
Expand Down
2 changes: 1 addition & 1 deletion logp/core_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build linux
//go:build linux && integration

package logp

Expand Down
2 changes: 0 additions & 2 deletions mapstr/mapstr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package mapstr

import (
Expand Down
2 changes: 0 additions & 2 deletions monitoring/opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package monitoring

import (
Expand Down
2 changes: 0 additions & 2 deletions monitoring/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package monitoring

import (
Expand Down
2 changes: 0 additions & 2 deletions monitoring/visitor_expvar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package monitoring

import (
Expand Down
2 changes: 0 additions & 2 deletions transform/typeconv/datetime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package typeconv

import (
Expand Down
2 changes: 0 additions & 2 deletions transport/tlscommon/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build !integration

package tlscommon

import (
Expand Down

0 comments on commit b7b4628

Please sign in to comment.