Skip to content

Add support for Vagrant VMs in 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

Open
wants to merge 84 commits into
base: master
Choose a base branch
from

Conversation

NouemanKHAL
Copy link
Member

@NouemanKHAL NouemanKHAL commented May 22, 2025

What does this PR do?

  • Add support for running E2E tests on VMs.

  • Updates the AgentInterface to pass the entire Application object which includes logging functionalities from the Terminal base class and access to ddev config via the self.config member.

  • Uses the E2E_METADATA as an interface to customize the VM via the following properties:

VM Configuration

  • vagrant_box: Specifies the Vagrant box image (defaults to "net9/ubuntu-24.04-arm64")
  • vagrant_guest_os: Determines OS type ("linux" or "windows" not supported yet) for path formatting and commands
  • vagrant_synced_folders: List of additional folders to sync between host and VM

Agent Configuration

  • env: Dictionary of environment variables to export in the VM
  • dd_hostname: Custom hostname for the Agent
  • dd_apm_enabled: Enable/disable APM (defaults to "false")
  • dd_telemetry_enabled: Enable/disable telemetry (defaults to "true")
  • dd_expvar_port: Port for expvar endpoint (defaults to "5000")
  • proxy: HTTP/HTTPS proxy configuration

Lifecycle Commands

  • start_commands: List of shell commands to run during VM startup
  • post_install_commands: Commands to run after local package installation
  • stop_commands: Commands to execute before VM shutdown

Permission Management

  • vagrant_sudoers_config: Custom sudoers rules for dd-agent user
  • vagrant_logs_require_sudo: Whether sudo is needed to read agent logs (defaults to true)
  • vagrant_command_needs_sudo: Global sudo requirement flag

Provisioning Control

  • vagrant_provision: Flag to force provisioning on next vagrant up
  • vagrant_provision_on_reload: Whether to reprovision on VM reload (defaults to true)

Windows-specific

  • vagrant_windows_agent_service_name: Service name for Windows Agent (defaults to "DatadogAgent")

Motivation

Provide better E2E testing for host based integrations.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

@NouemanKHAL NouemanKHAL changed the title [WIP] Add support for vm_run context manager for testing [WIP] Add support for Vagrant VMs for testing Jun 4, 2025
Copy link
Contributor

@dkirov-dd dkirov-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look great to me, added a few comments and suggestions

@NouemanKHAL NouemanKHAL changed the base branch from noueman/glusterfs-vendor-gstatus to master July 22, 2025 08:51
@NouemanKHAL NouemanKHAL requested a review from a team as a code owner July 22, 2025 08:51
@NouemanKHAL NouemanKHAL changed the title Add support for Vagrant VMs for testing Add support for Vagrant VMs in testing Jul 22, 2025
dkirov-dd
dkirov-dd previously approved these changes Jul 23, 2025
Copy link
Contributor

@dkirov-dd dkirov-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@temporal-github-worker-1 temporal-github-worker-1 bot dismissed dkirov-dd’s stale review July 24, 2025 08:23

Review from dkirov-dd is dismissed. Related teams and files:

  • agent-integrations
    • datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py
@NouemanKHAL NouemanKHAL mentioned this pull request Jul 24, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants