]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove read-only tests of HTTP and Redis storage backends
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 11 Jul 2021 19:57:40 +0000 (21:57 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 12 Jul 2021 20:42:43 +0000 (22:42 +0200)
The “read-only” tests in secondary_http and secondary_redis were
inspired by the “read-only” test in secondary_file. However, that test
actually verifies the secondary storage *framework*, not the storage
backend itself, so it’s enough to just do it in secondary_file.

test/suites/secondary_http.bash
test/suites/secondary_redis.bash

index 75bca7fd123541b19834dcc7b4ba8bcb58c00dd1..893b4d52dddeae60755baf212c9802afe2ae526c 100644 (file)
@@ -50,32 +50,4 @@ SUITE_secondary_http() {
     expect_stat 'files in cache' 0
     expect_stat 'files in cache' 0
     expect_file_count 2 '*' secondary # result + manifest
-
-    # -------------------------------------------------------------------------
-    TEST "Read-only"
-
-    $CCACHE_COMPILE -c test.c
-    expect_stat 'cache hit (direct)' 0
-    expect_stat 'cache miss' 1
-    expect_stat 'files in cache' 2
-    expect_file_count 2 '*' secondary # result + manifest
-
-    $CCACHE -C >/dev/null
-    expect_stat 'files in cache' 0
-    expect_file_count 2 '*' secondary # result + manifest
-
-    CCACHE_SECONDARY_STORAGE+="|read-only"
-
-    $CCACHE_COMPILE -c test.c
-    expect_stat 'cache hit (direct)' 1
-    expect_stat 'cache miss' 1
-    expect_stat 'files in cache' 0
-    expect_file_count 2 '*' secondary # result + manifest
-
-    echo 'int x;' >> test.c
-    $CCACHE_COMPILE -c test.c
-    expect_stat 'cache hit (direct)' 1
-    expect_stat 'cache miss' 2
-    expect_stat 'files in cache' 2
-    expect_file_count 2 '*' secondary # result + manifest
 }
index 0e518bd09c63077fc3e3c7f33d10f4edc20cb519..a84a69c3b0ae79978131e96b9220d0588995d540 100644 (file)
@@ -12,11 +12,7 @@ SUITE_secondary_redis_PROBE() {
 start_redis_server() {
     local port="$1"
 
-    if ! command -v timeout >/dev/null; then
-         timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; }
-    fi
-
-    timeout 10 redis-server --bind localhost --port "${port}" >/dev/null &
+    redis-server --bind localhost --port "${port}" >/dev/null &
     # Wait for server start.
     i=0
     while [ $i -lt 100 ] && ! redis-cli -p "${port}" ping &>/dev/null; do
@@ -73,38 +69,4 @@ SUITE_secondary_redis() {
     expect_stat 'cache miss' 1
     expect_stat 'files in cache' 0
     expect_number_of_redis_cache_entries 2 "$redis_url" # result + manifest
-
-    # -------------------------------------------------------------------------
-    TEST "Read-only"
-
-    port=7777
-    redis_url="redis://localhost:${port}"
-    export CCACHE_SECONDARY_STORAGE="${redis_url}"
-
-    start_redis_server "${port}"
-
-    $CCACHE_COMPILE -c test.c
-    expect_stat 'cache hit (direct)' 0
-    expect_stat 'cache miss' 1
-    expect_stat 'files in cache' 2
-    expect_number_of_redis_cache_entries 2 "$redis_url" # result + manifest
-
-    $CCACHE -C >/dev/null
-    expect_stat 'files in cache' 0
-    expect_number_of_redis_cache_entries 2 "$redis_url" # result + manifest
-
-    CCACHE_SECONDARY_STORAGE+="|read-only"
-
-    $CCACHE_COMPILE -c test.c
-    expect_stat 'cache hit (direct)' 1
-    expect_stat 'cache miss' 1
-    expect_stat 'files in cache' 0
-    expect_number_of_redis_cache_entries 2 "$redis_url" # result + manifest
-
-    echo 'int x;' >> test.c
-    $CCACHE_COMPILE -c test.c
-    expect_stat 'cache hit (direct)' 1
-    expect_stat 'cache miss' 2
-    expect_stat 'files in cache' 2
-    expect_number_of_redis_cache_entries 2 "$redis_url" # result + manifest
 }