| Crates.io | testlint |
| lib.rs | testlint |
| version | 0.1.0 |
| created_at | 2026-01-22 05:04:50.099142+00 |
| updated_at | 2026-01-22 05:04:50.099142+00 |
| description | A comprehensive toolkit for profiling and coverage reporting across multiple programming languages |
| homepage | |
| repository | https://github.com/yourusername/testlint-sdk |
| max_upload_size | |
| id | 2060783 |
| size | 1,772,179 |
A comprehensive toolkit for profiling and coverage reporting across multiple programming languages.
Continuous runtime profiling for 9 languages: Python, Go, TypeScript/JavaScript, Java, Rust, C#, Ruby, PHP, and C++.
Supported Languages:
Profiling Outputs:
Automatically wrap code execution with coverage collection - run your tests, collect coverage, and optionally upload - all in one command!
Features:
Currently Supported:
Collect JavaScript coverage from browser testing!
Generates wrapper scripts for Playwright and Puppeteer to automatically collect JavaScript coverage during E2E and integration tests in real browsers.
Supported Tools:
Features:
Quick Start:
# Generate Playwright coverage wrapper
./target/release/browser_coverage playwright --example
# Generate Puppeteer coverage wrapper
./target/release/browser_coverage puppeteer --example
# Run tests - coverage collected automatically
npx playwright test
# View HTML report
npx nyc report --reporter=html
Use Cases:
Attach to running processes to collect code coverage in real-time!
Unlike traditional coverage (which wraps new test runs), runtime coverage attaches to already-running processes to measure what code is being executed in production or long-running applications.
Supported Languages:
Full Runtime Injection (works on any running process):
Partial Support (requires pre-instrumented builds):
-cover flag-C instrument-coverage)-fprofile-arcs -ftest-coverage)Use Cases:
Examples:
# Full runtime injection (works on any process)
./target/release/runtime_coverage python --pid 12345
./target/release/runtime_coverage java --pid 5678
./target/release/runtime_coverage csharp --pid 9999
./target/release/runtime_coverage ruby --pid 3333
./target/release/runtime_coverage javascript --pid 4444
# Partial support (requires pre-instrumented build)
./target/release/runtime_coverage go --pid 5555 # Process built with -cover
./target/release/runtime_coverage rust --pid 6666 # Built with -C instrument-coverage
./target/release/runtime_coverage php --pid 7777 # Xdebug enabled
./target/release/runtime_coverage cpp --pid 8888 # Built with gcov flags
Important Notes:
Upload existing coverage reports from various testing frameworks to your backend.
Supported Coverage Formats:
https://quality-web-app.pages.dev/api/v0/profiles# Clone repository
git clone https://github.com/yourusername/testlint-sdk.git
cd testlint-sdk
# Build all binaries
cargo build --release
# Binaries will be in target/release/
# - profiler: Runtime profiling tool (CPU/performance profiling)
# - runtime_coverage: Runtime coverage collector (attach to running processes)
# - run_with_coverage: Coverage orchestrator (wrap test execution)
# - upload_coverage: Coverage upload tool
# - browser_coverage: Browser testing coverage setup (Playwright/Puppeteer)
# 1. Generate coverage with your testing tool
coverage run -m pytest
coverage json -o coverage.json
# 2. Upload to backend
./target/release/upload_coverage \
--file coverage.json python coverage.py \
--project my-project
# Full documentation: See COVERAGE_UPLOAD.md
# Profile a Python application (continuous until Ctrl+C)
./target/release/profiler python server.py
# Profile with JSON export
./target/release/profiler python app.py --json profile.json
# Profile with backend reporting
export PROFILER_ENDPOINT="https://api.example.com/profiles"
export PROFILER_API_KEY="your-api-key"
./target/release/profiler python app.py
# Python coverage.py
./target/release/upload_coverage \
--file coverage.json python coverage.py \
--project myapp
# Java JaCoCo
./target/release/upload_coverage \
--file target/site/jacoco/jacoco.xml java jacoco \
--project my-java-app
# JavaScript Jest/Istanbul
./target/release/upload_coverage \
--file coverage/lcov.info javascript lcov \
--project my-web-app
# Go
./target/release/upload_coverage \
--file coverage.out go golang \
--project my-go-service
# Multiple files (monorepo)
./target/release/upload_coverage \
--file backend/coverage.json python coverage.py \
--file frontend/coverage/lcov.info javascript lcov \
--project fullstack-app
📖 Complete documentation: COVERAGE_UPLOAD.md
# Python - generates flamegraph, supports PID attach
./target/release/profiler python server.py
./target/release/profiler python --pid 12345
# Go - CPU profiling with pprof
./target/release/profiler go main.go
# TypeScript/JavaScript - V8 CPU profiling
./target/release/profiler typescript app.ts
./target/release/profiler javascript server.js
# Java - Java Flight Recorder
./target/release/profiler java MyApp.java
./target/release/profiler java --pid 5678
# Kotlin - Uses Java/JVM tooling (JFR)
./target/release/profiler kotlin MyApp.kt
./target/release/profiler kotlin --pid 5678
# Scala - Uses Java/JVM tooling (JFR)
./target/release/profiler scala MyApp.scala
./target/release/profiler scala --pid 5678
# Rust - flamegraph via cargo-flamegraph or perf
./target/release/profiler rust src/main.rs
./target/release/profiler rust --pid 9999 # Linux only
# C# - dotnet-trace profiling
./target/release/profiler csharp Program.cs
./target/release/profiler csharp --pid 11111
# Ruby - rbspy flamegraph
./target/release/profiler ruby server.rb
./target/release/profiler ruby --pid 22222
# PHP - Xdebug cachegrind files
./target/release/profiler php index.php
# C++ - perf or valgrind/callgrind
./target/release/profiler cpp ./myapp
./target/release/profiler cpp --pid 33333 # Linux only
# With backend reporting (sends profiles every 5 minutes)
./target/release/profiler python server.py \
--report-endpoint https://quality-web-app.pages.dev/api/v0/profiles \
--report-interval 60 \
--api-key your-api-key
# Using environment variables
export PROFILER_ENDPOINT=https://quality-web-app.pages.dev/api/v0/profiles
export PROFILER_API_KEY=your-api-key
./target/release/profiler python server.py
The profiler can automatically send profiling data to a backend API for centralized monitoring and analysis.
Quick Start:
# Enable reporting with CLI options
cargo run -- python app.py --report-endpoint https://quality-web-app.pages.dev/api/v0/profiles
# Or use environment variables
export PROFILER_ENDPOINT=https://quality-web-app.pages.dev/api/v0/profiles
export PROFILER_API_KEY=your-secret-key
cargo run -- python app.py
Configuration Options:
--report-endpoint <url> - Backend API URL (default: https://quality-web-app.pages.dev/api/v0/profiles)--report-interval <secs> - Report interval in seconds (default: 300)--api-key <key> - API key for authenticationEnvironment Variables:
PROFILER_ENDPOINT - Backend endpoint URLPROFILER_INTERVAL - Report intervalPROFILER_API_KEY - API key📖 See REPORTING.md for complete documentation, examples, and backend implementation guide.
All JVM languages use the same underlying tooling since they compile to JVM bytecode:
Profiling: Uses Java Flight Recorder (JFR)
Runtime Coverage: Uses JaCoCo agent
Coverage Orchestrator: Uses JaCoCo
Examples:
# Kotlin profiling
./target/release/profiler kotlin MyApp.kt
./target/release/profiler kotlin --pid 12345
# Scala profiling
./target/release/profiler scala MyApp.scala
./target/release/profiler scala --pid 12345
# Kotlin runtime coverage
./target/release/runtime_coverage kotlin --pid 12345
# Kotlin coverage orchestration
./target/release/run_with_coverage kotlin gradle test
For Python files, runtime profiling uses py-spy, a sampling profiler that can attach to running processes.
Requirements:
sudo on macOS/Linux for process attachmentInstallation:
# Via pip
pip install py-spy
# Via cargo
cargo install py-spy
# Via conda
conda install -c conda-forge py-spy
Usage:
# Profile a Python script for 10 seconds
cargo run -- python script.py --runtime 10
# Profile server simulation
cargo run -- python examples/server_simulation.py --runtime 5
# With JSON export
cargo run -- python script.py --runtime 10 --json output.json
How it works:
Version Check:
# Check Python version
python3 --version
# Should show 3.10.0 or later (recommended)
# Check py-spy installation
py-spy --version
# Should show 0.3.0 or later
Supported Python Versions:
For detailed version information and troubleshooting, see PYTHON_VERSION_REQUIREMENTS.md.
For TypeScript and JavaScript files, profiling uses Node.js's built-in CPU profiler:
Requirements:
--cpu-prof)Usage:
# Profile a JavaScript file
cargo run -- javascript script.js
# Profile a TypeScript file (will run as-is with Node.js)
cargo run -- typescript app.ts
# Attach to a running Node.js process (NEW!)
cargo run -- javascript --pid 12345
# Multiple language aliases supported
cargo run -- node server.js
cargo run -- js app.js
cargo run -- ts index.ts
PID Attach Profiling:
NEW! TypeScript/JavaScript now supports PID attach via V8 Inspector Protocol:
Requirements for PID Attach:
--inspect flag for guaranteed inspector availabilityHow it works:
node --cpu-prof.cpuprofile JSON fileVersion Check:
# Check if your Node.js version supports profiling
node --version
# Should show v12.0.0 or later
# Test that --cpu-prof flag is available
node --help | grep cpu-prof
For detailed version information and troubleshooting, see NODEJS_VERSION_REQUIREMENTS.md.
Export profiling data to a standardized JSON format for integration with other tools:
# Static analysis only
cargo run -- python examples/sample.py --json output.json
# With runtime profiling
cargo run -- python examples/sample.py --runtime 5 --json output.json
The common format includes:
The project uses a modular architecture with:
src/profiler/mod.rs): Defines the LanguageProfiler trait and ProfileResult structuresrc/profiler/python.rs: Python code analysissrc/profiler/go.rs: Go code analysissrc/profiler/typescript.rs: TypeScript code analysisEach language profiler implements the LanguageProfiler trait and uses regex patterns to detect language-specific constructs.
To add support for a new language:
src/profiler/rust.rs)LanguageProfiler traitLanguage enum in src/profiler/mod.rsProfiler::profile()src/main.rsregex: For pattern matching in source code analysisserde & serde_json: For parsing py-spy profiling outputpy-spy 0.3.0+: Install with pip install py-spysudo on macOS/Linux for attaching to processes--cpu-prof flag was introduced in v12.0.0py-spy (optional): Required for Python runtime profiling. Install with pip install py-spy