docstr: Test Nsight profile for invalid option
docstr_tok: ["Test","Nsight","profile","for","invalid","option"]
code: def test_nsight_invalid_option(
      self,
      shutdown_only,
  ):
      """Test Nsight profile for invalid option"""
      ray.init()
      session_dir = ray.worker._global_node.get_session_dir_path()
      profilers_dir = Path(session_dir) / "logs" / "nsight"
  
      # test nsight invalid config
      @ray.remote(
          runtime_env={
              "nsight": {
                  "not-option": "random",
              }
          }
      )
      def test_invalid_nsight():
          return 0
  
      with pytest.raises(
          RuntimeEnvSetupError,
          match="nsight profile failed to run with the following error message",
      ):
          ray.get(test_invalid_nsight.remote())
  
      nsys_reports = glob.glob(
          os.path.join(f"{profilers_dir}/*.nsys-rep")
      )
      assert len(nsys_reports) == 0
  
      """Test Nsight profile for unavailable string option"""
  
      # test nsight not supported string config
      @ray.remote(runtime_env={"nsight": "not_default"})
      def test_wrong_config_nsight():
          return 0
  
      with pytest.raises(
          RuntimeEnvSetupError,
          match="Unsupported nsight config: not_default.",
      ):
          ray.get(test_wrong_config_nsight.remote())
  
      nsys_reports = glob.glob(
          os.path.join(f"{profilers_dir}/*.nsys-rep")
      )
      assert len(nsys_reports) == 0
  
file_path: ray/python/ray/tests/test_runtime_env_profiler.py
imports: import os
  import glob
  import sys
  from pathlib import Path
  import pytest
  import subprocess
  import ray
  from ray._private.runtime_env.nsight import parse_nsight_config
  from ray._private.test_utils import wait_for_condition
  from ray.exceptions import RuntimeEnvSetupError
label_desc: Use image node_id 4 for calling the TestNsightProfiler obj's underlying member method code with example usage: obj.test_nsight_invalid_option(shutdown_only) and returns: int, int