Skip to content
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

Implement GitHub workflow to have a basic test for standalone plugins #639

Closed
Tracked by #656
felixarntz opened this issue Feb 1, 2023 · 3 comments · Fixed by #671
Closed
Tracked by #656

Implement GitHub workflow to have a basic test for standalone plugins #639

felixarntz opened this issue Feb 1, 2023 · 3 comments · Fixed by #671
Assignees
Labels
Creating standalone plugins Infrastructure Issues for the overall performance plugin infrastructure Performance Lab Plugin Issue relates to work in the Performance Lab Plugin only [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@felixarntz
Copy link
Member

felixarntz commented Feb 1, 2023

Feature Description

Follow up to #635: As we are publishing certain modules as standalone plugins, it is vital that we ensure the plugins work as expected. This issue's goal is to provide at least a foundation for some automated testing of the individual plugins: It should run the build step from #635 and then load the plugin in e.g. a customized PHPUnit configuration, to just ensure that there is no fatal error when loading the plugin. While this is far from a comprehensive solution, the code itself is already covered by the unit tests on the module, and having this extra check is the most critical and minimum starting point to ensure we don't accidentally use anything from the Performance Lab core in a module that wouldn't work when it's standalone.

This should already be the case per our writing a module guidelines, but having a CI workflow to ensure that will be crucial to ensure we don't let any mistake accidentally slip through.

Requirements

  • Implement a new GitHub workflow that runs the build-plugins command from Implement CLI command to for a build process to transform modules into standalone plugins #635 and then loads each individual built plugin in a sandboxed PHP environment.
    • For example, it could load the WordPress unit test suite and force those plugins to be active, just to ensure no fatal error occurs.
  • This workflow should probably run only on push events to trunk, not for every pull request, to avoid the overhead of having this on every PR. Running this on every trunk push is sufficient to capture failures before they would accidentally get released to end users.
    • Additionally, only modules that have seen changes since the last push should be covered by this test, since for unchanged modules it would be redundant and just slow down CI unnecessarily.
@felixarntz felixarntz added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure Creating standalone plugins labels Feb 1, 2023
@felixarntz felixarntz added this to Backlog in Infrastructure via automation Feb 1, 2023
@joemcgill
Copy link
Member

We can probably also limit these runs to only modules that have been modified since the last merge to trunk.

@felixarntz
Copy link
Member Author

@joemcgill Great point, added it to the requirements.

@mukeshpanchal27 mukeshpanchal27 moved this from Backlog to To do in Infrastructure Mar 7, 2023
@mukeshpanchal27 mukeshpanchal27 self-assigned this Mar 7, 2023
@10upsimon 10upsimon self-assigned this Mar 8, 2023
@mukeshpanchal27 mukeshpanchal27 removed their assignment Mar 13, 2023
@mukeshpanchal27 mukeshpanchal27 moved this from To do to In progress in Infrastructure Mar 13, 2023
@10upsimon 10upsimon linked a pull request Mar 23, 2023 that will close this issue
3 tasks
@mukeshpanchal27 mukeshpanchal27 moved this from In progress to Review in Infrastructure Mar 27, 2023
felixarntz added a commit that referenced this issue Mar 31, 2023
…n-tests

Add / #639 Standalone Built Plugin Tests
@mukeshpanchal27
Copy link
Member

Closed this as completed in #671

Infrastructure automation moved this from Review to Done Apr 3, 2023
@felixarntz felixarntz added the Performance Lab Plugin Issue relates to work in the Performance Lab Plugin only label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Creating standalone plugins Infrastructure Issues for the overall performance plugin infrastructure Performance Lab Plugin Issue relates to work in the Performance Lab Plugin only [Type] Enhancement A suggestion for improvement of an existing feature
Projects
Development

Successfully merging a pull request may close this issue.

4 participants