Merged
Conversation
urso
approved these changes
Oct 30, 2019
|
LGTM. Let's see what CI thinks. |
Member
|
run beats-ci/package |
Member
|
The auditbeat test failure is also related to initialization of testing flags. Here's the fix: diff --git a/auditbeat/module/file_integrity/eventreader_fsevents.go b/auditbeat/module/file_integrity/eventreader_fsevents.go
index e9f5384e7..c22994838 100644
--- a/auditbeat/module/file_integrity/eventreader_fsevents.go
+++ b/auditbeat/module/file_integrity/eventreader_fsevents.go
@@ -20,7 +20,6 @@
package file_integrity
import (
- "flag"
"os"
"path/filepath"
"strings"
@@ -34,10 +33,6 @@ import (
var underTest = false
-func init() {
- underTest = flag.Lookup("test.v") != nil
-}
-
type fsreader struct {
stream *fsevents.EventStream
config Config
diff --git a/auditbeat/module/file_integrity/eventreader_test.go b/auditbeat/module/file_integrity/eventreader_test.go
index f444aa6ea..6d9b02f78 100644
--- a/auditbeat/module/file_integrity/eventreader_test.go
+++ b/auditbeat/module/file_integrity/eventreader_test.go
@@ -32,6 +32,10 @@ import (
"github.com/stretchr/testify/assert"
)
+func init() {
+ underTest = true
+}
+
// ErrorSharingViolation is a Windows ERROR_SHARING_VIOLATION. It means "The
// process cannot access the file because it is being used by another process."
const ErrorSharingViolation syscall.Errno = 32 |
adriansr
approved these changes
Nov 1, 2019
|
@andrewkroh What is the impact of setting underTest to true, always. Maybe we want to have a lazy call in the module constructor using sync.Once. Like: |
Member
|
The |
|
Makes sense. Thanks for the clarification. In this sense I'd say that your proposed change even makes this a little cleaner. |
jorgemarey
pushed a commit
to jorgemarey/beats
that referenced
this pull request
Jun 8, 2020
* Update Go to 1.13.3 * Register flags in the new testing.Init function for Go 1.13. * Update tz data * Fix eventreader test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.