This is an automated email from the ASF dual-hosted git repository. uranusjr pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push: new b60006ae26 Add information on running tests with Breeze in PyCharm (#27901) b60006ae26 is described below commit b60006ae26c41e887ec0102bce8b726fce54007d Author: D. Ferruzzi <ferru...@amazon.com> AuthorDate: Mon Nov 28 23:02:16 2022 -0800 Add information on running tests with Breeze in PyCharm (#27901) --- TESTING.rst | 39 +++++++++++++++++++++++-- images/{ => pycharm}/configure_test_runner.png | Bin images/pycharm/pycharm_add_to_context.png | Bin 0 -> 199729 bytes images/pycharm/pycharm_create_tool.png | Bin 0 -> 60139 bytes images/{ => pycharm}/running_unittests.png | Bin 5 files changed, 37 insertions(+), 2 deletions(-) diff --git a/TESTING.rst b/TESTING.rst index 26b95eec7d..d47adc6ad1 100644 --- a/TESTING.rst +++ b/TESTING.rst @@ -61,13 +61,13 @@ Running Unit Tests from PyCharm IDE To run unit tests from the PyCharm IDE, create the `local virtualenv <LOCAL_VIRTUALENV.rst>`_, select it as the default project's environment, then configure your test runner: -.. image:: images/configure_test_runner.png +.. image:: images/pycharm/configure_test_runner.png :align: center :alt: Configuring test runner and run unit tests as follows: -.. image:: images/running_unittests.png +.. image:: images/pycharm/running_unittests.png :align: center :alt: Running unit tests @@ -75,6 +75,41 @@ and run unit tests as follows: (with no Breeze installed) if they do not have dependencies such as Postgres/MySQL/Hadoop/etc. +Running Unit Tests from PyCharm IDE using Breeze +------------------------------------------------ + +Ideally, all unit tests should be run using the standardized Breeze environment. While not +as convenient as the one-click "play button" in PyCharm, the IDE can be configured to do +this in two clicks. + +1. Add Breeze as an "External Tool": + + a. From the settings menu, navigate to Tools > External Tools + b. Click the little plus symbol to open the "Create Tool" popup and fill it out: + +.. image:: images/pycharm/pycharm_create_tool.png + :align: center + :alt: Installing Python extension + + +2. Add the tool to the context menu: + + a. From the settings menu, navigate to Appearance & Behavior > Menus & Toolbars > Project View Popup Menu + b. Click on the list of entries where you would like it to be added. Right above or below "Project View Popup Menu Run Group" may be a good choice, you can drag and drop this list to rearrange the placement later as desired. + c. Click the little plus at the top of the popup window + d. Find your "External Tool" in the new "Choose Actions to Add" popup and click OK. If you followed the image above, it will be at External Tools > External Tools > Breeze + +**Note:** That only adds the option to that one menu. If you would like to add it to the context menu +when right-clicking on a tab at the top of the editor, for example, follow the steps above again +and place it in the "Editor Tab Popup Menu" + +.. image:: images/pycharm/pycharm_add_to_context.png + :align: center + :alt: Installing Python extension + +3. To run tests in Breeze, right click on the file or directory in the Project View and click Breeze. + + Running Unit Tests from Visual Studio Code ------------------------------------------ diff --git a/images/configure_test_runner.png b/images/pycharm/configure_test_runner.png similarity index 100% rename from images/configure_test_runner.png rename to images/pycharm/configure_test_runner.png diff --git a/images/pycharm/pycharm_add_to_context.png b/images/pycharm/pycharm_add_to_context.png new file mode 100644 index 0000000000..4372827e60 Binary files /dev/null and b/images/pycharm/pycharm_add_to_context.png differ diff --git a/images/pycharm/pycharm_create_tool.png b/images/pycharm/pycharm_create_tool.png new file mode 100644 index 0000000000..28470e4fbd Binary files /dev/null and b/images/pycharm/pycharm_create_tool.png differ diff --git a/images/running_unittests.png b/images/pycharm/running_unittests.png similarity index 100% rename from images/running_unittests.png rename to images/pycharm/running_unittests.png