8000 [WIP] Add support for Vagrant VMs for testing by NouemanKHAL · Pull Request #20353 · DataDog/integrations-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[WIP] Add support for Vagrant VMs for testing #20353

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

Draft
wants to merge 30 commits into
base: noueman/glusterfs-vendor-gstatus
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2278322
add CheckVMLogs helper
NouemanKHAL May 22, 2025
579a08a
add support for vm_run context manager
NouemanKHAL May 22, 2025
4f70c80
test with glusterfs integration
NouemanKHAL May 22, 2025
9ea3d51
cleanup CheckVMLogs implementation
NouemanKHAL May 22, 2025
0344885
WIP: working VM setup + agent install , working ddev env agent commands
NouemanKHAL Jun 3, 2025
7f39a1d
working check command and config mounting
NouemanKHAL Jun 3, 2025
bbe7070
add support for vagrant in env_type in the plugin README
NouemanKHAL Jun 3, 2025
4c10969
fix glusterfs init config
NouemanKHAL Jun 3, 2025
4774f79
add gluster volumes -> E2E tests passing
NouemanKHAL Jun 3, 2025
f21b7ba
fix glusterfs version to 7
NouemanKHAL Jun 4, 2025
17364fa
revert plugin/pytest.py single quote -> double quote changes
NouemanKHAL Jun 4, 2025
6e7a8af
remove unnecessary formatting file changes
NouemanKHAL Jun 4, 2025
ac8527e
clean README changes
NouemanKHAL Jun 4, 2025
95b645f
add comment for CheckVMLogs condition
NouemanKHAL Jun 4, 2025
6083061
remove quote -> double quotes changes
NouemanKHAL Jun 4, 2025
a571131
conftest cleanup
NouemanKHAL Jun 4, 2025
6f87de2
add support for custom agent build via pipeline-id
NouemanKHAL Jun 12, 2025
efda745
wip: fix pip install command for local package
NouemanKHAL Jun 12, 2025
265d208
working --dev flag for local package installation
NouemanKHAL Jun 12, 2025
469d928
fix agent_env_vars keyword name and cleanup code
NouemanKHAL Jun 12, 2025
d05aebc
add support for custom memory and cpus for the vagrant VM
NouemanKHAL Jun 12, 2025
2a8ea78
fix exporting env vars + fix vm cpus and memory fields error
NouemanKHAL Jun 15, 2025
9bd48b1
add env metadata key
NouemanKHAL Jun 15, 2025
15af706
small cleanup
NouemanKHAL Jun 16, 2025
003ebac
refactor + fix dd_hostname handling
NouemanKHAL Jun 16, 2025
4f42406
more cleanup + fix agent restart cmd + use jinja for VagrantFile temp…
NouemanKHAL Jun 16, 2025
df351c2
remove checkVMLogs unused conditions
NouemanKHAL Jun 16, 2025
39bc26e
revert deleting the conditions.py file, only delete the new CheckVMLo…
NouemanKHAL Jun 17, 2025
132ee85
lint
NouemanKHAL Jun 23, 2025
f9535dd
fix version number committed by accident
NouemanKHAL Jun 25, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
from .core import create_interface, derive_interface
from .run import start_environment, stop_environment

E2E_SUPPORTED_TYPES = {'docker', 'local'}
E2E_SUPPORTED_TYPES = {'docker', 'local', 'vagrant'}
38 changes: 38 additions & 0 deletions ddev/src/ddev/e2e/agent/Vagrantfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

$set_environment_variables = <<SCRIPT
tee "/etc/profile.d/myvars.sh" > "/dev/null" <<EOF

export DD_API_KEY="{{ dd_api_key }}"
export LOCAL_IP=$(hostname -I | cut -d ' ' -f 1)
export DD_SITE="datadoghq.com"
export DD_HOSTNAME=$(hostname)
{{ exported_env_vars_str }}

EOF
SCRIPT


Vagrant.configure("2") do |config|
config.vm.box = "{{ vagrant_box }}"
config.vm.box_version = "1.1"

{{ synced_folders_str | safe }}
config.vm.network "private_network", ip: "172.30.1.5"

config.vm.define "{{ vm_hostname }}" do |node|
node.vm.hostname = "{{ vm_hostname }}"

node.vm.provision "shell", inline: $set_environment_variables, run: "always"

node.vm.provision "shell", inline: <<-SHELL, run: "always"
apt update
echo "DD_ENV_VARS: {{ agent_install_env_vars_str }}" # TODO: remove this, debugging purposes only
{{ agent_install_env_vars_str }} bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
service datadog-agent start && echo "Agent started successfully"
echo "VM {{ vm_hostname }} is ready"
SHELL
end

end
9 changes: 7 additions & 2 deletions ddev/src/ddev/e2e/agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@


def get_agent_interface(agent_type: str) -> type[AgentInterface]:
if agent_type == 'docker':
if agent_type == "docker":
from ddev.e2e.agent.docker import DockerAgent

return DockerAgent

raise NotImplementedError(f'Unsupported Agent type: {agent_type}')
if agent_type == "vagrant":
from ddev.e2e.agent.vagrant import VagrantAgent

return VagrantAgent

raise NotImplementedError(f"Unsupported Agent type: {agent_type}")
Loading
Loading
0