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:
Ivan Grokhotkov
2018-04-24 23:42:00 +08:00
4 changed files with 39 additions and 10 deletions

View File

@@ -243,6 +243,24 @@ test_nvs_on_host:
- cd components/nvs_flash/test_nvs_host
- 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:
stage: test
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG

View File

@@ -37,10 +37,10 @@ $(OUTPUT_DIR):
mkdir -p $(OUTPUT_DIR)
test: $(TEST_PROGRAM)
./$(TEST_PROGRAM)
./$(TEST_PROGRAM) -d yes exclude:[long]
long-test: $(TEST_PROGRAM)
./$(TEST_PROGRAM) [list],[enumtable],[spi_flash_emu],[nvs],[long]
./$(TEST_PROGRAM) -d yes
$(COVERAGE_FILES): $(TEST_PROGRAM) long-test
@@ -58,4 +58,4 @@ clean:
rm -rf coverage_report/
rm -f coverage.info
.PHONY: clean all test
.PHONY: clean all test long-test

View File

@@ -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);
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;
}
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::mt19937 gen(rd());

View File

@@ -28,8 +28,8 @@ def parse_filter(filter_name):
return filters
def process_filter(filter_name, ci_name):
execute = True
def process_filter(execute_by_default, filter_name, ci_name):
execute = execute_by_default
# bot message is case insensitive (processed with lower case). so we also convert ci_name to lower case.
ci_name = ci_name.lower()
@@ -51,8 +51,12 @@ def process_filter(filter_name, ci_name):
if __name__ == "__main__":
need_to_execute = process_filter("BOT_STAGE_FILTER", os.getenv("CI_JOB_STAGE")) \
and process_filter("BOT_JOB_FILTER", os.getenv("CI_JOB_NAME"))
execute_by_default = True
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:
sys.exit(0)
else: