code: def test_launch_build_succeeds(
      relay_server,
      user,
      monkeypatch,
      runner,
      args,
      override_config,
  ):
      base_args = [
          "-u",
          "https://github.com/wandb/examples.git",
          "--entity",
          user,
          "--entry-point",
          "python main.py",
          "-c",
          json.dumps(override_config),
      ]
  
      monkeypatch.setattr(
          wandb.sdk.launch.builder.build,
          "validate_docker_installation",
          lambda: None,
      )
  
      async def patched_launch_add(*args, **kwargs):
          if not kwargs.get("build"):
              raise Exception(kwargs)
  
          if "--repository" in args:
              if not kwargs.get("repository"):
                  raise Exception(kwargs)
  
          if args[3]:  # config
              assert args[3] == override_config
  
      monkeypatch.setattr(
          "wandb.cli.cli._launch_add",
          patched_launch_add,
      )
  
      with runner.isolated_filesystem(), relay_server():
          result = runner.invoke(cli.launch, base_args + args)
  
          assert result.exit_code == 0
  
imports: import json
  from unittest.mock import Mock
  import pytest
  import wandb
  from wandb.cli import cli
  from wandb.sdk.launch.errors import LaunchError
label_desc: Use image node_id 2 for calling a global function with example usage: test_launch_build_succeeds(relay_server, user, monkeypatch, runner, args, override_config) without return types