mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 00:35:44 +00:00
Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts: # esphome/components/mqtt/mqtt_binary_sensor.cpp # esphome/components/mqtt/mqtt_component.cpp # esphome/components/mqtt/mqtt_cover.cpp # esphome/components/mqtt/mqtt_event.cpp # esphome/components/mqtt/mqtt_number.cpp # esphome/components/mqtt/mqtt_sensor.cpp # esphome/components/mqtt/mqtt_text_sensor.cpp # esphome/components/mqtt/mqtt_valve.cpp
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
button:
|
||||
- platform: bl0940
|
||||
bl0940_id: test_id
|
||||
bl0940_id: bl0940_test_id
|
||||
name: Cal Reset
|
||||
|
||||
sensor:
|
||||
- platform: bl0940
|
||||
id: test_id
|
||||
id: bl0940_test_id
|
||||
voltage:
|
||||
name: BL0940 Voltage
|
||||
current:
|
||||
@@ -22,7 +22,7 @@ sensor:
|
||||
number:
|
||||
- platform: bl0940
|
||||
id: bl0940_number_id
|
||||
bl0940_id: test_id
|
||||
bl0940_id: bl0940_test_id
|
||||
current_calibration:
|
||||
name: Cal Current
|
||||
min_value: -5
|
||||
|
||||
@@ -726,6 +726,12 @@ lvgl:
|
||||
- logger.log:
|
||||
format: "Spinbox value is %f"
|
||||
args: [x]
|
||||
- lvgl.label.update:
|
||||
id: hello_label
|
||||
text:
|
||||
format: "value is %.1f now"
|
||||
args: [x]
|
||||
if_nan: "Value unknown"
|
||||
- button:
|
||||
styles: spin_button
|
||||
id: spin_down
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
sensor:
|
||||
- platform: nau7802
|
||||
i2c_id: i2c_bus
|
||||
id: test_id
|
||||
id: nau7802_test_id
|
||||
name: weight
|
||||
gain: 32
|
||||
ldo_voltage: "3.0v"
|
||||
samples_per_second: 10
|
||||
on_value:
|
||||
then:
|
||||
- nau7802.calibrate_external_offset: test_id
|
||||
- nau7802.calibrate_internal_offset: test_id
|
||||
- nau7802.calibrate_gain: test_id
|
||||
- nau7802.calibrate_external_offset: nau7802_test_id
|
||||
- nau7802.calibrate_internal_offset: nau7802_test_id
|
||||
- nau7802.calibrate_gain: nau7802_test_id
|
||||
|
||||
@@ -1240,3 +1240,73 @@ def test_detect_memory_impact_config_filters_incompatible_esp8266_on_esp32(
|
||||
)
|
||||
|
||||
assert result["use_merged_config"] == "true"
|
||||
|
||||
|
||||
def test_detect_memory_impact_config_skips_release_branch(tmp_path: Path) -> None:
|
||||
"""Test that memory impact analysis is skipped for release* branches."""
|
||||
# Create test directory structure with components that have tests
|
||||
tests_dir = tmp_path / "tests" / "components"
|
||||
wifi_dir = tests_dir / "wifi"
|
||||
wifi_dir.mkdir(parents=True)
|
||||
(wifi_dir / "test.esp32-idf.yaml").write_text("test: wifi")
|
||||
|
||||
with (
|
||||
patch.object(determine_jobs, "root_path", str(tmp_path)),
|
||||
patch.object(helpers, "root_path", str(tmp_path)),
|
||||
patch.object(determine_jobs, "changed_files") as mock_changed_files,
|
||||
patch.object(determine_jobs, "get_target_branch", return_value="release"),
|
||||
):
|
||||
mock_changed_files.return_value = ["esphome/components/wifi/wifi.cpp"]
|
||||
determine_jobs._component_has_tests.cache_clear()
|
||||
|
||||
result = determine_jobs.detect_memory_impact_config()
|
||||
|
||||
# Memory impact should be skipped for release branch
|
||||
assert result["should_run"] == "false"
|
||||
|
||||
|
||||
def test_detect_memory_impact_config_skips_beta_branch(tmp_path: Path) -> None:
|
||||
"""Test that memory impact analysis is skipped for beta* branches."""
|
||||
# Create test directory structure with components that have tests
|
||||
tests_dir = tmp_path / "tests" / "components"
|
||||
wifi_dir = tests_dir / "wifi"
|
||||
wifi_dir.mkdir(parents=True)
|
||||
(wifi_dir / "test.esp32-idf.yaml").write_text("test: wifi")
|
||||
|
||||
with (
|
||||
patch.object(determine_jobs, "root_path", str(tmp_path)),
|
||||
patch.object(helpers, "root_path", str(tmp_path)),
|
||||
patch.object(determine_jobs, "changed_files") as mock_changed_files,
|
||||
patch.object(determine_jobs, "get_target_branch", return_value="beta"),
|
||||
):
|
||||
mock_changed_files.return_value = ["esphome/components/wifi/wifi.cpp"]
|
||||
determine_jobs._component_has_tests.cache_clear()
|
||||
|
||||
result = determine_jobs.detect_memory_impact_config()
|
||||
|
||||
# Memory impact should be skipped for beta branch
|
||||
assert result["should_run"] == "false"
|
||||
|
||||
|
||||
def test_detect_memory_impact_config_runs_for_dev_branch(tmp_path: Path) -> None:
|
||||
"""Test that memory impact analysis runs for dev branch."""
|
||||
# Create test directory structure with components that have tests
|
||||
tests_dir = tmp_path / "tests" / "components"
|
||||
wifi_dir = tests_dir / "wifi"
|
||||
wifi_dir.mkdir(parents=True)
|
||||
(wifi_dir / "test.esp32-idf.yaml").write_text("test: wifi")
|
||||
|
||||
with (
|
||||
patch.object(determine_jobs, "root_path", str(tmp_path)),
|
||||
patch.object(helpers, "root_path", str(tmp_path)),
|
||||
patch.object(determine_jobs, "changed_files") as mock_changed_files,
|
||||
patch.object(determine_jobs, "get_target_branch", return_value="dev"),
|
||||
):
|
||||
mock_changed_files.return_value = ["esphome/components/wifi/wifi.cpp"]
|
||||
determine_jobs._component_has_tests.cache_clear()
|
||||
|
||||
result = determine_jobs.detect_memory_impact_config()
|
||||
|
||||
# Memory impact should run for dev branch
|
||||
assert result["should_run"] == "true"
|
||||
assert result["components"] == ["wifi"]
|
||||
|
||||
@@ -31,6 +31,13 @@ print_file_list = helpers.print_file_list
|
||||
get_all_dependencies = helpers.get_all_dependencies
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clear_helpers_cache() -> None:
|
||||
"""Clear cached functions before each test."""
|
||||
helpers._get_github_event_data.cache_clear()
|
||||
helpers._get_changed_files_github_actions.cache_clear()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("github_ref", "expected_pr_number"),
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user