Skip to content

Commit b7b4628

Browse files
authored
Add integration build tag (#258)
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.
1 parent 4486532 commit b7b4628

File tree

11 files changed

+3
-19
lines changed

11 files changed

+3
-19
lines changed

.buildkite/scripts/test.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Write-Host "--- Run test"
2121
$ErrorActionPreference = "Continue" # set +e
2222
mkdir -p build
2323
$OUT_FILE="output-report.out"
24-
go test "./..." -v > $OUT_FILE
24+
go test -tags integration "./..." -v > $OUT_FILE
2525
$EXITCODE=$LASTEXITCODE
2626
$ErrorActionPreference = "Stop"
2727

.buildkite/scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ with_go_junit_report
1111

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

file/helper_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build !integration
19-
2018
package file
2119

2220
import (

kibana/url_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build !integration
19-
2018
package kibana
2119

2220
import (

logp/core_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build linux
18+
//go:build linux && integration
1919

2020
package logp
2121

mapstr/mapstr_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build !integration
19-
2018
package mapstr
2119

2220
import (

monitoring/opts_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build !integration
19-
2018
package monitoring
2119

2220
import (

monitoring/registry_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build !integration
19-
2018
package monitoring
2119

2220
import (

monitoring/visitor_expvar_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build !integration
19-
2018
package monitoring
2119

2220
import (

transform/typeconv/datetime_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//go:build !integration
19-
2018
package typeconv
2119

2220
import (

0 commit comments

Comments
 (0)