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

Rename "api" to "woo-api" and "e2e" to "woo-e2e" #125

Merged
merged 11 commits into from
Feb 11, 2024
Merged

Conversation

Luc45
Copy link
Member

@Luc45 Luc45 commented Feb 9, 2024

On current versions of QIT CLI, they will see both the renamed and the alias:

image

Once they update to the latest version, they will see just the renamed:

image

The aliases are still there, but they are hidden. If they run it (as in a CI script that still uses e2e as the test-type), it still works:

image

If the user starts a test using e2e as the test type, instead of woo-e2e, internally we route it to the renamed test type and log it to keep track of usage:

image

In the future, when e2e actually refers to custom tests, we will:

  1. Check if the SUT has custom tests
    1.1 If yes, we just run it
    1.2 If no, this can be either because the dev hasn't added custom tests yet, or because it's a old CI script still pointing to this test type
  2. If getenv('CI') is true, we just run the woo-e2e test type and add a warning to the test
  3. If false, we bail with a error instead, and point the dev towards documentation on how to write custom tests

Testing Instructions

Testing instructions will be added to the Manager PR.

@Luc45 Luc45 self-assigned this Feb 9, 2024
@Luc45 Luc45 requested a review from a team February 9, 2024 21:02
Copy link
Contributor

@zhongruige zhongruige left a comment

Choose a reason for hiding this comment

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

Nice work on this @Luc45! This refactor helps to provide us separation of concerns for the different test types and sets us up for the next stages in QIT. Self tests all passed:

Screenshot 2024-02-09 at 3 32 59 PM

@@ -306,6 +306,24 @@ public function execute( InputInterface $input, OutputInterface $output ) {

$command->add_option_to_send( 'zip' );

if ( $test_type === 'api' ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this so we can always come back and add custom API tests in the future.

// This will be hidden while custom test type is in development, but kept as an alias to "woo-e2e".
if ( $test_type === 'e2e' ) {
try {
$hide_e2e = $this->environment->get_cache()->get_manager_sync_data( 'hide_e2e' );
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how this configuration is set.

@Luc45 Luc45 merged commit 7fb1938 into trunk Feb 11, 2024
@Luc45 Luc45 deleted the 24-01/api-e2e-test-type branch February 11, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants