Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Windows tests for x-pack/packetbeat #39767

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .buildkite/x-pack/pipeline.xpack.packetbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ steps:

- label: ":windows: x-pack/packetbeat Win-2022 System Tests"
key: "mandatory-win-2022-system-tests"
skip: "skipping due to elastic/beats#38142"
# skip: "skipping due to elastic/beats#38142"
command: |
Set-Location -Path x-pack/packetbeat
mage systemTest
Expand Down Expand Up @@ -222,7 +222,7 @@ steps:

- label: ":windows: x-pack/packetbeat Win 10 System Tests"
key: "extended-win-10-system-tests"
skip: "skipping due to elastic/beats#38142"
# skip: "skipping due to elastic/beats#38142"
command: |
Set-Location -Path x-pack/packetbeat
mage systemTest
Expand Down
13 changes: 4 additions & 9 deletions x-pack/packetbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,6 @@ func SystemTest(ctx context.Context) error {
return devtools.GoTest(ctx, args)
}

func getBucketName() string {
if os.Getenv("BUILDKITE") == "true" {
return "ingest-buildkite-ci"
}
return "obs-ci-cache"
}

// getNpcapInstaller gets the installer from the Google Cloud Storage service.
//
// On Windows platforms, if getNpcapInstaller is invoked with the environment variables
Expand All @@ -191,6 +184,9 @@ func getNpcapInstaller() error {
if runtime.GOOS != "windows" {
return nil
}
if runtime.GOOS == "windows" && os.Getenv("BUILDKITE") == "true" {
return nil
}
if os.Getenv("CI") != "true" && os.Getenv("NPCAP_LOCAL") != "true" {
return errors.New("only available if running in the CI or with NPCAP_LOCAL=true")
}
Expand All @@ -205,8 +201,7 @@ func getNpcapInstaller() error {
return err
}
}
ciBucketName := getBucketName()

fmt.Printf("getting %s from private cache\n", installer)
return sh.RunV("gsutil", "cp", "gs://"+ciBucketName+"/private/"+installer, dstPath)
return sh.RunV("gsutil", "cp", "gs://obs-ci-cache/private/"+installer, dstPath)
}
1 change: 1 addition & 0 deletions x-pack/packetbeat/tests/system/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@

ifcs, err := net.Interfaces()
require.NoError(t, err)
var expected []string

Check failure on line 62 in x-pack/packetbeat/tests/system/app_test.go

View workflow job for this annotation

GitHub Actions / lint (windows)

Consider pre-allocating `expected` (prealloc)
for _, ifc := range ifcs {
expected = append(expected, fmt.Sprintf("%d:%s:%s", ifc.Index, ifc.Name, ifc.Flags))
}
t.Log("Expect interfaces:\n", expected)
t.Log("Actual interfaces:\n", stdout)

for _, ifc := range ifcs {
assert.Contains(t, stdout, ifc.Name)
Expand Down
Loading