1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-23 22:05:07 +00:00

test: speed up bats execution

This commit is contained in:
Tw93
2026-03-14 09:19:54 +08:00
parent 169be1e1f2
commit 7697acb711
3 changed files with 35 additions and 13 deletions

View File

@@ -72,10 +72,10 @@ setup() {
mkdir -p "$test_cache"
run bash -c "
run_with_timeout() { shift; \"\$@\"; }
export -f run_with_timeout
source '$PROJECT_ROOT/lib/core/common.sh'
source '$PROJECT_ROOT/lib/clean/caches.sh'
run_with_timeout() { shift; \"\$@\"; }
export -f run_with_timeout
clean_service_worker_cache 'TestBrowser' '$test_cache'
"
[ "$status" -eq 0 ]
@@ -89,6 +89,10 @@ setup() {
mkdir -p "$test_cache/def456_https_example.com_0"
run bash -c "
export DRY_RUN=true
export PROTECTED_SW_DOMAINS=(capcut.com photopea.com)
source '$PROJECT_ROOT/lib/core/common.sh'
source '$PROJECT_ROOT/lib/clean/caches.sh'
run_with_timeout() {
local timeout=\"\$1\"
shift
@@ -105,10 +109,6 @@ setup() {
\"\$@\"
}
export -f run_with_timeout
export DRY_RUN=true
export PROTECTED_SW_DOMAINS=(capcut.com photopea.com)
source '$PROJECT_ROOT/lib/core/common.sh'
source '$PROJECT_ROOT/lib/clean/caches.sh'
clean_service_worker_cache 'TestBrowser' '$test_cache'
"
[ "$status" -eq 0 ]