test: allow skipping nested local service probes
This commit is contained in:
@@ -11,6 +11,7 @@ if [[ -z "${UCE_CLI_SOCKET:-}" && -r /etc/uce/settings.cfg ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
include_kill=0
|
include_kill=0
|
||||||
|
skip_local_service_pages=0
|
||||||
action="run"
|
action="run"
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -18,13 +19,17 @@ while [[ $# -gt 0 ]]; do
|
|||||||
include_kill=1
|
include_kill=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--skip-local-service-pages)
|
||||||
|
skip_local_service_pages=1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
--list)
|
--list)
|
||||||
action="list"
|
action="list"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
cat <<'USAGE'
|
cat <<'USAGE'
|
||||||
Usage: scripts/run_cli_tests.sh [--include-wasm-kill] [--list]
|
Usage: scripts/run_cli_tests.sh [--include-wasm-kill] [--skip-local-service-pages] [--list]
|
||||||
|
|
||||||
Runs the UCE unit-based test suite through the runtime CLI socket.
|
Runs the UCE unit-based test suite through the runtime CLI socket.
|
||||||
USAGE
|
USAGE
|
||||||
@@ -42,5 +47,5 @@ if [[ ! -S "$socket_path" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
url="http://localhost/tests/cli_runner.uce?action=${action}&include_kill=${include_kill}"
|
url="http://localhost/tests/cli_runner.uce?action=${action}&include_kill=${include_kill}&skip_local_service_pages=${skip_local_service_pages}"
|
||||||
exec curl -sS --fail-with-body --unix-socket "$socket_path" "$url"
|
exec curl -sS --fail-with-body --unix-socket "$socket_path" "$url"
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ bool cli_site_body_reports_failure(String lower)
|
|||||||
return(cli_contains(lower, ">failed 1") || cli_contains(lower, ">failed 2") || cli_contains(lower, ">failed 3") || cli_contains(lower, ">failed 4") || cli_contains(lower, ">failed 5") || cli_contains(lower, ">failed 6") || cli_contains(lower, ">failed 7") || cli_contains(lower, ">failed 8") || cli_contains(lower, ">failed 9"));
|
return(cli_contains(lower, ">failed 1") || cli_contains(lower, ">failed 2") || cli_contains(lower, ">failed 3") || cli_contains(lower, ">failed 4") || cli_contains(lower, ">failed 5") || cli_contains(lower, ">failed 6") || cli_contains(lower, ">failed 7") || cli_contains(lower, ">failed 8") || cli_contains(lower, ">failed 9"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void cli_run_site_suite()
|
void cli_run_site_suite(bool skip_local_service_pages = false)
|
||||||
{
|
{
|
||||||
DValue manifest;
|
DValue manifest;
|
||||||
for(String line : split(file_get_contents("manifest.txt"), "\n"))
|
for(String line : split(file_get_contents("manifest.txt"), "\n"))
|
||||||
@@ -284,6 +284,11 @@ void cli_run_site_suite()
|
|||||||
if(parts.size() < 7 || trim(parts[5]) != "1")
|
if(parts.size() < 7 || trim(parts[5]) != "1")
|
||||||
continue;
|
continue;
|
||||||
String file = trim(parts[0]);
|
String file = trim(parts[0]);
|
||||||
|
if(skip_local_service_pages && (file == "io.uce" || file == "services.uce"))
|
||||||
|
{
|
||||||
|
cli_test_skip(String("uce_site_suite:site tests ") + (file == "io.uce" ? "filesystem" : "services"), "skipped local nested self-HTTP service probe pages for this environment");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
String title = trim(parts[1]);
|
String title = trim(parts[1]);
|
||||||
String expected = first(trim(parts[4]), title);
|
String expected = first(trim(parts[4]), title);
|
||||||
CliHttpResponse res;
|
CliHttpResponse res;
|
||||||
@@ -422,7 +427,7 @@ CLI(Request& context)
|
|||||||
cli_run_http_smoke();
|
cli_run_http_smoke();
|
||||||
print("[GROUP] http ", std::to_string((u64)((time_precise() - group_start) * 1000)), " ms\n");
|
print("[GROUP] http ", std::to_string((u64)((time_precise() - group_start) * 1000)), " ms\n");
|
||||||
group_start = time_precise();
|
group_start = time_precise();
|
||||||
cli_run_site_suite();
|
cli_run_site_suite(input["skip_local_service_pages"].to_bool());
|
||||||
print("[GROUP] site ", std::to_string((u64)((time_precise() - group_start) * 1000)), " ms\n");
|
print("[GROUP] site ", std::to_string((u64)((time_precise() - group_start) * 1000)), " ms\n");
|
||||||
group_start = time_precise();
|
group_start = time_precise();
|
||||||
cli_run_doc_pages_gate();
|
cli_run_doc_pages_gate();
|
||||||
|
|||||||
Reference in New Issue
Block a user