This directory contains a comprehensive VS Code configuration for developing and testing the CF Java Plugin test suite.
-
Open the workspace: Use the workspace file in the root directory:
code ../cf-java-plugin.code-workspace
-
Install recommended extensions: VS Code will prompt you to install recommended extensions.
-
Setup environment: Run the setup task from the Command Palette:
Ctrl/Cmd + Shift + P→ "Tasks: Run Task" → "Setup Virtual Environment"
- Debug Current Test File - Debug the currently open test file
- Debug Current Test Method - Debug a specific test method (prompts for class/method)
- Debug Custom Filter - Debug tests matching a custom filter pattern
- Run All Tests - Run the entire test suite
- Run Basic Commands Tests - Run only basic command tests
- Run JFR Tests - Run only JFR (Java Flight Recorder) tests
- Run Async-profiler Tests - Run only async-profiler tests (SapMachine)
- Run Integration Tests - Run full integration tests
- Run Heap Tests - Run all heap-related tests
- Run Profiling Tests - Run all profiling tests (JFR + async-profiler)
- Interactive Test Runner - Launch the interactive test runner
- Run All Tests - Execute all tests
- Run Current Test File - Run the currently open test file
- Run Basic Commands Tests - Basic command functionality
- Run JFR Tests - Java Flight Recorder tests
- Run Async-profiler Tests - Async-profiler tests
- Run Integration Tests - Full integration tests
- Run Heap Tests (Pattern) - Tests matching "heap"
- Run Profiling Tests (Pattern) - Tests matching "jfr or asprof"
- Run Tests in Parallel - Parallel test execution
- Generate HTML Test Report - Create HTML test report
- Setup Virtual Environment - Initialize/setup the Python environment
- Clean Test Artifacts - Clean up test files and artifacts
- Interactive Test Runner - Launch interactive test selector
- Install/Update Dependencies - Update Python packages
- Python Environment: Automatic virtual environment detection (
./venv/bin/python) - Test Discovery: Automatic pytest test discovery
- Formatting: Black formatter with 120-character line length
- Linting: Flake8 with custom rules
- Type Checking: Basic type checking enabled
- Import Organization: Automatic import sorting on save
Type these prefixes and press Tab for instant code generation:
cftest- Basic CF Java test methodcfheap- Heap dump test templatecfjfr- JFR test templatecfasprof- Async-profiler test templatecftestclass- Test class templatecfimport- Import test frameworkcfmulti- Multi-step workflow testcfsleep- Time.sleep with commentcfcleanup- Test cleanup code
pytest test_basic_commands.py -v # Basic commands
pytest test_jfr.py -v # JFR tests
pytest test_asprof.py -v # Async-profiler tests
pytest test_cf_java_plugin.py -v # Integration testspytest test_basic_commands.py::TestHeapDump -v # Only heap dump tests
pytest test_jfr.py::TestJFRBasic -v # Basic JFR functionality
pytest test_asprof.py::TestAsprofProfiles -v # Async-profiler profilespytest -k "heap" -v # All heap-related tests
pytest -k "jfr or asprof" -v # All profiling testspytest -m "sapmachine21" -v # SapMachine-specific tests- Set Breakpoints: Click in the gutter or press F9
- Step Through: Use F10 (step over) and F11 (step into)
- Inspect Variables: Hover over variables or use the Variables panel
- Debug Console: Use the Debug Console for live evaluation
- Conditional Breakpoints: Right-click on breakpoint for conditions
- Edit test file
- Press F5 → "Debug Current Test File"
- Fix issues and repeat
- Use custom filter: F5 → "Debug Custom Filter"
- Enter pattern like "heap and download"
- Debug only matching tests
test/
├── .vscode/ # VS Code configuration
│ ├── launch.json # Debug configurations
│ ├── tasks.json # Build/test tasks
│ ├── settings.json # Workspace settings
│ ├── extensions.json # Recommended extensions
│ └── python.code-snippets # Code snippets
├── framework/ # Test framework
├── test_*.py # Test modules
├── requirements.txt # Dependencies
├── setup.sh # Environment setup script
└── test_runner.py # Interactive test runner
- F5 - Start debugging
- Ctrl/Cmd + F5 - Run without debugging
- Shift + F5 - Stop debugging
- F9 - Toggle breakpoint
- F10 - Step over
- F11 - Step into
- Ctrl/Cmd + Shift + P - Command palette
- Ctrl/Cmd + ` - Open terminal
- Ensure virtual environment is created: Run "Setup Virtual Environment" task
- Check Python interpreter: Bottom left corner should show
./venv/bin/python - Reload window: Ctrl/Cmd + Shift + P → "Developer: Reload Window"
- Save all files (tests auto-discover on save)
- Check PYTHONPATH in terminal
- Verify test files follow
test_*.pynaming
- Install recommended extensions when prompted
- Check Extensions panel for any issues
- Restart VS Code if needed
Use the "Run Tests in Parallel" task for faster execution on multi-core systems.
Generate comprehensive HTML test reports with the "Generate HTML Test Report" task.
Launch test_runner.py for menu-driven test selection and execution.