diff --git a/README.md b/README.md index 408cbf51..0231c082 100644 --- a/README.md +++ b/README.md @@ -1757,6 +1757,8 @@ Compose any of the flags above; the dispatcher applies impact selection → tag **Impact-based selection.** `--affected-by KIND:VALUE` (repeatable; `KIND` is `locator`, `url`, `template` or `command`; `@file` reads one per line) runs only the action files that use one of those names. `--changed-since REF` runs the action files `git diff REF...HEAD` changed, plus every file sharing a locator or template with them, so changing a setup file that saves `login_button` also runs the tests that use it (URLs and commands are not followed: almost every file shares them). Both can be combined; tags, `--rerun-failed` and `--shard` then apply to what they selected. `--impact-cache PATH` keeps the impact index between runs. +`python -m je_web_runner` exits with status 1 when an action or a file of the run failed, after the rest has run, and prints `error: N action(s) or file(s) failed` on stderr. Under [TestPioneer](https://github.com/Integration-Automation/TestPioneer), which sets `TEST_PIONEER_ARTIFACT_DIR`, a report asked for under a relative name (JSON, XML, HTML, JUnit, Allure, interactive HTML, and `generate_all_reports`) is written below that directory. + ## Test Record ```python diff --git a/README/README_zh-CN.md b/README/README_zh-CN.md index 42ebbad4..82444af7 100644 --- a/README/README_zh-CN.md +++ b/README/README_zh-CN.md @@ -1745,6 +1745,8 @@ python -m je_web_runner -d ./actions --changed-since origin/main --impact-cache **按影响范围挑选。** `--affected-by KIND:VALUE`(可重复;`KIND` 为 `locator`、`url`、`template` 或 `command`;`@文件` 每行读一个)只跑用到这些名称的动作文件。`--changed-since REF` 跑 `git diff REF...HEAD` 改到的动作文件,以及与它们共用 locator 或模板的文件,所以改了存放 `login_button` 的设置文件,用到它的测试也会跑(URL 与命令不追:几乎每个文件都共用)。两者可以并用;之后才应用 tag、`--rerun-failed` 与 `--shard`。`--impact-cache PATH` 在多次执行之间保留影响索引。 +`python -m je_web_runner` 在该次执行有动作或文件失败时,会在其余部分执行完之后以状态 1 结束,并在 stderr 打印 `error: N action(s) or file(s) failed`。由 [TestPioneer](https://github.com/Integration-Automation/TestPioneer) 启动时(它会设置 `TEST_PIONEER_ARTIFACT_DIR`),以相对名称要求的报告(JSON、XML、HTML、JUnit、Allure、交互式 HTML,以及 `generate_all_reports`)会写到该目录底下。 + ## 测试记录 ```python diff --git a/README/README_zh-TW.md b/README/README_zh-TW.md index 1ad4a934..9e7bb652 100644 --- a/README/README_zh-TW.md +++ b/README/README_zh-TW.md @@ -1745,6 +1745,8 @@ python -m je_web_runner -d ./actions --changed-since origin/main --impact-cache **依影響範圍挑選。** `--affected-by KIND:VALUE`(可重複;`KIND` 為 `locator`、`url`、`template` 或 `command`;`@檔案` 每行讀一個)只跑用到這些名稱的動作檔。`--changed-since REF` 跑 `git diff REF...HEAD` 改到的動作檔,以及與它們共用 locator 或範本的檔案,所以改了存放 `login_button` 的設定檔,用到它的測試也會跑(URL 與命令不追:幾乎每個檔都共用)。兩者可以並用;之後才套用 tag、`--rerun-failed` 與 `--shard`。`--impact-cache PATH` 在多次執行之間保留影響索引。 +`python -m je_web_runner` 在該次執行有動作或檔案失敗時,會在其餘部分執行完之後以狀態 1 結束,並在 stderr 印出 `error: N action(s) or file(s) failed`。由 [TestPioneer](https://github.com/Integration-Automation/TestPioneer) 啟動時(它會設定 `TEST_PIONEER_ARTIFACT_DIR`),以相對名稱要求的報告(JSON、XML、HTML、JUnit、Allure、互動式 HTML,以及 `generate_all_reports`)會寫到該目錄底下。 + ## 測試記錄 ```python diff --git a/architecture.md b/architecture.md index e742c2a5..66122f24 100644 --- a/architecture.md +++ b/architecture.md @@ -124,7 +124,7 @@ python -m je_web_runner -d DIR [--tag/--exclude-tag] [--rerun-failed LEDGER] [-- | Jeffrey_RPA | `JeffreyRPA/webrunner_je_only.py` and `webrunner_novelai.py` insert a WebRunner working tree at `sys.path[0]`, so the **live working tree** is imported. The tree is `WEBRUNNER_PATH`, else `bot_config.json` `webrunner_path`, else the sibling `D:\Codes\WebRunner`, else the installed package (one rule, `JeffreyRPA/_webrunner_location.py`). Before importing it sets `WEBRUNNER_LOG_PATH` (if unset) to its own `webrunner.log`; `Jeffrey_RPA/requirements.txt` requires `je_web_runner>=0.0.88` because of the four wrapper methods listed here. | `TestObject`, `webdriver_wrapper_instance` and its methods `get_current_url`, `get_title`, `save_screenshot`, `add_script_to_evaluate_on_new_document`; for its je_web_runner variant, `set_driver(..., install_driver=False)` (start without webdriver-manager) and `executor.set_raise_wrapper_errors`; `test/test_je_facade.py` (in Jeffrey_RPA) imports `je_web_runner.webdriver.webdriver_wrapper` and checks `_webdriver_dict`. | | Jeffrey_RPA tests | `JeffreyRPA/conftest.py` hooks the import of `je_web_runner.utils.logging.loggin_instance` to park the log file outside the repo. | That exact, misspelled module path. **Do not rename it.** | | AutoControlGUI | Optional `utils/webrunner_bridge/bridge.py` (not a declared dependency; found with `importlib.util.find_spec`, imported lazily). | `je_web_runner.utils.executor.action_executor`: `execute_one` (one action through the gates, raising `WebRunnerExecuteException`), falling back to `executor.event_dict` on releases without it; `executor.event_dict` `WR_*` keys for listing; the commands `WR_get_webdriver_manager`, `WR_to_url`, `WR_quit`, `WR_save_screenshot`, `WR_get_current_url` (guarded by `test/unit_test/test_public_api.py`); `je_web_runner.utils.exception.exceptions.WebRunnerException` as the failure it wraps. | -| TestPioneer | Declared dependency; `from je_web_runner import execute_action` in-process. | `execute_action`. | +| TestPioneer | Declared dependency; `from je_web_runner import execute_action` in-process, and `parallel_run` spawns `python -m je_web_runner --execute_file