docstr: Test Nsight profile generate report on logs dir
docstr_tok: ["Test","Nsight","profile","generate","report","on","logs","dir"]
code: def test_nsight_basic(
      self,
      shutdown_only,
  ):
      """Test Nsight profile generate report on logs dir"""
      ray.init()
      session_dir = ray.worker._global_node.get_session_dir_path()
      profilers_dir = Path(session_dir) / "logs" / "nsight"
  
      # test nsight default config
      @ray.remote(runtime_env={"nsight": "default"})
      def test_generate_report():
          return 0
  
      ray.get(test_generate_report.remote())
  
      wait_for_condition(
          wait_for_report, profilers_dir=profilers_dir, num_reports=1
      )
      nsys_reports = glob.glob(
          os.path.join(f"{profilers_dir}/*.nsys-rep")
      )
      assert len(nsys_reports) == 1
      for report in nsys_reports:
          assert "worker_process_" in report
          os.remove(report)
  
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 1 for calling the TestNsightProfiler obj's underlying member method code with example usage: obj.test_nsight_basic(shutdown_only) and returns: int