diff --git a/qit b/qit index 1a503e67..e4f7aa62 100755 Binary files a/qit and b/qit differ diff --git a/src/src/Commands/CreateMassTestCommands.php b/src/src/Commands/CreateMassTestCommands.php index aebadd95..97cebaa9 100644 --- a/src/src/Commands/CreateMassTestCommands.php +++ b/src/src/Commands/CreateMassTestCommands.php @@ -42,14 +42,20 @@ public function execute( InputInterface $input, OutputInterface $output ) { ->with_method( 'POST' ) ->with_post_body( $options ) ->request(); + + $json = json_decode( $json, true ); + if ( is_array( $json ) && isset( $json['data'] ) ) { + $output->writeln( sprintf( 'Mass test enqueued on QIT Servers!' ) ); + $output->writeln( $json['data'] ); + } else { + $output->writeln( sprintf( 'Could not enqueue mass test on QIT Servers.' ) ); + } } catch ( \Exception $e ) { $output->writeln( "{$e->getMessage()}" ); return Command::FAILURE; } - $output->writeln( sprintf( 'Mass test enqueued on QIT Servers!' ) ); - return Command::SUCCESS; } }; diff --git a/src/src/Commands/DynamicCommandCreator.php b/src/src/Commands/DynamicCommandCreator.php index b693f33b..01248eda 100644 --- a/src/src/Commands/DynamicCommandCreator.php +++ b/src/src/Commands/DynamicCommandCreator.php @@ -24,6 +24,12 @@ protected function add_schema_to_command( DynamicCommand $command, array $schema foreach ( $schema['properties'] as $property_name => $property_schema ) { $ignore = [ 'client', 'event', 'woo_id', 'is_product_update', 'upload_id' ]; + // Keep these on CI to avoid breaking workflows, but remove from Desktop. + if ( ! getenv( 'CI' ) ) { + $ignore[] = 'additional_woo_plugins'; + $ignore[] = 'additional_wordpress_plugins'; + } + if ( in_array( $property_name, $ignore, true ) ) { continue; } diff --git a/src/tests/RunTestsTest.php b/src/tests/RunTestsTest.php index d9e3656a..8fa32e0d 100644 --- a/src/tests/RunTestsTest.php +++ b/src/tests/RunTestsTest.php @@ -1,6 +1,5 @@ 123456, 'test_results_manager_url' => '' @@ -29,7 +28,7 @@ public function test_run_with_additional_woo_plugins() { $this->application_tester->run( [ 'command' => 'run:e2e', 'woo_extension' => 'foo-extension', // Using slug. - '--additional_woo_plugins' => '456,789', // Using IDs. + '--additional_plugins' => '456,789', // Using IDs. ], [ 'capture_stderr_separately' => true ] ); $this->assertCommandIsSuccessful( $this->application_tester ); @@ -38,7 +37,7 @@ public function test_run_with_additional_woo_plugins() { $this->application_tester->run( [ 'command' => 'run:e2e', 'woo_extension' => '123', // Using ID. - '--additional_woo_plugins' => 'bar-extension,baz-extension', // Using Slugs. + '--additional_plugins' => 'bar-extension,baz-extension', // Using Slugs. ], [ 'capture_stderr_separately' => true ] ); $this->assertCommandIsSuccessful( $this->application_tester ); @@ -47,7 +46,7 @@ public function test_run_with_additional_woo_plugins() { $this->application_tester->run( [ 'command' => 'run:e2e', 'woo_extension' => 'foo-extension', // Using ID. - '--additional_woo_plugins' => '456,baz-extension', // Using mixed. + '--additional_plugins' => '456,baz-extension', // Using mixed. ], [ 'capture_stderr_separately' => true ] ); $this->assertCommandIsSuccessful( $this->application_tester ); @@ -56,13 +55,13 @@ public function test_run_with_additional_woo_plugins() { $this->application_tester->run( [ 'command' => 'run:e2e', 'woo_extension' => 'foo-extension', - '--additional_woo_plugins' => '1234567890', // If the user passes an invalid ID, the Manager should flag that. + '--additional_plugins' => '1234567890', // If the user passes an invalid ID, the Manager should flag that. ], [ 'capture_stderr_separately' => true ] ); $this->assertCommandIsSuccessful( $this->application_tester ); } - public function test_run_with_additional_woo_plugins_invalid() { + public function test_run_with_additional_plugins_invalid() { App::setVar( sprintf( 'mock_%s', get_manager_url() . '/wp-json/cd/v1/enqueue-e2e' ), 'NULL_RESPONSE' ); $this->application_tester->run( [ @@ -71,21 +70,5 @@ public function test_run_with_additional_woo_plugins_invalid() { ], [ 'capture_stderr_separately' => true ] ); $this->assertStringContainsString('Could not find Woo Extension with slug non-existing-extension.', $this->application_tester->getErrorOutput() ); - - $this->application_tester->run( [ - 'command' => 'run:e2e', - 'woo_extension' => 'foo-extension', - '--additional_woo_plugins' => 'non-existing-dependency', - ], [ 'capture_stderr_separately' => true ] ); - - $this->assertStringContainsString('Could not find Woo Extension with slug non-existing-dependency.', $this->application_tester->getErrorOutput() ); - - $this->application_tester->run( [ - 'command' => 'run:e2e', - 'woo_extension' => 'foo-extension', - '--additional_woo_plugins' => '1234567890, non-existing-dependency', - ], [ 'capture_stderr_separately' => true ] ); - - $this->assertStringContainsString('Could not find Woo Extension with slug non-existing-dependency.', $this->application_tester->getErrorOutput() ); } } diff --git a/src/tests/__snapshots__/PartnerManagementTest__test_add_partner__1.json b/src/tests/__snapshots__/PartnerManagementTest__test_add_partner__1.json index fa697b1d..76a8d184 100644 --- a/src/tests/__snapshots__/PartnerManagementTest__test_add_partner__1.json +++ b/src/tests/__snapshots__/PartnerManagementTest__test_add_partner__1.json @@ -83,8 +83,17 @@ "description": "What event originated this request.", "type": "string" }, + "additional_plugins": { + "description": "A comma-separated list of additional plugin to activate in the environment. Accepts: WordPress.org plugin slugs, Woo.com Product Slugs or Woo.com Product IDs.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, "additional_woo_plugins": { - "description": "A comma-separated list of Additional WooCommerce Extension IDs.", + "description": "[Deprecated] A comma-separated list of Additional WooCommerce Extension IDs.", "type": "array", "uniqueItems": true, "items": { @@ -93,7 +102,7 @@ } }, "additional_wordpress_plugins": { - "description": "A comma-separated list of Additional WordPress plugin slugs.", + "description": "[Deprecated] A comma-separated list of Additional WordPress plugin slugs.", "type": "array", "uniqueItems": true, "items": { diff --git a/src/tests/__snapshots__/PartnerManagementTest__test_add_partner_email__1.json b/src/tests/__snapshots__/PartnerManagementTest__test_add_partner_email__1.json index af13c1e7..ae75a0e9 100644 --- a/src/tests/__snapshots__/PartnerManagementTest__test_add_partner_email__1.json +++ b/src/tests/__snapshots__/PartnerManagementTest__test_add_partner_email__1.json @@ -83,8 +83,17 @@ "description": "What event originated this request.", "type": "string" }, + "additional_plugins": { + "description": "A comma-separated list of additional plugin to activate in the environment. Accepts: WordPress.org plugin slugs, Woo.com Product Slugs or Woo.com Product IDs.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, "additional_woo_plugins": { - "description": "A comma-separated list of Additional WooCommerce Extension IDs.", + "description": "[Deprecated] A comma-separated list of Additional WooCommerce Extension IDs.", "type": "array", "uniqueItems": true, "items": { @@ -93,7 +102,7 @@ } }, "additional_wordpress_plugins": { - "description": "A comma-separated list of Additional WordPress plugin slugs.", + "description": "[Deprecated] A comma-separated list of Additional WordPress plugin slugs.", "type": "array", "uniqueItems": true, "items": { diff --git a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__1.json b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__1.json index f9dd758e..87894404 100644 --- a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__1.json +++ b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__1.json @@ -83,8 +83,17 @@ "description": "What event originated this request.", "type": "string" }, + "additional_plugins": { + "description": "A comma-separated list of additional plugin to activate in the environment. Accepts: WordPress.org plugin slugs, Woo.com Product Slugs or Woo.com Product IDs.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, "additional_woo_plugins": { - "description": "A comma-separated list of Additional WooCommerce Extension IDs.", + "description": "[Deprecated] A comma-separated list of Additional WooCommerce Extension IDs.", "type": "array", "uniqueItems": true, "items": { @@ -93,7 +102,7 @@ } }, "additional_wordpress_plugins": { - "description": "A comma-separated list of Additional WordPress plugin slugs.", + "description": "[Deprecated] A comma-separated list of Additional WordPress plugin slugs.", "type": "array", "uniqueItems": true, "items": { diff --git a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__2.json b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__2.json index fa697b1d..76a8d184 100644 --- a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__2.json +++ b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner__2.json @@ -83,8 +83,17 @@ "description": "What event originated this request.", "type": "string" }, + "additional_plugins": { + "description": "A comma-separated list of additional plugin to activate in the environment. Accepts: WordPress.org plugin slugs, Woo.com Product Slugs or Woo.com Product IDs.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, "additional_woo_plugins": { - "description": "A comma-separated list of Additional WooCommerce Extension IDs.", + "description": "[Deprecated] A comma-separated list of Additional WooCommerce Extension IDs.", "type": "array", "uniqueItems": true, "items": { @@ -93,7 +102,7 @@ } }, "additional_wordpress_plugins": { - "description": "A comma-separated list of Additional WordPress plugin slugs.", + "description": "[Deprecated] A comma-separated list of Additional WordPress plugin slugs.", "type": "array", "uniqueItems": true, "items": { diff --git a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__1.json b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__1.json index bb3841ba..0dc0abd0 100644 --- a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__1.json +++ b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__1.json @@ -83,8 +83,17 @@ "description": "What event originated this request.", "type": "string" }, + "additional_plugins": { + "description": "A comma-separated list of additional plugin to activate in the environment. Accepts: WordPress.org plugin slugs, Woo.com Product Slugs or Woo.com Product IDs.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, "additional_woo_plugins": { - "description": "A comma-separated list of Additional WooCommerce Extension IDs.", + "description": "[Deprecated] A comma-separated list of Additional WooCommerce Extension IDs.", "type": "array", "uniqueItems": true, "items": { @@ -93,7 +102,7 @@ } }, "additional_wordpress_plugins": { - "description": "A comma-separated list of Additional WordPress plugin slugs.", + "description": "[Deprecated] A comma-separated list of Additional WordPress plugin slugs.", "type": "array", "uniqueItems": true, "items": { diff --git a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__2.json b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__2.json index 9af92431..bcbb121e 100644 --- a/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__2.json +++ b/src/tests/__snapshots__/PartnerManagementTest__test_switch_partner_on_different_environments__2.json @@ -83,8 +83,17 @@ "description": "What event originated this request.", "type": "string" }, + "additional_plugins": { + "description": "A comma-separated list of additional plugin to activate in the environment. Accepts: WordPress.org plugin slugs, Woo.com Product Slugs or Woo.com Product IDs.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, "additional_woo_plugins": { - "description": "A comma-separated list of Additional WooCommerce Extension IDs.", + "description": "[Deprecated] A comma-separated list of Additional WooCommerce Extension IDs.", "type": "array", "uniqueItems": true, "items": { @@ -93,7 +102,7 @@ } }, "additional_wordpress_plugins": { - "description": "A comma-separated list of Additional WordPress plugin slugs.", + "description": "[Deprecated] A comma-separated list of Additional WordPress plugin slugs.", "type": "array", "uniqueItems": true, "items": { diff --git a/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__1.json b/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__1.json similarity index 85% rename from src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__1.json rename to src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__1.json index 03c54ee0..94c82df4 100644 --- a/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__1.json +++ b/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__1.json @@ -2,7 +2,7 @@ "url": "https:\/\/qit.woo.com\/wp-json\/cd\/v1\/enqueue-e2e", "method": "POST", "post_body": { - "additional_woo_plugins": "456,789", + "additional_plugins": "456,789", "woo_id": 123, "event": "cli_published_extension_test" }, diff --git a/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__2.json b/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__2.json similarity index 81% rename from src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__2.json rename to src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__2.json index 22dddd35..0682b63f 100644 --- a/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__2.json +++ b/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__2.json @@ -2,7 +2,7 @@ "url": "https:\/\/qit.woo.com\/wp-json\/cd\/v1\/enqueue-e2e", "method": "POST", "post_body": { - "additional_woo_plugins": "456,789", + "additional_plugins": "bar-extension,baz-extension", "woo_id": "123", "event": "cli_published_extension_test" }, diff --git a/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__3.json b/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__3.json similarity index 83% rename from src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__3.json rename to src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__3.json index 03c54ee0..a494c8d1 100644 --- a/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_woo_plugins__3.json +++ b/src/tests/__snapshots__/RunTestsTest__test_run_with_additional_plugins__3.json @@ -2,7 +2,7 @@ "url": "https:\/\/qit.woo.com\/wp-json\/cd\/v1\/enqueue-e2e", "method": "POST", "post_body": { - "additional_woo_plugins": "456,789", + "additional_plugins": "456,baz-extension", "woo_id": 123, "event": "cli_published_extension_test" }, diff --git a/src/tests/data/sync.json b/src/tests/data/sync.json index 1ba8ba94..cdffff28 100644 --- a/src/tests/data/sync.json +++ b/src/tests/data/sync.json @@ -68,8 +68,17 @@ "description": "What event originated this request.", "type": "string" }, + "additional_plugins": { + "description": "A comma-separated list of additional plugin to activate in the environment. Accepts: WordPress.org plugin slugs, Woo.com Product Slugs or Woo.com Product IDs.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 1 + } + }, "additional_woo_plugins": { - "description": "A comma-separated list of Additional WooCommerce Extension IDs.", + "description": "[Deprecated] A comma-separated list of Additional WooCommerce Extension IDs.", "type": "array", "uniqueItems": true, "items": { @@ -78,7 +87,7 @@ } }, "additional_wordpress_plugins": { - "description": "A comma-separated list of Additional WordPress plugin slugs.", + "description": "[Deprecated] A comma-separated list of Additional WordPress plugin slugs.", "type": "array", "uniqueItems": true, "items": {