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

[ci-jobs] Add support for github event and include HPOS disabled e2e tests in ci #46922

Merged
merged 24 commits into from
May 1, 2024

Conversation

adimoldovan
Copy link
Contributor

@adimoldovan adimoldovan commented Apr 25, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

Closes #46925
Closes #46924

Adds support for Github events in ci-jobs, so we can only run jobs for specific events, like only for push.

  • Added a new option in job configuration: events as an array of strings, which should contain a list of events for which the job should run. If no events list is defined or the list is empty the job will run for any event.
  • Added a new argument for the ci-jobs cli: --event or -e. If no argument is passed the tool will consider all jobs and do not filter by event.
  • Moved the HPOS disabled e2e tests into ci.yml by configuring a new project with events: [push] configuration. This should only run for push events and not run for pull_request
  • Deprecated 2 workflows for HPOS disabled e2e tests: one for push to trunk and one for daily runs (did not even know this existed until now).
  • Improved the HPOS disabled env setup. Because you cannot set environment variables in the job's run command I had to update the env:test:non-hpos command and the test env setup script to disable the HPOS feature. Also added a print for the HPOS value in the global setup to easily spot if the expected value is set.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

Run pnpm utils ci-jobs with different arguments and check the output.

  1. pnpm utils ci-jobs --event push should return all configured jobs, including the HPOS disabled ones (5 e2e and 1 API)
  2. pnpm utils ci-jobs --event pull_request should return all configured jobs without the 5 shards of "Core e2e tests - HPOS disabled" and without the Core API tests - HPOS disabled
  3. pnpm utils ci-jobs should return all configured jobs including the HPOS disabled ones.

@adimoldovan adimoldovan self-assigned this Apr 25, 2024
@github-actions github-actions bot added focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin. focus: monorepo infrastructure Issues and PRs related to monorepo tooling. labels Apr 25, 2024
@adimoldovan adimoldovan marked this pull request as ready for review April 25, 2024 20:47
@woocommercebot woocommercebot requested a review from a team April 25, 2024 20:48
Copy link
Contributor

github-actions bot commented Apr 25, 2024

Hi @rrennick, @woocommerce/vortex

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

@rrennick rrennick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm utils ci-jobs should return all configured jobs without the 5 shards of "Core e2e tests - HPOS disabled"

The response includes the 5 HPOS disabled tests for me. Also, this PR only includes @woocommerce/plugin-woocommerce - Core API tests - HPOS disabled when the other HPOS disabled tests are included. The PR testing instructions should be updated to reflect that.

I'm leaving this as a comment to not hang the PR on my review as I'll be AFK next week.

@@ -23,11 +23,24 @@ const program = new Command( 'ci-jobs' )
'Base ref to compare the current ref against for change detection. If not specified, all projects will be considered changed.',
''
)
.option(
'-e --event <event>',
'Github event for which to run the jobs. If not specified, all projects will with changes be considered.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording here is unclear. Do you mean If not specified, all events will be considered.? The current code already considers all packages with changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was struggling to get the right wording here. Your suggestion is much better. Updated with 5008e80

@adimoldovan
Copy link
Contributor Author

pnpm utils ci-jobs should return all configured jobs without the 5 shards of "Core e2e tests - HPOS disabled"

The response includes the 5 HPOS disabled tests for me. Also, this PR only includes @woocommerce/plugin-woocommerce - Core API tests - HPOS disabled when the other HPOS disabled tests are included. The PR testing instructions should be updated to reflect that.

I fixed the testing instructions. That command should return the HPOS disabled tests, it worked as expected.

@adimoldovan adimoldovan requested review from a team and rrennick April 27, 2024 08:24
@adimoldovan adimoldovan added the focus: testing workflows Issues related to test related workflows (daily, release, merge to trunk etc). label Apr 29, 2024
Copy link
Contributor

@lanej0 lanej0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lanej0 lanej0 merged commit de91a08 into trunk May 1, 2024
35 checks passed
@lanej0 lanej0 deleted the ci/add-support-for-events-in-ci-jobs branch May 1, 2024 17:36
@github-actions github-actions bot added this to the 9.0.0 milestone May 1, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label May 1, 2024
@rodelgc rodelgc added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels May 2, 2024
senadir pushed a commit that referenced this pull request May 7, 2024
…tests in ci (#46922)

* Update env setup script to disable hpos

* Use DISABLE_HPOS instead of ENABLE_HPOS

* Log HPOS state

* Configure project for core e2e with HPOS disabled

* Add event argument for ci-jobs util

* Add event option for test jobs

* Add support for github events

* Add changelog

* Configure HPOS tests to run on pull_request

* Fix utils tests for undefined commandVars

* Added some tests for the event configuration

* Revert event for HPOS e2e to push

* Use matrix name in artifact name to avoid duplication

* Test with pull_request event

* Use job-index for unique artifacts names

* Revert event for HPOS e2e to push

* Add api tests for HPOS disabled

* Use unique artifact name for api tests

* Revert event for HPOS disabled api tests to push

* Rebuild monorepo utils to fix a merge conflict

* Updated wording
thealexandrelara pushed a commit that referenced this pull request Jul 18, 2024
…tests in ci (#46922)

* Update env setup script to disable hpos

* Use DISABLE_HPOS instead of ENABLE_HPOS

* Log HPOS state

* Configure project for core e2e with HPOS disabled

* Add event argument for ci-jobs util

* Add event option for test jobs

* Add support for github events

* Add changelog

* Configure HPOS tests to run on pull_request

* Fix utils tests for undefined commandVars

* Added some tests for the event configuration

* Revert event for HPOS e2e to push

* Use matrix name in artifact name to avoid duplication

* Test with pull_request event

* Use job-index for unique artifacts names

* Revert event for HPOS e2e to push

* Add api tests for HPOS disabled

* Use unique artifact name for api tests

* Revert event for HPOS disabled api tests to push

* Rebuild monorepo utils to fix a merge conflict

* Updated wording
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: e2e tests Issues related to e2e tests focus: monorepo infrastructure Issues and PRs related to monorepo tooling. focus: testing workflows Issues related to test related workflows (daily, release, merge to trunk etc). plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to Github events in ci-jobs Move HPOS disabled e2e tests into ci.yml
4 participants