code: def test_launch_build_fails(
      relay_server,
      user,
      monkeypatch,
      runner,
      args,
  ):
      base_args = [
          "-u",
          "https://foo:bar@github.com/FooTest/Foo.git",
          "--entity",
          user,
          "--entry-point",
          "python main.py",
      ]
  
      monkeypatch.setattr(
          wandb.sdk.launch.builder.build,
          "validate_docker_installation",
          lambda: None,
      )
  
      def patched_fetch_and_val(launch_project, _):
          return launch_project
  
      monkeypatch.setattr(
          wandb.sdk.launch.builder.build,
          "fetch_and_validate_project",
          lambda *args, **kwargs: patched_fetch_and_val(
              *args, **kwargs
          ),
      )
  
      monkeypatch.setattr(
          "wandb.docker",
          lambda: "docker",
      )
  
      with runner.isolated_filesystem(), relay_server():
          result = runner.invoke(cli.launch, base_args + args)
  
          if args == ["--build"]:
              assert result.exit_code == 1
              assert (
                  "Build flag requires a queue to be set"
                  in result.output
              )
          elif args == ["--build=builder"]:
              assert result.exit_code == 2
              assert (
                  "Option '--build' does not take a value"
                  in result.output
                  or "Error: --build option does not take a value"
                  in result.output
              )
  
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 3 for calling a global function with example usage: test_launch_build_fails(relay_server, user, monkeypatch, runner, args) and returns: launch_project