Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Jul 25, 2023
1 parent 46b1da6 commit c9d20bb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
44 changes: 44 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,48 @@ Vagrant.configure("2") do |config|
end
end

config.vm.define "beats" do |nodeconfig|
nodeconfig.vm.box = "ubuntu/jammy64"

# We deliberately set a fully-qualified domain name for the VM; it helps
# test the FQDN feature flag.
nodeconfig.vm.hostname = "beats-dev.elastic.dev.internal"

nodeconfig.vm.network "private_network",
hostname: true,
ip: "192.168.56.44" # only 192.168.56.0/21 range allowed: https://www.virtualbox.org/manual/ch06.html#network_hostonly
nodeconfig.vm.network "forwarded_port",
guest: 4244,
host: 4244,
id: "delve"

nodeconfig.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
vb.customize ["modifyvm", :id, "--vram", "128"]
# Customize the amount of memory on the VM:
vb.memory = "4096"
end

nodeconfig.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y \
build-essential \
curl \
delve \
make \
unzip
vim \
wget
curl -sL -o /tmp/go#{GO_VERSION}.linux-amd64.tar.gz https://go.dev/dl/go#{GO_VERSION}.linux-amd64.tar.gz
tar -C /usr/local -xzf /tmp/go#{GO_VERSION}.linux-amd64.tar.gz
curl -sL -o /tmp/mage_1.15.0_Linux-64bit.tar.gz https://github.com/magefile/mage/releases/download/v1.15.0/mage_1.15.0_Linux-64bit.tar.gz
tar -C /tmp -xf /tmp/mage_1.15.0_Linux-64bit.tar.gz
mv /tmp/mage /usr/local/bin/mage
echo "alias ll='ls -la'" > /etc/profile.d/ll.sh
echo 'export PATH=$PATH:/usr/local/go/bin' > /etc/profile.d/go.sh
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> /etc/profile.d/go.sh
SHELL
end

end
5 changes: 4 additions & 1 deletion dev-tools/mage/gotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func DefaultTestBinaryArgs() TestBinaryArgs {
}

// GoTestIntegrationForModule executes the Go integration tests sequentially.
// Currently all test cases must be present under "./module" directory.
// Currently, all test cases must be present under "./module" directory.
//
// Motivation: previous implementation executed all integration tests at once,
// causing high CPU load, high memory usage and resulted in timeouts.
Expand Down Expand Up @@ -307,8 +307,11 @@ func GoTest(ctx context.Context, params GoTestArgs) error {
// Generate a HTML code coverage report.
var htmlCoverReport string
if params.CoverageProfileFile != "" {


htmlCoverReport = strings.TrimSuffix(params.CoverageProfileFile,
filepath.Ext(params.CoverageProfileFile)) + ".html"

coverToHTML := sh.OutCmd("go", "tool", "cover",
"-html="+params.CoverageProfileFile,
"-o", htmlCoverReport)
Expand Down

0 comments on commit c9d20bb

Please sign in to comment.