MCPcopy Create free account
hub / github.com/FastLED/FastLED / _extract_test_name

Function _extract_test_name

ci/util/test_runner.py:774–809  ·  view source on GitHub ↗

Extract a human-readable test name from a command

(command: str | list[str])

Source from the content-addressed store, hash-verified

772
773
774def _extract_test_name(command: str | list[str]) -> str:
775 """Extract a human-readable test name from a command"""
776 if isinstance(command, list):
777 command = " ".join(command)
778
779 # Extract test name patterns
780 if "--test " in command:
781 # Extract specific test name after --test flag
782 parts = command.split("--test ")
783 if len(parts) > 1:
784 test_name = parts[1].split()[0]
785 return test_name
786 elif ".exe" in command:
787 # Extract from executable name
788 for part in command.split():
789 if part.endswith(".exe"):
790 return part.replace(".exe", "")
791 elif "python" in command and "-m " in command:
792 # Extract module name
793 parts = command.split("-m ")
794 if len(parts) > 1:
795 module = parts[1].split()[0]
796 return module.replace("ci.compiler.", "").replace("ci.", "")
797 elif "python" in command and command.endswith(".py"):
798 # Extract script name
799 for part in command.split():
800 if part.endswith(".py"):
801 return part.split("/")[-1].replace(".py", "")
802
803 # Fallback to first meaningful part of command
804 parts = command.split()
805 for part in parts[1:]: # Skip 'uv' or 'python'
806 if not part.startswith("-") and "python" not in part:
807 return part
808
809 return "unknown_test"
810
811
812def _create_skipped_timing(

Callers 7

_run_parallelMethod · 0.90
_build_failure_listMethod · 0.90
_run_sequentialMethod · 0.90
_get_friendly_test_nameFunction · 0.85
start_monitoringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected