mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
Merge branch 'feature/nvs_coverage' into 'master'
NVS: add power off recovery and coverage test into CI See merge request idf/esp-idf!2246
This commit is contained in:
@@ -243,6 +243,24 @@ test_nvs_on_host:
|
|||||||
- cd components/nvs_flash/test_nvs_host
|
- cd components/nvs_flash/test_nvs_host
|
||||||
- make test
|
- make test
|
||||||
|
|
||||||
|
test_nvs_coverage:
|
||||||
|
stage: test
|
||||||
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
||||||
|
tags:
|
||||||
|
- nvs_host_test
|
||||||
|
dependencies: []
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- components/nvs_flash/test_nvs_host/coverage_report
|
||||||
|
only:
|
||||||
|
- triggers
|
||||||
|
# This job takes a few hours to finish, so only run it on demand
|
||||||
|
variables:
|
||||||
|
BOT_NEEDS_TRIGGER_BY_NAME: 1
|
||||||
|
script:
|
||||||
|
- cd components/nvs_flash/test_nvs_host
|
||||||
|
- make coverage_report
|
||||||
|
|
||||||
test_partition_table_on_host:
|
test_partition_table_on_host:
|
||||||
stage: test
|
stage: test
|
||||||
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
|
||||||
|
@@ -37,10 +37,10 @@ $(OUTPUT_DIR):
|
|||||||
mkdir -p $(OUTPUT_DIR)
|
mkdir -p $(OUTPUT_DIR)
|
||||||
|
|
||||||
test: $(TEST_PROGRAM)
|
test: $(TEST_PROGRAM)
|
||||||
./$(TEST_PROGRAM)
|
./$(TEST_PROGRAM) -d yes exclude:[long]
|
||||||
|
|
||||||
long-test: $(TEST_PROGRAM)
|
long-test: $(TEST_PROGRAM)
|
||||||
./$(TEST_PROGRAM) [list],[enumtable],[spi_flash_emu],[nvs],[long]
|
./$(TEST_PROGRAM) -d yes
|
||||||
|
|
||||||
$(COVERAGE_FILES): $(TEST_PROGRAM) long-test
|
$(COVERAGE_FILES): $(TEST_PROGRAM) long-test
|
||||||
|
|
||||||
@@ -58,4 +58,4 @@ clean:
|
|||||||
rm -rf coverage_report/
|
rm -rf coverage_report/
|
||||||
rm -f coverage.info
|
rm -f coverage.info
|
||||||
|
|
||||||
.PHONY: clean all test
|
.PHONY: clean all test long-test
|
||||||
|
@@ -720,9 +720,16 @@ TEST_CASE("can init storage from flash with random contents", "[nvs]")
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST_CASE("nvs api tests, starting with random data in flash", "[nvs][.][long]")
|
TEST_CASE("nvs api tests, starting with random data in flash", "[nvs][long]")
|
||||||
{
|
{
|
||||||
for (size_t count = 0; count < 10000; ++count) {
|
const size_t testIters = 3000;
|
||||||
|
int lastPercent = -1;
|
||||||
|
for (size_t count = 0; count < testIters; ++count) {
|
||||||
|
int percentDone = (int) (count * 100 / testIters);
|
||||||
|
if (percentDone != lastPercent) {
|
||||||
|
lastPercent = percentDone;
|
||||||
|
printf("%d%%\n", percentDone);
|
||||||
|
}
|
||||||
SpiFlashEmulator emu(10);
|
SpiFlashEmulator emu(10);
|
||||||
emu.randomize(static_cast<uint32_t>(count));
|
emu.randomize(static_cast<uint32_t>(count));
|
||||||
|
|
||||||
@@ -977,7 +984,7 @@ TEST_CASE("monkey test", "[nvs][monkey]")
|
|||||||
s_perf << "Monkey test: nErase=" << emu.getEraseOps() << " nWrite=" << emu.getWriteOps() << std::endl;
|
s_perf << "Monkey test: nErase=" << emu.getEraseOps() << " nWrite=" << emu.getWriteOps() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("test recovery from sudden poweroff", "[.][long][nvs][recovery][monkey]")
|
TEST_CASE("test recovery from sudden poweroff", "[long][nvs][recovery][monkey]")
|
||||||
{
|
{
|
||||||
std::random_device rd;
|
std::random_device rd;
|
||||||
std::mt19937 gen(rd());
|
std::mt19937 gen(rd());
|
||||||
|
@@ -28,8 +28,8 @@ def parse_filter(filter_name):
|
|||||||
return filters
|
return filters
|
||||||
|
|
||||||
|
|
||||||
def process_filter(filter_name, ci_name):
|
def process_filter(execute_by_default, filter_name, ci_name):
|
||||||
execute = True
|
execute = execute_by_default
|
||||||
|
|
||||||
# bot message is case insensitive (processed with lower case). so we also convert ci_name to lower case.
|
# bot message is case insensitive (processed with lower case). so we also convert ci_name to lower case.
|
||||||
ci_name = ci_name.lower()
|
ci_name = ci_name.lower()
|
||||||
@@ -51,8 +51,12 @@ def process_filter(filter_name, ci_name):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
need_to_execute = process_filter("BOT_STAGE_FILTER", os.getenv("CI_JOB_STAGE")) \
|
execute_by_default = True
|
||||||
and process_filter("BOT_JOB_FILTER", os.getenv("CI_JOB_NAME"))
|
if os.getenv("BOT_NEEDS_TRIGGER_BY_NAME", "0") == "1":
|
||||||
|
execute_by_default = False
|
||||||
|
|
||||||
|
need_to_execute = process_filter(True, "BOT_STAGE_FILTER", os.getenv("CI_JOB_STAGE")) \
|
||||||
|
and process_filter(execute_by_default, "BOT_JOB_FILTER", os.getenv("CI_JOB_NAME"))
|
||||||
if need_to_execute:
|
if need_to_execute:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user