Add comprehensive test suite and improve run configuration UI#47
Open
Add comprehensive test suite and improve run configuration UI#47
Conversation
Describes architecture, tech stack, build commands, project structure, Testo PHP framework integration details, constraints, and CI/CD setup. https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
Matches refactor from 75a5fcc: attributes are now organized into TEST_ATTRIBUTES, TEST_INLINE_ATTRIBUTES, DATA_ATTRIBUTES, BENCH_ATTRIBUTES arrays and spread across the codebase instead of being duplicated. https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
Tests cover: - TestoClasses: attribute arrays content, no overlaps, constants - TestoTestDescriptor: isTestClassName logic - TestoVersionDetector: version parsing, error handling - TestoFrameworkType: constants, ID, composer packages - TestoRunnerSettings: defaults, custom values, fromPhpTestRunnerSettings - TestoRunConfigurationHandler: config file option, singleton - MixinExtensions: takeWhileInclusive for sequences and collections - LineMarkerCompanion: RUNNABLE_ATTRIBUTES composition - PsiUtil: MEANINGFUL_ATTRIBUTES composition, no duplicates https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
Based on IntelliJ Platform SDK testing guidelines: - MixinPsiTest: 17 tests for isTestoClass, isTestoMethod, isTestoFile, isTestoExecutable, isTestoDataProviderLike using configureByText with PHP PSI - ExitStatementsVisitorTest: 5 tests for yield/return counting in PHP functions - TestoLineMarkerPsiTest: 6 tests for location hint generation (class, method, file, data provider, inline test hints) - TestoTestLocatorTest: 6 tests for getLocationInfo URL parsing - TestoDataProvidersIndexTest: 8 tests for DataProviderUsage record, externalizer serialization round-trips, index metadata - Fix MyPluginTest: remove reference to non-existent MyProjectService - Add PHP testData files for mixin tests https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
Based on infection-plugin architecture: - TestoRunnerSettings: add @Tag/@Attribute annotations for XMLB serialization, new fields: command, suite, group, excludeGroup, repeat, parallel. fromPhpTestRunnerSettings() now copies Testo-specific fields. - TestoRunConfigurationHandler: add prepareArguments() that builds argument list from settings (suite, group, excludeGroup, repeat, parallel). Overloaded prepareCommand() supports custom subcommand. Extract parseMethodName() for method#dataProvider parsing. - TestoRunConfiguration: override createCommand() to take full control of command assembly. Extract fillTestRunnerArguments() for scope-based args (Type, Directory, File, Method, ConfigurationFile). - TestoRunConfigurationSettings: add @Property/@transient for proper XMLB serialization of TestoRunnerSettings. - TestoTestRunConfigurationEditor: add UI fields for command, suite, group, excludeGroup, repeat, parallel with proper reset/apply binding and reflection-based parent editor integration. - Tests: full coverage for prepareArguments(), parseMethodName(), fromPhpTestRunnerSettings() with new fields. https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
- Add \Testo\Bench\Bench constant to TestoClasses and BENCH_ATTRIBUTES so #[Bench] attribute gets a gutter run icon via RUNNABLE_ATTRIBUTES - Set selectedType="bench" in TestoRunConfigurationProducer when the element being configured is a bench method (isTestoBench()) - Add --type argument to prepareArguments() based on selectedType, so benchmark runs pass --type bench to the CLI - Tests: update BENCH_ATTRIBUTES count, add --type bench tests, add order verification, add explicit Bench constant check https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
selectedType is a PhpTestRunnerSettings field tied to Scope.Type, which breaks normal test/method run configurations. Use our own testoType attribute in TestoRunnerSettings instead. https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
Resolve testoType from the specific attribute FQN: - #[Test], #[Data*] → --type=test - #[TestInline] → --type=inline - #[Bench] → --type=bench https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
- TestoRunConfigurationHandlerTest: verify --type=test, --type=inline, --type=bench flags, and no --type when testoType is empty/default - TestoRunnerSettingsTest: cover testoType in defaults, custom values, and fromPhpTestRunnerSettings copy https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
Detect \Testo\Application\Config\ApplicationConfig class references and show a play button in the gutter. Clicking it creates a run configuration with --config=<file-path> using the existing Scope.ConfigurationFile mechanism. https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
- Restrict line marker and producer to ClassReference inside NewExpression (not use/import statements) - Add isTestoConfigFile() to mixin.kt for detecting config files - Include config files in isTestoFile() so right-click Run works - Handle PhpFile config in setupConfiguration with --config flag https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
- Add SUITE_CONFIG constant for \Testo\Application\Config\SuiteConfig - Add line marker on `new SuiteConfig(...)` for per-suite run - Extract suite name from first constructor parameter - Run config sets --suite=<name> and --config=<file> flags - Match existing SuiteConfig configs in isConfigurationFromContext https://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN
…pZ' into claude/create-claude-md-docs-TbEpZ
This was
linked to
issues
Mar 17, 2026
Qodana Community for JVM6 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2025.3.1
with:
upload-result: trueContact Qodana teamContact us at qodana-support@jetbrains.com
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds extensive unit test coverage for the Testo plugin and enhances the run configuration editor with a full UI for managing Testo-specific options.
Key Changes
Test Coverage
New test classes covering core functionality:
MixinPsiTest: Tests for PSI extension functions (isTestoClass(),isTestoMethod(),isTestoDataProviderLike())TestoRunConfigurationHandlerTest: Tests for run configuration argument parsing and preparationTestoDataProvidersIndexTest: Tests for data provider index serialization/deserializationTestoRunnerSettingsTest: Tests for runner settings initialization and conversionExitStatementsVisitorTest: Tests for yield/return statement countingTestoLineMarkerPsiTest: Tests for location hint generationTestoTestLocatorTest: Tests for stack trace location parsingTestoFrameworkTypeTest: Tests for framework type constantsTestoTestDescriptorTest: Tests for test class name detectionTestoClassesTest: Tests for attribute constant definitionsMixinExtensionsTest: Tests for sequence extension functionsPsiUtilTest: Tests for meaningful attributes collectionTestoLineMarkerCompanionTest: Tests for runnable attributesTestoVersionDetectorTest: Tests for version string parsingMyPluginTest: Updated existing testTest data files (PHP fixtures):
TestClassWithTestSuffix.php: Test class with "Test" suffixTestClassWithTestBaseSuffix.php: Test class with "TestBase" suffixRegularClass.php: Non-test class for negative casesTestClassWithAttributes.php: Class with Testo attributesDataProviderClass.php: Class with data provider methodsRun Configuration UI
TestoTestRunConfigurationEditor: Added comprehensive UI panel with:--suite)--group)--exclude-group)--repeat, 0-10000)--parallel, 0-64)Core Improvements
TestoRunConfigurationHandler: AddedprepareArguments()method to build CLI arguments from settingsTestoRunnerSettings: Added XML serialization attributes and new fields:command: Subcommand to execute (default: "run")suite: Test suite namegroup: Test group filterexcludeGroup: Excluded group filterrepeat: Repeat countparallel: Parallel execution counttestoType: Test type (bench/test/inline)TestoRunConfiguration: Updated to use new handler and settingsTestoClasses: Simplified attribute constants (removed version-specific variants)TestoRunConfigurationProducer: Enhanced with additional imports and logic for configuration creationTesto\TestimportNotable Implementation Details
BasePlatformTestCasefor PSI-based tests with proper fixture configuration@Tag,@Attribute,@Propertyfor XML persistencehttps://claude.ai/code/session_01TmFvjfMtoxTvddQRBzsbPN