-
Notifications
You must be signed in to change notification settings - Fork 4
Migrate performance tests to test packages. #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rder to move duplicated code to new base classes.
… to support also remote execution.
…sistent with naming convention from the manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move this to the top level src/Commands/CustomTests folder since it would fit that description. Being here would make it seem as if its the only local test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precisely I did that before pushing the initial changes, but decided to revert it so you could review the changes in this class, since moving git would consider this file as a new one after moving it to a new path.
That said, after reorganizing all files from LocalTests, I wonder if it would be better to remove src/Commands/CustomTests and move those commands to src/Commands, as there only 3 of them within this folder:
- RunE2ECommand
- ShowReportCommand
- RunPerformanceTestsCommand
Even RunActivationTestsCommand, which might fit within the CustomTests folder too, is there placed in the root Commands folder. So, in my opinion, I'd remove the CustomTests folder and move these files to src/Commands. Please let me know if this sounds good to you before applying the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @MrJnrman! As we agreed yesterday in the team meeting, I've removed the CustomTests folder and moved the files inside to the base Commands folder. That was covered in 4427515.
With this we should be ready to merge this PR. Please let me know if there is any objection! Cc @zhongruige , in case I'm missing anything (the more eyes, the better!)
|
Great work here @alopezari and it tests great! Just one nitpick. Could we get rid of the |
|
Thanks for raising this @MrJnrman! The LocalTests still has some more classes apart from Performance-related ones:
I'll reorganize them within the src/src path. If you think it could be handled differently, please let me know, we can always change it or revert the commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these changes @alopezari! Retested and everything looks good! 🚢
This PR migrates the performance test infrastructure to use the new test packages architecture, bringing consistency with E2E tests. The changes extract common environment functionality into shared base classes (
QITEnvironmentandQITEnvInfo) and implement performance-specific extensions. This enables performance tests to leverage the same test package system, environment setup, and orchestration as E2E tests.Changes added in this request
Created shared base classes for all environment types
QITEnvInfoas base class for common environment propertiesQITEnvironmentas base class with shared environment lifecycle methodsRefactored E2E environment to use shared base classes
src/src/Environment/Environments/E2E/E2EEnvironment.phpE2EEnvInfoextendQITEnvInfoinsrc/src/Environment/Environments/E2E/E2EEnvInfo.phpCreated performance environment using shared architecture
PerformanceEnvInfoextendingQITEnvInfoinsrc/src/Environment/Environments/Performance/PerformanceEnvInfo.phpPerformanceEnvironmentextendingQITEnvironmentinsrc/src/Environment/Environments/Performance/PerformanceEnvironment.phpUpdated performance test runner (
src/src/LocalTests/Performance/Commands/RunPerformanceTestCommand.php)PerformanceEnvironmentclassEnhanced K6 runner for test packages (
src/src/LocalTests/Performance/Runner/K6Runner.php)Updated environment management
UpEnvironmentCommandinsrc/src/Commands/Environment/UpEnvironmentCommand.phpto support both E2E and performance environmentsEnvironmentVarsinsrc/src/Environment/EnvironmentVars.phpto work withQITEnvInfobase classExpanded test package manifest schema (
src/src/PreCommand/Schemas/test-package-manifest-schema.json)optionssection for k6 test configurationresultssection withsummary,json, and optionaldashboardoutputsUpdated performance test result handling (
src/src/LocalTests/Performance/Result/PerformanceTestResult.php)Updated command registration (
src/src/Commands/CreateRunCommands.php)Minor improvements
MetricAveragerwith better type handlingPrepareDebugLog,ThemeActivation, andK6DockerConfigTest updates
QITEnvInfostructureMetricAveragerTestfor compatibilityTesting instructions
These testing instructions focus on local execution. While though the code was updated to apply these changes to remote performance tests execution, it requires special treatment for deploying the changes so they can be tested, so I plan to test it further after this PR is merged.
php src/qit-cli.php package:publish ../compatibility-dashboard/ci/tests/activation/test-package/ latest, just make sure you're using the correct path to the cd folder that contains the activation test package).php src/qit-cli.php package:publish ../compatibility-dashboard/ci/tests/performance latest).php src/qit-cli.php run:activation woocommerce, ensure they pass and no issues were found.php src/qit-cli.php run:performance automatewoo -vvv --local, ensure they pass and no issues were found.php src/qit-cli.php env:up --environment_type=performance, check the environment is created successfully with 1k products and 100k orders.php src/qit-cli.php env:up, check the environment is created successfully without WooCommerce.