From b19b4c8e47538b77f776a2ee60a91ae686a7ed0e Mon Sep 17 00:00:00 2001 From: Xiao Xufeng Date: Fri, 7 Apr 2023 15:27:05 +0800 Subject: [PATCH 1/4] sdio_example: fix meaningless print in host, make shared reg access more readable in slave --- .../peripherals/sdio/host/main/app_main.c | 2 +- .../peripherals/sdio/slave/main/app_main.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/examples/peripherals/sdio/host/main/app_main.c b/examples/peripherals/sdio/host/main/app_main.c index 0ef1a20ebf..ff39f922b1 100644 --- a/examples/peripherals/sdio/host/main/app_main.c +++ b/examples/peripherals/sdio/host/main/app_main.c @@ -416,7 +416,7 @@ void job_write_reg(essl_handle_t handle, int value) } ESP_LOGI(TAG, "read registers:"); - ESP_LOG_BUFFER_HEXDUMP(TAG, reg_read, 64, ESP_LOG_INFO); + ESP_LOG_BUFFER_HEXDUMP(TAG, reg_read, 60, ESP_LOG_INFO); } //the slave only load 16 buffers a time diff --git a/examples/peripherals/sdio/slave/main/app_main.c b/examples/peripherals/sdio/slave/main/app_main.c index f32766e0aa..f78ad91070 100644 --- a/examples/peripherals/sdio/slave/main/app_main.c +++ b/examples/peripherals/sdio/slave/main/app_main.c @@ -62,6 +62,9 @@ #define EV_STR(s) "================ "s" ================" +//skip interrupt regs. +#define SLAVE_ADDR(i) ((i) >= 28? (i) + 4: (i)) + typedef enum { JOB_IDLE = 0, JOB_RESET = 1, @@ -123,19 +126,15 @@ static esp_err_t task_write_reg(void) { //the host write REG1, the slave should write its registers according to value of REG1 uint8_t read = sdio_slave_read_reg(1); - for (int i = 0; i < 64; i++) { - //skip interrupt regs. - if (i >= 28 && i <= 31) continue; - sdio_slave_write_reg(i, read+3*i); + for (int i = 0; i < 60; i++) { + sdio_slave_write_reg(SLAVE_ADDR(i), read + 3*i); } - uint8_t reg[64] = {0}; - for (int i = 0; i < 64; i++) { - //skip interrupt regs. - if (i >= 28 && i <= 31) continue; - reg[i] = sdio_slave_read_reg(i); + uint8_t reg[60] = {0}; + for (int i = 0; i < 60; i++) { + reg[i] = sdio_slave_read_reg(SLAVE_ADDR(i)); } ESP_LOGI(TAG, "write regs:"); - ESP_LOG_BUFFER_HEXDUMP(TAG, reg, 64, ESP_LOG_INFO); + ESP_LOG_BUFFER_HEXDUMP(TAG, reg, 60, ESP_LOG_INFO); return ESP_OK; } From 1be18d4bc52979f8f608002e633c9863f59a4625 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Thu, 6 Apr 2023 12:21:21 +0800 Subject: [PATCH 2/4] ci: migrate peripherals ttfw test scripts --- .gitlab/ci/rules.yml | 1 + .gitlab/ci/target-test.yml | 28 ++-- conftest.py | 1 + examples/peripherals/.build-test-rules.yml | 8 ++ .../peripherals/i2c/i2c_tools/example_test.py | 37 ------ .../i2c_tools/pytest_examples_i2c_tools.py | 32 +++++ examples/peripherals/sdio/pytest_sdio_test.py | 112 ++++++++++++++++ examples/peripherals/sdio/sdio_test.py | 123 ------------------ 8 files changed, 170 insertions(+), 172 deletions(-) delete mode 100644 examples/peripherals/i2c/i2c_tools/example_test.py create mode 100644 examples/peripherals/i2c/i2c_tools/pytest_examples_i2c_tools.py create mode 100644 examples/peripherals/sdio/pytest_sdio_test.py delete mode 100644 examples/peripherals/sdio/sdio_test.py diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index 06293b54a3..ccfa318890 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -246,6 +246,7 @@ - "components/driver/include/driver/sdio*.h" - "components/driver/include/driver/sdmmc*.h" - "components/sdmmc/**/*" + - "examples/peripherals/sdio/**/*" # for jobs: component_ut_pytest_sdio related .patterns-component_ut-sdio: &patterns-component_ut-sdio diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index 278c9ef97b..6eaf5e9e27 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -97,6 +97,22 @@ pytest_examples_esp32_jtag: SETUP_TOOLS: "1" # need gdb openocd PYTEST_EXTRA_FLAGS: "--log-cli-level DEBUG" +pytest_examples_esp32_ccs811: + extends: + - .pytest_examples_dir_template + - .rules:test:example_test-esp32 + needs: + - build_pytest_examples_esp32 + tags: [ esp32, ccs811 ] + +pytest_examples_esp32_sdio: + extends: + - .pytest_examples_dir_template + - .rules:test:example_test-esp32-sdio + needs: + - build_pytest_examples_esp32 + tags: [ esp32, sdio_master_slave ] + pytest_examples_esp32s2_generic: extends: - .pytest_examples_dir_template @@ -1098,12 +1114,6 @@ example_test_001C: - ESP32 - Example_GENERIC -.example_test_003: - extends: .example_test_esp32_template - tags: - - ESP32 - - Example_SDIO - example_test_005: extends: - .example_test_esp32_template @@ -1112,12 +1122,6 @@ example_test_005: - ESP32 - Example_WIFI_BT -example_test_007: - extends: .example_test_esp32_template - tags: - - ESP32 - - Example_I2C_CCS811_SENSOR - example_test_C3_GENERIC: extends: .example_test_esp32c3_template tags: diff --git a/conftest.py b/conftest.py index 01fe8169dd..fdc2378245 100644 --- a/conftest.py +++ b/conftest.py @@ -122,6 +122,7 @@ ENV_MARKERS = { 'psramv0': 'Runner with PSRAM version 0', 'esp32eco3': 'Runner with esp32 eco3 connected', 'ecdsa_efuse': 'Runner with test ECDSA private keys programmed in efuse', + 'ccs811': 'Runner with CCS811 connected', # multi-dut markers 'ieee802154': 'ieee802154 related tests should run on ieee802154 runners.', 'openthread_br': 'tests should be used for openthread border router.', diff --git a/examples/peripherals/.build-test-rules.yml b/examples/peripherals/.build-test-rules.yml index 28b1931547..8ffaef3b6b 100644 --- a/examples/peripherals/.build-test-rules.yml +++ b/examples/peripherals/.build-test-rules.yml @@ -165,10 +165,18 @@ examples/peripherals/sdio/host: - if: IDF_TARGET == "esp32" temporary: true reason: Only the SDSPI of ESP32 supports ESP SDIO slave for now + disable_test: + - if: IDF_TARGET != "esp32" + temporary: true + reason: lack of runners examples/peripherals/sdio/slave: disable: - if: SOC_SDIO_SLAVE_SUPPORTED != 1 + disable_test: + - if: IDF_TARGET != "esp32" + temporary: true + reason: lack of runners examples/peripherals/secure_element/atecc608_ecdsa: enable: diff --git a/examples/peripherals/i2c/i2c_tools/example_test.py b/examples/peripherals/i2c/i2c_tools/example_test.py deleted file mode 100644 index 67d48b4810..0000000000 --- a/examples/peripherals/i2c/i2c_tools/example_test.py +++ /dev/null @@ -1,37 +0,0 @@ -from __future__ import print_function - -import ttfw_idf - -EXPECT_TIMEOUT = 20 - - -@ttfw_idf.idf_example_test(env_tag='Example_I2C_CCS811_SENSOR') -def test_i2ctools_example(env, extra_data): - # Get device under test, flash and start example. "i2ctool" must be defined in EnvConfig - dut = env.get_dut('i2ctools', 'examples/peripherals/i2c/i2c_tools', dut_class=ttfw_idf.ESP32DUT) - dut.start_app() - dut.expect('i2c-tools>', timeout=EXPECT_TIMEOUT) - # Get i2c address - dut.write('i2cdetect') - dut.expect('5b', timeout=EXPECT_TIMEOUT) - # Get chip ID - dut.write('i2cget -c 0x5b -r 0x20 -l 1') - dut.expect('0x81', timeout=EXPECT_TIMEOUT) - # Reset sensor - dut.write('i2cset -c 0x5b -r 0xFF 0x11 0xE5 0x72 0x8A') - dut.expect('OK', timeout=EXPECT_TIMEOUT) - # Get status - dut.write('i2cget -c 0x5b -r 0x00 -l 1') - dut.expect_any('0x10', timeout=EXPECT_TIMEOUT) - # Change work mode - dut.write('i2cset -c 0x5b -r 0xF4') - dut.expect('OK', timeout=EXPECT_TIMEOUT) - dut.write('i2cset -c 0x5b -r 0x01 0x10') - dut.expect('OK', timeout=EXPECT_TIMEOUT) - # Get new status - dut.write('i2cget -c 0x5b -r 0x00 -l 1') - dut.expect_any('0x98', '0x90', timeout=EXPECT_TIMEOUT) - - -if __name__ == '__main__': - test_i2ctools_example() diff --git a/examples/peripherals/i2c/i2c_tools/pytest_examples_i2c_tools.py b/examples/peripherals/i2c/i2c_tools/pytest_examples_i2c_tools.py new file mode 100644 index 0000000000..cc152e0070 --- /dev/null +++ b/examples/peripherals/i2c/i2c_tools/pytest_examples_i2c_tools.py @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Unlicense OR CC0-1.0 +import pytest +from pytest_embedded_idf import IdfDut + +EXPECT_TIMEOUT = 20 + + +@pytest.mark.esp32 +@pytest.mark.ccs811 +def test_i2ctools_example(dut: IdfDut) -> None: + dut.expect_exact('i2c-tools>', timeout=EXPECT_TIMEOUT) + # Get i2c address + dut.write('i2cdetect') + dut.expect_exact('5b', timeout=EXPECT_TIMEOUT) + # Get chip ID + dut.write('i2cget -c 0x5b -r 0x20 -l 1') + dut.expect_exact('0x81', timeout=EXPECT_TIMEOUT) + # Reset sensor + dut.write('i2cset -c 0x5b -r 0xFF 0x11 0xE5 0x72 0x8A') + dut.expect_exact('OK', timeout=EXPECT_TIMEOUT) + # Get status + dut.write('i2cget -c 0x5b -r 0x00 -l 1') + dut.expect_exact('0x10', timeout=EXPECT_TIMEOUT) + # Change work mode + dut.write('i2cset -c 0x5b -r 0xF4') + dut.expect_exact('OK', timeout=EXPECT_TIMEOUT) + dut.write('i2cset -c 0x5b -r 0x01 0x10') + dut.expect_exact('OK', timeout=EXPECT_TIMEOUT) + # Get new status + dut.write('i2cget -c 0x5b -r 0x00 -l 1') + dut.expect_exact(['0x98', '0x90'], timeout=EXPECT_TIMEOUT) diff --git a/examples/peripherals/sdio/pytest_sdio_test.py b/examples/peripherals/sdio/pytest_sdio_test.py new file mode 100644 index 0000000000..487d8d35f6 --- /dev/null +++ b/examples/peripherals/sdio/pytest_sdio_test.py @@ -0,0 +1,112 @@ +# SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 +import os +from typing import Tuple + +import pytest +from pytest_embedded_idf import IdfDut + + +@pytest.mark.esp32 +@pytest.mark.sdio_master_slave +@pytest.mark.parametrize( + 'count, app_path', + [ + (2, f'{os.path.join(os.path.dirname(__file__), "host")}|{os.path.join(os.path.dirname(__file__), "slave")}'), + ], + indirect=True, +) +def test_example_sdio_communication(dut: Tuple[IdfDut, IdfDut]) -> None: + """ + Configurations + host = host -> slave = slave + should be in the same group of devices, otherwise may meet download issue + group1: (Wroom-32 Series or PICO-D4 modules: PICO-Kit, DevKitC, WroverKit v2 or earlier) + group2: (Wrover module: WroverKit v3) + + GPIO14->GPIO14 + GPIO15->GPIO15 + GPIO2->GPIO2 + GPIO4->GPIO4 + GND->GND + + VDD3.3 -> GPIO13 if slave uses WroverKit v3 + + or use sdio test board, which has two wrover modules connect to a same FT3232 + Assume that first dut is host and second is slave + """ + host = dut[0] + slave = dut[1] + + host.pexpect_proc.timeout = 5 + slave.pexpect_proc.timeout = 5 + + host.expect_exact('host ready, start initializing slave...') + host.expect_exact('0a 0d 10 13 16 19 1c 1f 22 25 28 2b 2e 31 34 37') + host.expect_exact('3a 3d 40 43 46 49 4c 4f 52 55 58 5b 5e 61 64 67') + host.expect_exact('6a 6d 70 73 76 79 7c 7f 82 85 88 8b 8e 91 94 97') + host.expect_exact('9a 9d a0 a3 a6 a9 ac af b2 b5 b8 bb') + + slave.expect_exact('================ JOB_WRITE_REG ================') + slave.expect_exact('0a 0d 10 13 16 19 1c 1f 22 25 28 2b 2e 31 34 37') + slave.expect_exact('3a 3d 40 43 46 49 4c 4f 52 55 58 5b 5e 61 64 67') + slave.expect_exact('6a 6d 70 73 76 79 7c 7f 82 85 88 8b 8e 91 94 97') + slave.expect_exact('9a 9d a0 a3 a6 a9 ac af b2 b5 b8 bb') + + host.expect_exact('host int: 0') + host.expect_exact('host int: 1') + host.expect_exact('host int: 2') + host.expect_exact('host int: 3') + host.expect_exact('host int: 4') + host.expect_exact('host int: 5') + host.expect_exact('host int: 6') + host.expect_exact('host int: 7') + host.expect_exact('host int: 0') + host.expect_exact('host int: 1') + host.expect_exact('host int: 2') + host.expect_exact('host int: 3') + host.expect_exact('host int: 4') + host.expect_exact('host int: 5') + host.expect_exact('host int: 6') + host.expect_exact('host int: 7') + + slave.expect_exact('================ JOB_SEND_INT ================') + slave.expect_exact('================ JOB_SEND_INT ================') + + host.expect_exact('send packet length: 6') + host.expect_exact('send packet length: 12') + host.expect_exact('send packet length: 1024') + host.expect_exact('send packet length: 512') + host.expect_exact('send packet length: 3') + + slave.expect_exact('Packet received, len: 6') + slave.expect_exact('Buffer 0, len: 6') + slave.expect_exact('Packet received, len: 12') + slave.expect_exact('Buffer 0, len: 12') + # 1024 + slave.expect_exact('Packet received, len: 1024') + for i in range(8): + slave.expect_exact(f'Buffer {i}, len: 128') + # 512 + slave.expect_exact('Packet received, len: 512') + for i in range(4): + slave.expect_exact(f'Buffer {i}, len: 128') + # 3 + slave.expect_exact('Packet received, len: 3') + slave.expect_exact('Buffer 0, len: 3') + + # same as slave received + host.expect_exact('receive data, size: 6') + host.expect_exact('receive data, size: 12') + for _ in range(8): + host.expect_exact('receive data, size: 128') + for _ in range(4): + host.expect_exact('receive data, size: 128') + host.expect_exact('receive data, size: 3') + + # the last valid line of one round + host.expect_exact('aa af b4') + + # the first 2 lines of the second round + host.expect_exact('46 4b 50 55 5a 5f') + host.expect_exact('6e 73 78 7d 82 87 8c 91 96 9b a0 a5') diff --git a/examples/peripherals/sdio/sdio_test.py b/examples/peripherals/sdio/sdio_test.py deleted file mode 100644 index 07ec784a74..0000000000 --- a/examples/peripherals/sdio/sdio_test.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http:#www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import ttfw_idf -from tiny_test_fw import TinyFW - - -@ttfw_idf.idf_example_test(env_tag='Example_SDIO', ignore=True) -def test_example_sdio_communication(env, extra_data): - """ - Configurations - dut1 = host -> dut2 = slave - should be in the same group of devices, otherwise may meet download issue - group1: (Wroom-32 Series or PICO-D4 modules: PICO-Kit, DevKitC, WroverKit v2 or earlier) - group2: (Wrover module: WroverKit v3) - - GPIO14->GPIO14 - GPIO15->GPIO15 - GPIO2->GPIO2 - GPIO4->GPIO4 - GND->GND - - VDD3.3 -> GPIO13 if dut2 uses WroverKit v3 - - or use sdio test board, which has two wrover modules connect to a same FT3232 - Assume that first dut is host and second is slave - """ - dut1 = env.get_dut('sdio_host', 'examples/peripherals/sdio/host', dut_class=ttfw_idf.ESP32DUT) - dut2 = env.get_dut('sdio_slave', 'examples/peripherals/sdio/slave', dut_class=ttfw_idf.ESP32DUT) - dut1.start_app() - # wait until the master is ready to setup the slave - dut1.expect('host ready, start initializing slave...') - - dut2.start_app() - dut1.expect('0a 0d 10 13 16 19 1c 1f 22 25 28 2b 2e 31 34 37') - dut1.expect('3a 3d 40 43 46 49 4c 4f 52 55 58 5b 00 00 00 00') - dut1.expect('6a 6d 70 73 76 79 7c 7f 82 85 88 8b 8e 91 94 97') - dut1.expect('9a 9d a0 a3 a6 a9 ac af b2 b5 b8 bb be c1 c4 c7') - - dut2.expect('================ JOB_WRITE_REG ================') - dut2.expect('0a 0d 10 13 16 19 1c 1f 22 25 28 2b 2e 31 34 37') - dut2.expect('3a 3d 40 43 46 49 4c 4f 52 55 58 5b 00 00 00 00') - dut2.expect('6a 6d 70 73 76 79 7c 7f 82 85 88 8b 8e 91 94 97') - dut2.expect('9a 9d a0 a3 a6 a9 ac af b2 b5 b8 bb be c1 c4 c7') - - dut1.expect('host int: 0') - dut1.expect('host int: 1') - dut1.expect('host int: 2') - dut1.expect('host int: 3') - dut1.expect('host int: 4') - dut1.expect('host int: 5') - dut1.expect('host int: 6') - dut1.expect('host int: 7') - dut1.expect('host int: 0') - dut1.expect('host int: 1') - dut1.expect('host int: 2') - dut1.expect('host int: 3') - dut1.expect('host int: 4') - dut1.expect('host int: 5') - dut1.expect('host int: 6') - dut1.expect('host int: 7') - - dut2.expect('================ JOB_SEND_INT ================') - dut2.expect('================ JOB_SEND_INT ================') - - dut1.expect('send packet length: 3') - dut1.expect('send packet length: 6') - dut1.expect('send packet length: 12') - dut1.expect('send packet length: 128') - dut1.expect('send packet length: 511') - dut1.expect('send packet length: 512') - - dut2.expect('recv len: 3') - dut2.expect('recv len: 6') - dut2.expect('recv len: 12') - dut2.expect('recv len: 128') - # 511 - dut2.expect('recv len: 128') - dut2.expect('recv len: 128') - dut2.expect('recv len: 128') - dut2.expect('recv len: 127') - # 512 - dut2.expect('recv len: 128') - dut2.expect('recv len: 128') - dut2.expect('recv len: 128') - dut2.expect('recv len: 128') - - dut1.expect('receive data, size: 3') - dut1.expect('receive data, size: 6') - dut1.expect('receive data, size: 12') - dut1.expect('receive data, size: 128') - - dut1.expect('receive data, size: 128') - dut1.expect('receive data, size: 128') - dut1.expect('receive data, size: 128') - dut1.expect('receive data, size: 127') - - dut1.expect('receive data, size: 128') - dut1.expect('receive data, size: 128') - dut1.expect('receive data, size: 128') - dut1.expect('receive data, size: 128') - - # the last valid line of one round - dut1.expect('ce d3 d8 dd e2 e7 ec f1 f6 fb 00 05 0a 0f 14 19') - # the first 2 lines of the second round - dut1.expect('46 4b 50') - dut1.expect('5a 5f 64 69 6e 73') - - -if __name__ == '__main__': - TinyFW.set_default_config(env_config_file='EnvConfigTemplate.yml', dut=ttfw_idf.IDFDUT) - test_example_sdio_communication() From 29bd34dcefe6975ed877b1cd078d81a550eb937f Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Mon, 10 Apr 2023 08:56:59 +0800 Subject: [PATCH 3/4] ci: add pattern ccs811 --- .gitlab/ci/dependencies/dependencies.yml | 1 + .gitlab/ci/rules.yml | 40 ++++++++++++++++++++++++ .gitlab/ci/target-test.yml | 2 +- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/.gitlab/ci/dependencies/dependencies.yml b/.gitlab/ci/dependencies/dependencies.yml index ccc244dd11..48ad7dd7e8 100644 --- a/.gitlab/ci/dependencies/dependencies.yml +++ b/.gitlab/ci/dependencies/dependencies.yml @@ -141,6 +141,7 @@ build:integration_test: - i154 - flash_multi - ecdsa + - ccs811 # pytest*ccs811* patterns: - "{0}-{1}-{2}" - "{0}-{2}" diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index ccfa318890..eb37dafbc7 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -260,6 +260,13 @@ - "components/driver/include/driver/sdmmc*.h" - "components/sdmmc/**/*" +.patterns-example_test-ccs811: &patterns-example_test-ccs811 + # components + - "examples/system/console/advanced/components/**/*" + - "components/driver/i2c/**/*" + # tests + - "examples/peripherals/i2c/i2c_tools/**/*" + # for jobs: UT_xx_SDSPI related .patterns-unit_test-sdio: &patterns-unit_test-sdio - "components/hal/sdio*.c" @@ -1178,6 +1185,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1220,6 +1229,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1260,6 +1271,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1301,6 +1314,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1341,6 +1356,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1381,6 +1398,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1421,6 +1440,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1461,6 +1482,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1501,6 +1524,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -1626,6 +1651,8 @@ changes: *patterns-example_test - <<: *if-dev-push changes: *patterns-example_test-bt + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 - <<: *if-dev-push changes: *patterns-example_test-ethernet - <<: *if-dev-push @@ -2427,6 +2454,19 @@ - <<: *if-dev-push changes: *patterns-example_test-bt +.rules:test:example_test-esp32-ccs811: + rules: + - <<: *if-revert-branch + when: never + - <<: *if-protected + - <<: *if-label-build-only + when: never + - <<: *if-label-example_test + - <<: *if-label-example_test_esp32 + - <<: *if-label-target_test + - <<: *if-dev-push + changes: *patterns-example_test-ccs811 + .rules:test:example_test-esp32-ethernet: rules: - <<: *if-revert-branch diff --git a/.gitlab/ci/target-test.yml b/.gitlab/ci/target-test.yml index 6eaf5e9e27..6f710896b3 100644 --- a/.gitlab/ci/target-test.yml +++ b/.gitlab/ci/target-test.yml @@ -100,7 +100,7 @@ pytest_examples_esp32_jtag: pytest_examples_esp32_ccs811: extends: - .pytest_examples_dir_template - - .rules:test:example_test-esp32 + - .rules:test:example_test-esp32-ccs811 needs: - build_pytest_examples_esp32 tags: [ esp32, ccs811 ] From a64d084eacad7708537cc113a764be6a74b19e51 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Mon, 10 Apr 2023 08:57:42 +0800 Subject: [PATCH 4/4] ci: small cleanup for the dependencies.yml --- .gitlab/ci/dependencies/dependencies.yml | 29 ++++-------------------- .gitlab/ci/rules.yml | 15 ------------ 2 files changed, 4 insertions(+), 40 deletions(-) diff --git a/.gitlab/ci/dependencies/dependencies.yml b/.gitlab/ci/dependencies/dependencies.yml index 48ad7dd7e8..d0f4c71afc 100644 --- a/.gitlab/ci/dependencies/dependencies.yml +++ b/.gitlab/ci/dependencies/dependencies.yml @@ -133,11 +133,11 @@ build:integration_test: - *target_test - *all_targets - - bt # example_test_005 - - wifi # example_test_002, example_test*wifi* - - ethernet # example_test*ethernet* - - sdio # component_ut_pytest_esp32_sdio + - wifi # pytest*wifi* + - ethernet # pytest*ethernet* + - sdio # pytest*sdio* - usb # USB Device & Host tests - - adc # component_ut_pytest_esp32x_adc + - adc # pytest*adc* - i154 - flash_multi - ecdsa @@ -215,31 +215,10 @@ build:integration_test: ################################# # Triggered Only By Labels Jobs # ################################# -"labels:iperf_stress_test": # example_test - labels: - - iperf_stress_test - included_in: - - build:example_test - - build:example_test-esp32 - - build:target_test - -"labels:weekend_test": # custom test - labels: - - weekend_test - included_in: - - build:custom_test - - build:custom_test-esp32 - - build:target_test - "labels:nvs_coverage": # host_test labels: - nvs_coverage -"labels:fuzzer_test-weekend_test": # host test - labels: - - fuzzer_test - - weekend_test - "labels-protected:lan8720": # UT # FIXME: IDFCI-1176 temporary run this on master/release or with label labels: - lan8720 diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index eb37dafbc7..65f1bfb225 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -526,9 +526,6 @@ .if-label-example_test_esp32s3: &if-label-example_test_esp32s3 if: '$BOT_LABEL_EXAMPLE_TEST_ESP32S3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32s3(?:,[^,\n\r]+)*$/i' -.if-label-fuzzer_test: &if-label-fuzzer_test - if: '$BOT_LABEL_FUZZER_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*fuzzer_test(?:,[^,\n\r]+)*$/i' - .if-label-host_test: &if-label-host_test if: '$BOT_LABEL_HOST_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*host_test(?:,[^,\n\r]+)*$/i' @@ -541,9 +538,6 @@ .if-label-integration_test_wifi: &if-label-integration_test_wifi if: '$BOT_LABEL_INTEGRATION_TEST_WIFI || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_wifi(?:,[^,\n\r]+)*$/i' -.if-label-iperf_stress_test: &if-label-iperf_stress_test - if: '$BOT_LABEL_IPERF_STRESS_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*iperf_stress_test(?:,[^,\n\r]+)*$/i' - .if-label-lan8720: &if-label-lan8720 if: '$BOT_LABEL_LAN8720 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*lan8720(?:,[^,\n\r]+)*$/i' @@ -589,9 +583,6 @@ .if-label-unit_test_esp32s3: &if-label-unit_test_esp32s3 if: '$BOT_LABEL_UNIT_TEST_ESP32S3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32s3(?:,[^,\n\r]+)*$/i' -.if-label-weekend_test: &if-label-weekend_test - if: '$BOT_LABEL_WEEKEND_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*weekend_test(?:,[^,\n\r]+)*$/i' - .if-label-windows: &if-label-windows if: '$BOT_LABEL_WINDOWS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*windows(?:,[^,\n\r]+)*$/i' @@ -912,7 +903,6 @@ - <<: *if-label-custom_test_esp32s2 - <<: *if-label-custom_test_esp32s3 - <<: *if-label-target_test - - <<: *if-label-weekend_test - <<: *if-dev-push changes: *patterns-build_components - <<: *if-dev-push @@ -939,7 +929,6 @@ - <<: *if-label-custom_test - <<: *if-label-custom_test_esp32 - <<: *if-label-target_test - - <<: *if-label-weekend_test - <<: *if-dev-push changes: *patterns-build_components - <<: *if-dev-push @@ -1171,7 +1160,6 @@ - <<: *if-label-example_test_esp32h4 - <<: *if-label-example_test_esp32s2 - <<: *if-label-example_test_esp32s3 - - <<: *if-label-iperf_stress_test - <<: *if-label-target_test - <<: *if-dev-push changes: *patterns-build-example_test @@ -1215,7 +1203,6 @@ - <<: *if-label-build - <<: *if-label-example_test - <<: *if-label-example_test_esp32 - - <<: *if-label-iperf_stress_test - <<: *if-label-target_test - <<: *if-dev-push changes: *patterns-build-example_test @@ -1616,7 +1603,6 @@ - <<: *if-label-integration_test - <<: *if-label-integration_test_ble - <<: *if-label-integration_test_wifi - - <<: *if-label-iperf_stress_test - <<: *if-label-lan8720 - <<: *if-label-target_test - <<: *if-label-unit_test @@ -1628,7 +1614,6 @@ - <<: *if-label-unit_test_esp32h4 - <<: *if-label-unit_test_esp32s2 - <<: *if-label-unit_test_esp32s3 - - <<: *if-label-weekend_test - <<: *if-dev-push changes: *patterns-build-example_test - <<: *if-dev-push