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

New mage target: generate pkg file to test the manager #15580

Merged
merged 3 commits into from
Jan 15, 2020
Merged
Changes from 1 commit
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
29 changes: 29 additions & 0 deletions x-pack/functionbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package main

import (
"fmt"
"os"
"path/filepath"
"time"

Expand Down Expand Up @@ -147,6 +148,34 @@ func GoTestUnit() {
mg.Deps(unittest.GoUnitTest)
}

func BuildPkgForFunctions() error {
kvch marked this conversation as resolved.
Show resolved Hide resolved
mg.Deps(Update, Build)

err := os.MkdirAll("pkg", 700)
if err != nil {
return err
}

filesToCopy := map[string]string{
filepath.Join("provider", "aws", "functionbeat-aws"): filepath.Join("pkg", "functionbeat-aws"),
filepath.Join("provider", "gcp", "pubsub", "pubsub.go"): filepath.Join("pkg", "pubsub", "pubsub.go"),
filepath.Join("provider", "gcp", "storage", "storage.go"): filepath.Join("pkg", "storage", "storage.go"),
filepath.Join("provider", "gcp", "build", "pubsub", "vendor"): filepath.Join("pkg", "pubsub", "vendor"),
filepath.Join("provider", "gcp", "build", "storage", "vendor"): filepath.Join("pkg", "storage", "vendor"),
}
for src, dest := range filesToCopy {
c := &devtools.CopyTask{
Source: src,
Dest: dest,
}
err = c.Execute()
if err != nil {
return err
}
}
return nil
}

// BuildSystemTestBinary build a binary for testing that is instrumented for
// testing and measuring code coverage. The binary is only instrumented for
// coverage when TEST_COVERAGE=true (default is false).
Expand Down